From: "Marek Szuba" <marecki@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: media-gfx/gmic/files/, media-gfx/gmic/
Date: Thu, 1 Sep 2022 14:54:42 +0000 (UTC) [thread overview]
Message-ID: <1662044078.acb79ff2418e54589a4c3d0eebed048054e27889.marecki@gentoo> (raw)
commit: acb79ff2418e54589a4c3d0eebed048054e27889
Author: Marek Szuba <marecki <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 1 14:53:35 2022 +0000
Commit: Marek Szuba <marecki <AT> gentoo <DOT> org>
CommitDate: Thu Sep 1 14:54:38 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=acb79ff2
media-gfx/gmic: add 3.1.6
Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>
media-gfx/gmic/Manifest | 1 +
.../gmic/files/gmic-3.1.6-makefile_automagic.patch | 131 ++++++++++++++++++++
.../gmic/files/gmic-3.1.6-relative_rpath.patch | 11 ++
media-gfx/gmic/gmic-3.1.6.ebuild | 136 +++++++++++++++++++++
4 files changed, 279 insertions(+)
diff --git a/media-gfx/gmic/Manifest b/media-gfx/gmic/Manifest
index 12e056f95844..faa5c8711243 100644
--- a/media-gfx/gmic/Manifest
+++ b/media-gfx/gmic/Manifest
@@ -1 +1,2 @@
DIST gmic_3.0.1.tar.gz 10457923 BLAKE2B b495d10237abf5abe3d7df166119d2fc0b04142975d97db01ab0c5aa177f6e681931799fb392844e5c34d0503874a16d946a7146c5152cca1e64107948c02c03 SHA512 4bc08a3510e8987eea0463bfcf04de6dfd9a8ee8a38c14661ff201b8f563cab1b914dc60dc35b082cb5e868eb6232e2240a2d6703e0751215a82d6709236946a
+DIST gmic_3.1.6.tar.gz 10843311 BLAKE2B c50bcb9bd6c3d7d68a06f72faf0061d22b37c6fa357b40c16963c16a8841dba5ee8cf4509076a6734bb4eedbddfa2870897cb30687715ee6d7d84f2520700c17 SHA512 7d1ab97e8dfdf75b647cb7248eaa153e3ebcd5d1b799c67a6e027a5e2e8746047d348ea8e25485aed615d62f485dd06895fe6234f67a055cab423997b96f9775
diff --git a/media-gfx/gmic/files/gmic-3.1.6-makefile_automagic.patch b/media-gfx/gmic/files/gmic-3.1.6-makefile_automagic.patch
new file mode 100644
index 000000000000..8dbe50d6e194
--- /dev/null
+++ b/media-gfx/gmic/files/gmic-3.1.6-makefile_automagic.patch
@@ -0,0 +1,131 @@
+Includes the OpenEXR3 patch as well as support for building with USE=-X,
+as the relevant lines are deeply embedded in the automagic stuff.
+
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -226,8 +226,10 @@
+
+ # Enable parallelization in CImg, using OpenMP.
+ # (http://www.openmp.org/)
++ifeq ($(GMIC_USE_OPENMP),yes)
+ OPENMP_CFLAGS = -fopenmp -Dcimg_use_openmp
+ OPENMP_LIBS = -lgomp
++endif
+
+ # Enable software debugging.
+ # (Use address sanitizer and thus slows down the code)
+@@ -249,9 +251,13 @@
+ # Enable image display, using X11 (Unix).
+ # (Keep /usr/ dirname here since X11 is located in /usr/ on Mac too)
+ ifneq ($(OS),Darwin)
++ifeq ($(GMIC_USE_X11),yes)
+ X11_CFLAGS = -Dcimg_display=1 $(shell pkg-config --cflags x11 || echo -I/usr/X11R6/include) #-Dcimg_use_xrandr
+ X11_LIBS = $(shell pkg-config --libs x11 || echo -L/usr/X11R6/lib -lX11) -lpthread # $(shell pkg-config --libs xrandr || echo -lXrandr)
+ else
++X11_CFLAGS = -Dcimg_display=0
++endif
++else
+ ifeq (,$(wildcard /usr/X11))
+ X11_CFLAGS = -Dcimg_display=0 #-Dcimg_use_xrandr
+ X11_LIBS = -lpthread # $(shell pkg-config --libs xrandr || echo -lXrandr)
+@@ -263,8 +269,10 @@
+
+ # Enable faster X11 display, using XShm extension.
+ # (ftp://www.x.org/pub/X11R7.7/doc/man/man3/XShm.3.xhtml)
++ifeq ($(GMIC_USE_XSHM),yes)
+ XSHM_CFLAGS = -Dcimg_use_xshm $(shell pkg-config --cflags xcb-shm)
+ XSHM_LIBS = $(shell pkg-config --libs xcb-shm || echo -L$(USR)/X11R6/lib) -lXext
++endif
+
+ # Enable image display, using GDI32 (Windows).
+ GDI32_CFLAGS = -Dcimg_display=2
+@@ -273,8 +281,10 @@
+ # Enable native support of PNG image files, using the PNG library.
+ # (http://www.libpng.org/pub/png/libpng.html)
+ ifneq ($(OS),Darwin)
++ifeq ($(GMIC_USE_PNG),yes)
+ PNG_CFLAGS = -Dcimg_use_png $(shell pkg-config --cflags libpng)
+ PNG_LIBS = $(shell pkg-config --libs libpng || echo -lpng -lz)
++endif
+ else
+ ifeq (,$(wildcard /tmp/skl))
+ PNG_CFLAGS = -Dcimg_use_png $(shell pkg-config --cflags libpng)
+@@ -287,56 +297,76 @@
+
+ # Enable native support of JPEG image files, using the JPEG library.
+ # (http://libjpeg.sourceforge.net/)
++ifeq ($(GMIC_USE_JPEG),yes)
+ JPEG_CFLAGS = -Dcimg_use_jpeg $(shell pkg-config --cflags libjpeg)
+ JPEG_LIBS = $(shell pkg-config --libs libjpeg || echo -ljpeg)
++endif
+
+ # Enable native support of TIFF image files, using the TIFF library.
+ # (http://www.libtiff.org/)
++ifeq ($(GMIC_USE_TIFF),yes)
+ TIFF_CFLAGS = -Dcimg_use_tiff $(shell pkg-config --cflags libtiff-4)
+ TIFF_LIBS = $(shell pkg-config --libs libtiff-4 || echo -ltiff)
++endif
+
+ # Enable native support for loading HEIC/AVIF image files, using the libheif library.
+ # ( https://github.com/strukturag/libheif )
++ifeq ($(GMIC_USE_HEIF),yes)
+ HEIF_CFLAGS = -Dcimg_use_heif
+ HEIF_LIBS = -lheif
++endif
+
+ # Enable native support of MINC2 image files, using the MINC2 library.
+ # ( http://en.wikibooks.org/wiki/MINC/Reference/MINC2.0_Users_Guide )
++ifeq ($(GMIC_USE_MINC2),yes)
+ MINC2_CFLAGS = -Dcimg_use_minc2 -I${HOME}/local/include
+ MINC2_LIBS = -lminc_io -lvolume_io2 -lminc2 -lnetcdf -lhdf5 -lz -L${HOME}/local/lib
++endif
+
+ # Enable native support for downloading files from the network.
+ # ( http://curl.haxx.se/libcurl/ )
++ifeq ($(GMIC_USE_CURL),yes)
+ CURL_CFLAGS = -Dcimg_use_curl $(shell pkg-config --cflags libcurl)
+ CURL_LIBS = $(shell pkg-config --libs libcurl || echo -lcurl)
++endif
+
+ # Enable native support of webcams and video streaming, using the OpenCV library.
+ # (https://opencv.org/)
++ifeq ($(GMIC_USE_OPENCV),yes)
+ OPENCV_CFLAGS = -Dcimg_use_opencv $(shell pkg-config opencv --cflags) -I/usr/include/opencv -I/usr/include/opencv4
+ OPENCV_LIBS = $(shell pkg-config opencv --libs || echo -lopencv_core -lopencv_highgui -lopencv_videoio)
++endif
+
+ # Enable support of most classical image file formats, using the GraphicsMagick++ library.
+ # (http://www.graphicsmagick.org/Magick++/)
++ifeq ($(GMIC_USE_GRAPHICSMAGICK),yes)
+ MAGICK_CFLAGS = -Dcimg_use_magick $(shell pkg-config --cflags GraphicsMagick++ || echo -I$(USR)/$(INCLUDE)/GraphicsMagick)
+ MAGICK_LIBS = $(shell pkg-config --libs GraphicsMagick++ || echo -lGraphicsMagick++)
++endif
+
+ # Enable native support of EXR image files, using the OpenEXR library.
+ # (http://www.openexr.com/)
+-OPENEXR_CFLAGS = -Dcimg_use_openexr $(shell pkg-config --cflags OpenEXR || echo -I$(USR)/$(INCLUDE)/OpenEXR)
+-OPENEXR_LIBS = $(shell pkg-config --libs OpenEXR || echo -lIlmImf -lHalf)
++ifeq ($(GMIC_USE_EXR),yes)
++OPENEXR_CFLAGS = -Dcimg_use_openexr $(shell pkg-config --cflags OpenEXR || echo -I$(USR)/$(INCLUDE)/OpenEXR -I$(USR)/$(INCLUDE)/Imath)
++OPENEXR_LIBS = $(shell pkg-config --libs OpenEXR || echo -lOpenEXR -lImath)
++endif
+
+ # Enable Fast Fourier Transforms, using the FFTW3 library.
+ # (http://www.fftw.org/)
++ifeq ($(GMIC_USE_FFTW),yes)
+ FFTW_CFLAGS = -Dcimg_use_fftw3 $(shell pkg-config --cflags fftw3)
+ FFTW_LIBS = $(shell pkg-config --libs fftw3 || echo -lfftw3)
+ ifneq ($(OS),Windows)
+ FFTW_LIBS += -lfftw3_threads
+ endif
++endif
+
+ # Enable native support of the BOARD library.
+ # (https://github.com/c-koi/libboard)
++ifeq ($(GMIC_USE_BOARD),yes)
+ BOARD_CFLAGS = -Dcimg_use_board
+ BOARD_LIBS = -lboard
++endif
+
+ GMIC_STD_CFLAGS = $(MANDATORY_CFLAGS) $(ABORT_CFLAGS) $(PARALLEL_CFLAGS) $(FFTW_CFLAGS) $(CURL_CFLAGS) $(PNG_CFLAGS) $(JPEG_CFLAGS) $(TIFF_CFLAGS)
+ GMIC_STD_LIBS = $(MANDATORY_LIBS) $(PARALLEL_LIBS) $(FFTW_LIBS) $(CURL_LIBS) $(PNG_LIBS) $(JPEG_LIBS) $(TIFF_LIBS)
diff --git a/media-gfx/gmic/files/gmic-3.1.6-relative_rpath.patch b/media-gfx/gmic/files/gmic-3.1.6-relative_rpath.patch
new file mode 100644
index 000000000000..e2da793f31a8
--- /dev/null
+++ b/media-gfx/gmic/files/gmic-3.1.6-relative_rpath.patch
@@ -0,0 +1,11 @@
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -187,7 +187,7 @@
+ ifndef NO_SRIPDLIB
+ MANDATORY_CFLAGS += -std=c++11 -pedantic
+ endif
+-MANDATORY_LIBS += -L. -L$(USR)/$(LIB) -Wl,-rpath,.
++MANDATORY_LIBS += -L. -L$(USR)/$(LIB)
+ 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)
diff --git a/media-gfx/gmic/gmic-3.1.6.ebuild b/media-gfx/gmic/gmic-3.1.6.ebuild
new file mode 100644
index 000000000000..06ca0c8a4cc3
--- /dev/null
+++ b/media-gfx/gmic/gmic-3.1.6.ebuild
@@ -0,0 +1,136 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 toolchain-funcs
+
+if [[ ${PV} == "9999" ]]; then
+ EGIT_REPO_URI="https://github.com/dtschump/gmic.git"
+ inherit git-r3
+else
+ SRC_URI="https://gmic.eu/files/source/${PN}_${PV}.tar.gz"
+ KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~x86"
+fi
+
+DESCRIPTION="GREYC's Magic Image Converter"
+HOMEPAGE="https://gmic.eu/ https://github.com/dtschump/gmic"
+
+LICENSE="CeCILL-2 GPL-3"
+SLOT="0"
+IUSE="cli curl ffmpeg fftw gimp graphicsmagick jpeg opencv openexr openmp png qt5 tiff X"
+REQUIRED_USE="
+ gimp? ( png fftw X )
+ qt5? ( png fftw X )
+"
+
+MIN_QT_VER="5.2.0"
+QT_DEPEND="
+ >=dev-qt/qtcore-${MIN_QT_VER}:5
+ >=dev-qt/qtgui-${MIN_QT_VER}:5
+ >=dev-qt/qtnetwork-${MIN_QT_VER}:5
+ >=dev-qt/qtwidgets-${MIN_QT_VER}:5
+"
+DEPEND="
+ sys-libs/zlib:0=
+ curl? ( net-misc/curl )
+ fftw? ( sci-libs/fftw:3.0=[threads] )
+ gimp? (
+ media-gfx/gimp:0/2
+ ${QT_DEPEND}
+ )
+ graphicsmagick? ( media-gfx/graphicsmagick:0= )
+ jpeg? ( media-libs/libjpeg-turbo:= )
+ opencv? ( >=media-libs/opencv-2.3.1a-r1:0= )
+ openexr? (
+ dev-libs/imath:=
+ media-libs/openexr:=
+ )
+ png? ( media-libs/libpng:0= )
+ qt5? ( ${QT_DEPEND} )
+ tiff? ( media-libs/tiff:0 )
+ X? (
+ x11-libs/libX11
+ x11-libs/libXext
+ )"
+RDEPEND="${DEPEND}
+ ffmpeg? ( media-video/ffmpeg:0= )
+"
+BDEPEND="
+ virtual/pkgconfig
+ gimp? (
+ dev-qt/linguist-tools:5
+ media-gfx/gimp:0/2
+ )
+ qt5? ( dev-qt/linguist-tools:5 )
+"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.1.6-makefile_automagic.patch
+ "${FILESDIR}"/${PN}-3.1.6-relative_rpath.patch
+)
+
+pkg_pretend() {
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+pkg_setup() {
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+gmic_emake() {
+ emake -j1 -C src \
+ CC="$(tc-getCC)" \
+ CXX="$(tc-getCXX)" \
+ STRIP="/bin/true" \
+ LIB="$(get_libdir)" \
+ OPT_CFLAGS="${CXXFLAGS}" \
+ OPT_LIBS="${LDFLAGS}" \
+ GMIC_USE_CURL=$(usex curl) \
+ GMIC_USE_EXR=$(usex openexr) \
+ GMIC_USE_FFTW=$(usex fftw) \
+ GMIC_USE_GRAPHICSMAGICK=$(usex graphicsmagick) \
+ GMIC_USE_JPEG=$(usex jpeg) \
+ GMIC_USE_OPENCV=$(usex opencv) \
+ GMIC_USE_OPENMP=$(usex openmp) \
+ GMIC_USE_PNG=$(usex png) \
+ GMIC_USE_TIFF=$(usex tiff) \
+ GMIC_USE_X11=$(usex X) \
+ QMAKE="qmake5" \
+ $@
+}
+
+# FIXME:
+# - honour user CFLAGS while building C binaries (i.e. 'use_libcgmic')
+src_compile() {
+ gmic_emake lib libc
+ use cli && gmic_emake cli_shared
+ use gimp && gmic_emake gimp_shared
+ use qt5 && gmic_emake gmic_qt_shared
+}
+
+src_install() {
+ # See below for why this has to name a directory even if USE=-gimp
+ local gimp_plugindir="/deleteme"
+ if use gimp; then
+ if type gimptool &>/dev/null; then
+ gimp_plugindir="$(gimptool --gimpplugindir)/plug-ins"
+ elif type gimptool-2.0 &>/dev/null; then
+ gimp_plugindir="$(gimptool-2.0 --gimpplugindir)/plug-ins"
+ elif type gimptool-2.99 &>/dev/null; then
+ gimp_plugindir="$(gimptool-2.99 --gimpplugindir)/plug-ins"
+ else
+ die "Cannot find GIMP plugin directory"
+ fi
+ fi
+
+ gmic_emake DESTDIR="${ED}" PLUGINDIR="${gimp_plugindir}" install
+
+ # Upstream build scripts create PLUGINDIR and write some files to it
+ # regardless of whether the GIMP plug-in has been built or not, or even
+ # when they haven't been able to execute gimptool to get the base path.
+ use gimp || rm -rf "${ED}/${gimp_plugindir}"
+
+ # These are already gzipped in the source tarballs
+ find "${ED}/usr/share/man" -name "*.gz" -exec gunzip {} \; || die
+}
next reply other threads:[~2022-09-01 14:54 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-01 14:54 Marek Szuba [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-08-22 21:35 [gentoo-commits] repo/gentoo:master commit in: media-gfx/gmic/files/, media-gfx/gmic/ Marek Szuba
2023-08-21 15:49 Marek Szuba
2023-05-23 20:36 Marek Szuba
2023-04-02 22:20 Marek Szuba
2023-02-28 10:42 Marek Szuba
2020-04-05 10:05 Tim Harder
2020-01-03 6:34 Tim Harder
2016-12-09 7:06 Tim Harder
2016-11-30 7:07 Tim Harder
2015-08-25 1:37 Tim Harder
2015-08-25 1:37 Tim Harder
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1662044078.acb79ff2418e54589a4c3d0eebed048054e27889.marecki@gentoo \
--to=marecki@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox