Update to 3.1.6

This commit is contained in:
Sérgio M. Basto 2022-11-08 12:57:40 +00:00
parent 6ce25e1c2c
commit deaa41f72c
4 changed files with 63 additions and 133 deletions

View File

@ -1,28 +1,26 @@
From 27655a3200c07546c74e3c56a315188678b13d26 Mon Sep 17 00:00:00 2001
From: Kalev Lember <klember@redhat.com>
Date: Sat, 3 Sep 2022 20:18:14 +0200
Subject: [PATCH 1/3] Makefile: Rename USR variable to PREFIX
Call it prefix as this is what almost all other build systems use for
choosing the install location.
---
src/Makefile | 126 +++++++++++++++++++++++++--------------------------
1 file changed, 63 insertions(+), 63 deletions(-)
diff --git a/src/Makefile b/src/Makefile
index 2b09aef5..ff98dfbe 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -80,7 +80,7 @@
--- ./src/Makefile.old 2022-11-08 03:18:08.964802055 +0000
+++ ./src/Makefile 2022-11-08 03:18:12.482790804 +0000
@@ -80,14 +80,15 @@
# Try to auto-detect target OS.
OS = $(shell uname)
-USR = /usr
+PREFIX = /usr
LIB = lib
BIN = bin
INCLUDE = include
@@ -120,12 +120,12 @@ endif
-LIB = lib
-BIN = bin
-INCLUDE = include
+PREFIX ?= /usr
+LIB ?= lib
+BIN ?= bin
+INCLUDE ?= include
PIC = -fPIC
EXE =
WGET = wget --no-check-certificate --quiet -O
PLUGINDIR = $(shell gimptool-2.0 --gimpplugindir)/plug-ins
+BASH_COMPLETIONSDIR = $(shell pkg-config --variable completionsdir bash-completion || echo $(PREFIX)/share/bash-completion/completions)
VERSION = $(shell grep 'gmic_version\ ' gmic.h | tail -c4 | head -c3)
VERSION1 = $(shell grep 'gmic_version\ ' gmic.h | tail -c4 | head -c1)
VERSION2 = $(shell grep 'gmic_version\ ' gmic.h | tail -c3 | head -c1)
@@ -120,12 +121,12 @@ endif
ifeq ($(OS),FreeBSD)
OS = Unix
@ -37,7 +35,7 @@ index 2b09aef5..ff98dfbe 100644
endif
ifeq ($(OS),NetBSD)
@@ -134,15 +134,15 @@ endif
@@ -134,15 +135,15 @@ endif
ifneq (,$(findstring MINGW,$(OS)))
OS = Windows
@ -56,8 +54,8 @@ index 2b09aef5..ff98dfbe 100644
endif
WGET = curl -k -L --silent -o
endif
@@ -181,13 +181,13 @@ PRERELEASE = $(shell date +%y%m%d)
PRERELEASE_CFLAGS = -Dgmic_prerelease="\\\"$(PRERELEASE)\\\""
@@ -181,13 +182,13 @@ NO_PRERELEASE = $(shell date +%y%m%d)
NO_PRERELEASE_CFLAGS = -Dgmic_prerelease="\\\"$(PRERELEASE)\\\""
# Minimal set of flags mandatory to compile G'MIC.
-MANDATORY_CFLAGS = -Dcimg_date=\\\"\\\" -Dcimg_time=\\\"\\\" -Dcimg_use_zlib -I. $(shell pkg-config --cflags zlib || echo -I$(USR)/$(INCLUDE)) $(PRERELEASE_CFLAGS) $(EXTRA_CFLAGS)
@ -72,7 +70,7 @@ index 2b09aef5..ff98dfbe 100644
ifdef IS_GCC
MANDATORY_CFLAGS += -Wall -Wextra -Wfatal-errors -Werror=unknown-pragmas -Werror=unused-label
GCC_VER_GTEQ5 = $(shell expr `$(CXX) -dumpversion | cut -f1 -d.` \>= 5)
@@ -264,7 +264,7 @@ endif
@@ -264,7 +265,7 @@ endif
# Enable faster X11 display, using XShm extension.
# (ftp://www.x.org/pub/X11R7.7/doc/man/man3/XShm.3.xhtml)
XSHM_CFLAGS = -Dcimg_use_xshm $(shell pkg-config --cflags xcb-shm)
@ -81,7 +79,7 @@ index 2b09aef5..ff98dfbe 100644
# Enable image display, using GDI32 (Windows).
GDI32_CFLAGS = -Dcimg_display=2
@@ -317,12 +317,12 @@ OPENCV_LIBS = $(shell pkg-config opencv --libs || echo -lopencv_core -lopencv_hi
@@ -317,12 +318,12 @@ OPENCV_LIBS = $(shell pkg-config opencv
# Enable support of most classical image file formats, using the GraphicsMagick++ library.
# (http://www.graphicsmagick.org/Magick++/)
@ -96,7 +94,7 @@ index 2b09aef5..ff98dfbe 100644
OPENEXR_LIBS = $(shell pkg-config --libs OpenEXR || echo -lIlmImf -lHalf)
# Enable Fast Fourier Transforms, using the FFTW3 library.
@@ -439,7 +439,7 @@ cli_shared:
@@ -439,7 +440,7 @@ cli_shared:
# CLI (static).
#--------------
@ -105,7 +103,7 @@ index 2b09aef5..ff98dfbe 100644
GMIC_STATIC_CLI_EXTRA =
GMIC_STATIC_CLI_CFLAGS = -Dcimg_display=0 $(MANDATORY_CFLAGS) $(OPENMP_CFLAGS) $(ABORT_CFLAGS) $(PARALLEL_CFLAGS) $(ZLIB_CFLAGS) $(PNG_CFLAGS) $(JPEG_CFLAGS) $(FFTW_CFLAGS)
GMIC_STATIC_CLI_LIBS = ./libgmic.o $(PARALLEL_LIBS) \
@@ -810,35 +810,35 @@ man:
@@ -818,84 +819,78 @@ man:
# Install / uninstall / clean.
#-----------------------------
install:
@ -160,9 +158,16 @@ index 2b09aef5..ff98dfbe 100644
+ cp -f ../man/gmic.1.gz $(DESTDIR)$(PREFIX)/share/man/fr/man1/gmic.1.gz; \
fi
@if [ -f ../resources/gmic_bashcompletion.sh ]; then \
if [ -d /usr/share/bash-completion/completions ]; then \
@@ -851,43 +851,43 @@ install:
fi; \
- if [ -d /usr/share/bash-completion/completions ]; then \
- mkdir -p $(DESTDIR)/usr/share/bash-completion/completions; \
- cp -f ../resources/gmic_bashcompletion.sh $(DESTDIR)/usr/share/bash-completion/completions/gmic; \
- fi; \
- if [ -d /opt/local/etc/bash_completion.d/ ]; then \
- mkdir -p $(DESTDIR)/opt/local/etc/bash_completion.d; \
- cp -f ../resources/gmic_bashcompletion.sh $(DESTDIR)/opt/local/etc/bash_completion.d/gmic; \
- fi; \
+ mkdir -p $(DESTDIR)$(BASH_COMPLETIONSDIR); \
+ cp -f ../resources/gmic_bashcompletion.sh $(DESTDIR)$(BASH_COMPLETIONSDIR)/gmic; \
fi
@if [ -f ../zart/zart ]; then \
- mkdir -p $(DESTDIR)$(USR)/share/applications; \
@ -236,86 +241,3 @@ index 2b09aef5..ff98dfbe 100644
distclean: clean
--
2.37.2
From 6a5f47813e4a8d789b5eadd8969c1b1d1ffe902f Mon Sep 17 00:00:00 2001
From: Kalev Lember <klember@redhat.com>
Date: Sat, 3 Sep 2022 20:20:30 +0200
Subject: [PATCH 2/3] Makefile: Make a few variables configurable
This makes it easier for downstreams to choose where they want to put
the files, such as libs going into /usr/lib64 in Fedora, or use the /app
prefix for flatpaks.
---
src/Makefile | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/Makefile b/src/Makefile
index ff98dfbe..62aea93b 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -80,10 +80,10 @@
# Try to auto-detect target OS.
OS = $(shell uname)
-PREFIX = /usr
-LIB = lib
-BIN = bin
-INCLUDE = include
+PREFIX ?= /usr
+LIB ?= lib
+BIN ?= bin
+INCLUDE ?= include
PIC = -fPIC
EXE =
WGET = wget --no-check-certificate --quiet -O
--
2.37.2
From 5dd4ccf624552ef582f46af159f5c13d0cf43be5 Mon Sep 17 00:00:00 2001
From: Kalev Lember <klember@redhat.com>
Date: Sat, 3 Sep 2022 20:36:28 +0200
Subject: [PATCH 3/3] Makefile: Avoid hardcoding bash-completion paths
Instead, use pkg-config to query the bash-completion path, which
both makes the makefile simpler and also helps get the path right in
more cases.
---
src/Makefile | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/src/Makefile b/src/Makefile
index 62aea93b..32da0424 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -88,6 +88,7 @@ PIC = -fPIC
EXE =
WGET = wget --no-check-certificate --quiet -O
PLUGINDIR = $(shell gimptool-2.0 --gimpplugindir)/plug-ins
+BASH_COMPLETIONSDIR = $(shell pkg-config --variable completionsdir bash-completion || echo $(PREFIX)/share/bash-completion/completions)
VERSION = $(shell grep 'gmic_version\ ' gmic.h | tail -c4 | head -c3)
VERSION1 = $(shell grep 'gmic_version\ ' gmic.h | tail -c4 | head -c1)
VERSION2 = $(shell grep 'gmic_version\ ' gmic.h | tail -c3 | head -c1)
@@ -841,14 +842,8 @@ install:
cp -f ../man/gmic.1.gz $(DESTDIR)$(PREFIX)/share/man/fr/man1/gmic.1.gz; \
fi
@if [ -f ../resources/gmic_bashcompletion.sh ]; then \
- if [ -d /usr/share/bash-completion/completions ]; then \
- mkdir -p $(DESTDIR)/usr/share/bash-completion/completions; \
- cp -f ../resources/gmic_bashcompletion.sh $(DESTDIR)/usr/share/bash-completion/completions/gmic; \
- fi; \
- if [ -d /opt/local/etc/bash_completion.d/ ]; then \
- mkdir -p $(DESTDIR)/opt/local/etc/bash_completion.d; \
- cp -f ../resources/gmic_bashcompletion.sh $(DESTDIR)/opt/local/etc/bash_completion.d/gmic; \
- fi; \
+ mkdir -p $(DESTDIR)$(BASH_COMPLETIONSDIR); \
+ cp -f ../resources/gmic_bashcompletion.sh $(DESTDIR)$(BASH_COMPLETIONSDIR)/gmic; \
fi
@if [ -f ../zart/zart ]; then \
mkdir -p $(DESTDIR)$(PREFIX)/share/applications; \
--
2.37.2

View File

@ -3,19 +3,19 @@
%global use_system_cimg 1
# As generated by new-snapshot.sh script
%global zart_version 20220429gitac29dcb
%global gmic_qt_version 20220429git6d69f1c
%global gmic_community_version 20220429git7b85db6
%global zart_version 20220629git34ebf6c
%global gmic_qt_version 20221107git52691b4
%global gmic_community_version 20221107gitdbf451b
Summary: GREYC's Magic for Image Computing
Name: gmic
Version: 3.1.0
Release: 5%{?dist}
Version: 3.1.6
Release: 1%{?dist}
Source0: https://gmic.eu/files/source/%{name}_%{version}.tar.gz
# GIT archive snapshot of https://github.com/c-koi/zart
Source1: zart-%{zart_version}.tar.gz
# GIT archive snapshot of https://github.com/c-koi/gmic-qt
Source2: gmic-qt-%{gmic_qt_version}.tar.gz
# Source2: gmic-qt-%{gmic_qt_version}.tar.gz
# GIT archive snapshot of https://github.com/dtschump/gmic-community
Source3: gmic-community-%{gmic_community_version}.tar.gz
License: (CeCILL or CeCILL-C) and GPLv3+
@ -46,6 +46,7 @@ BuildRequires: libcurl-devel
BuildRequires: gcc-c++
BuildRequires: desktop-file-utils
BuildRequires: make
#BuildRequires: cmake
BuildRequires: chrpath
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
@ -54,8 +55,8 @@ Requires: %{name}-libs%{?_isa} = %{version}-%{release}
# package despite being a shared library
Obsoletes: gmic-static <= 2.1.8
Patch0: gmic-openexr3.patch
Patch2: Makefile_arch.patch
#Patch0: gmic-openexr3.patch
#Patch2: Makefile_arch.patch
# Backported from upstream
# https://github.com/GreycLab/gmic/pull/412
Patch3: gmic-prefix-fixes.patch
@ -103,7 +104,7 @@ multi-spectral volumetric images.
Provides G'MIC shared libraries
%prep
%setup -q -a 1 -a 2 -a 3
%setup -q -a 1 -a 3
#%if 0%{?fedora} > 34
#%patch0 -p1
@ -119,7 +120,8 @@ Provides G'MIC shared libraries
rm -f zart/.qmake.stash
%build
export CCACHE_DISABLE=1
# ccache can be used only in local builds, koji and copr don't use it
#export CCACHE_DISABLE=1
cd src
ln -fs ../gmic-community/libcgmic/gmic_libc.cpp .
@ -139,6 +141,11 @@ make OPT_CFLAGS="%{optflags} -g" NOSTRIP=1 PREFIX=%{_prefix} LIB=%{_lib} cli lib
cd ../gmic-qt
%{qmake_qt5} CONFIG+=release GMIC_PATH=../src HOST=gimp gmic_qt.pro && %{make_build}
%{qmake_qt5} CONFIG+=release GMIC_PATH=../src HOST=none gmic_qt.pro && %{make_build}
#%%define gmic_qt_options -DGMIC_PATH=../src -DENABLE_SYSTEM_GMIC=OFF -DENABLE_DYNAMIC_LINKING=ON
#%%cmake %{gmic_qt_options} -DGMIC_QT_HOST=none
#%%cmake_build
#%%cmake %{gmic_qt_options} -DGMIC_QT_HOST=gimp
#%%cmake_build
cd ../zart
%{qmake_qt5} CONFIG+=release GMIC_PATH=../src zart.pro && %{make_build}
@ -166,8 +173,8 @@ chmod -x $RPM_BUILD_ROOT/%{_sysconfdir}/bash_completion.d/gmic
# remove rpaths
chrpath --delete $RPM_BUILD_ROOT%{_bindir}/gmic
chrpath --delete $RPM_BUILD_ROOT%{_libdir}/libcgmic.so.310
chrpath --delete $RPM_BUILD_ROOT%{_libdir}/libgmic.so.310
chrpath --delete $RPM_BUILD_ROOT%{_libdir}/libcgmic.so.316
chrpath --delete $RPM_BUILD_ROOT%{_libdir}/libgmic.so.316
%ldconfig_scriptlets libs
@ -216,6 +223,9 @@ fi
%{_libdir}/libcgmic.so.3*
%changelog
* Tue Nov 08 2022 Sérgio Basto <sergio@serjux.com> - 3.1.6-1
- Update to 3.1.6
* Sun Oct 09 2022 Kalev Lember <klember@redhat.com> - 3.1.0-5
- Split out gmic-libs to a subpackage

View File

@ -16,9 +16,8 @@ function archive_it() {
git clone $uri
fi
DATE=`date +"%Y%m%d"`
cd $name
DATE=$(git log -1 --format=%cd --date=short | tr -d \-)
HASH=`git rev-parse --short HEAD`
FILE=${name}-${DATE}git${HASH}.tar.gz
@ -33,7 +32,7 @@ function print_hash() {
cd $name
HASH=`git rev-parse --short HEAD`
today=`date +"%Y%m%d"`
today=$(git log -1 --format=%cd --date=short | tr -d \-)
macro=`echo $name | sed -e 's/-/_/g'`
echo "%global ${macro}_version ${today}git${HASH}"

View File

@ -1,4 +1,3 @@
SHA512 (gmic-community-20220429git7b85db6.tar.gz) = fcacfe8d0f5b8550aee58e88145e11f800c2e920919b1f61a60ff8ead8ce0f59386d40f7885e362de312a6c8d6c6588777a0a8cdecb49dc77f52325989ef2c3a
SHA512 (gmic-qt-20220429git6d69f1c.tar.gz) = 1a4f2685dd22f14e59f4b1b953f2107ce004eb8448e6162de19b33c2b70724bc27fdc364cd65502b59f3eebf280c7eb6bbf63b5529b30dab9460be49def7aadf
SHA512 (zart-20220429gitac29dcb.tar.gz) = c39851839ca48bc6f988a2b11579afb1e5ce13f6b3e52547148bcc18344795af77fef2b5a83ab7ee29632746e195f98fdfbd816bb5ff4bc4a66a66ed579a2ae5
SHA512 (gmic_3.1.0.tar.gz) = 0dd1a524901f044cf4c964b62d110168a396f68af8aed367f341a72fd06e60a9f02ab80f3e294bf6ae4243ba0acc0897d6f97f100beb890dab3ba385bf0b9976
SHA512 (gmic-community-20221107gitdbf451b.tar.gz) = 3647f5186104a8c60df690939292da8a60684ea84c2ff5e97781257ff19c3d317b3d8248d4ee48aabab36d2fa6e984835e28d41d8ba24786039d60ebdce9add0
SHA512 (zart-20220629git34ebf6c.tar.gz) = e5b4b5df77191aa3462a4e3dec93426b71b24af5e5393a793de5ef56d68f9950521e802ca4a924cf7f0aa0acd7634c5cc3b0b9c14ae146257562c415583fc9f0
SHA512 (gmic-3.1.6-1.fc38.src.rpm) = 27781a9cd2dc5ffd2d0eb6c8cd468e5a1f011e8d1cf27e185293375a096485e2fc8d4546621ba0f7f42c40b3a3cd60b5852428aec4dda620ea9f2c756cc811ee