Gentoo Archives: gentoo-commits

From: Marek Szuba <marecki@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-gfx/gmic/
Date: Tue, 28 Feb 2023 10:42:56
Message-Id: 1677580948.c017fa0361f650cb3ffe21681b9d88110ab4ed90.marecki@gentoo
1 commit: c017fa0361f650cb3ffe21681b9d88110ab4ed90
2 Author: Marek Szuba <marecki <AT> gentoo <DOT> org>
3 AuthorDate: Tue Feb 28 09:50:51 2023 +0000
4 Commit: Marek Szuba <marecki <AT> gentoo <DOT> org>
5 CommitDate: Tue Feb 28 10:42:28 2023 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c017fa03
7
8 media-gfx/gmic: add 3.2.1
9
10 Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>
11
12 media-gfx/gmic/Manifest | 1 +
13 media-gfx/gmic/gmic-3.2.1.ebuild | 138 +++++++++++++++++++++++++++++++++++++++
14 2 files changed, 139 insertions(+)
15
16 diff --git a/media-gfx/gmic/Manifest b/media-gfx/gmic/Manifest
17 index ccbaa655c45e..f5db8513e425 100644
18 --- a/media-gfx/gmic/Manifest
19 +++ b/media-gfx/gmic/Manifest
20 @@ -1,2 +1,3 @@
21 DIST gmic_3.1.6.tar.gz 10843311 BLAKE2B c50bcb9bd6c3d7d68a06f72faf0061d22b37c6fa357b40c16963c16a8841dba5ee8cf4509076a6734bb4eedbddfa2870897cb30687715ee6d7d84f2520700c17 SHA512 7d1ab97e8dfdf75b647cb7248eaa153e3ebcd5d1b799c67a6e027a5e2e8746047d348ea8e25485aed615d62f485dd06895fe6234f67a055cab423997b96f9775
22 DIST gmic_3.2.0.tar.gz 10933655 BLAKE2B 6b87acb2a356d3d0c00e795d8b66de75acffa1f87b63caf58986ab52730fcd58bb9dfa37caf057ac2ab2a58695dd783c09018305f21d258427d9c1e450d1c14d SHA512 2eccf179e865416ce5a6cc38fd5587fe79fb30cda381ca2bcb1e587f101a55c502422121d4696834bc25b6200aa3c2292ff30947f2704a610f46e61460685f5b
23 +DIST gmic_3.2.1.tar.gz 11236401 BLAKE2B 8a68cee641892298e93373f9ad1a1ea4dd9995d813db7050a8a1c5f6658b2b08f9f9c4064dbef2a87e5350dc62c0bfa10d226a53ebff1962c3ad3a75ad318fba SHA512 c03a06acdf6669291602df4938a14de113d48ffa598b3c4af7975bd16aea37d426878ff0f593f22992da135a7b6e27fbb39dbaca4f89726ec367552f14be433b
24
25 diff --git a/media-gfx/gmic/gmic-3.2.1.ebuild b/media-gfx/gmic/gmic-3.2.1.ebuild
26 new file mode 100644
27 index 000000000000..e37b2cb59f90
28 --- /dev/null
29 +++ b/media-gfx/gmic/gmic-3.2.1.ebuild
30 @@ -0,0 +1,138 @@
31 +# Copyright 1999-2023 Gentoo Authors
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI=8
35 +
36 +inherit toolchain-funcs
37 +
38 +DESCRIPTION="GREYC's Magic Image Converter"
39 +HOMEPAGE="https://gmic.eu/ https://github.com/GreycLab/gmic"
40 +SRC_URI="https://gmic.eu/files/source/${PN}_${PV}.tar.gz"
41 +
42 +LICENSE="CeCILL-2 GPL-3"
43 +SLOT="0"
44 +KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~x86"
45 +IUSE="cli curl ffmpeg fftw gimp graphicsmagick jpeg opencv openexr openmp png qt5 tiff X"
46 +
47 +REQUIRED_USE="
48 + gimp? ( png fftw X )
49 + qt5? ( png fftw X )
50 +"
51 +
52 +MIN_QT_VER="5.2.0"
53 +QT_DEPEND="
54 + >=dev-qt/qtcore-${MIN_QT_VER}:5
55 + >=dev-qt/qtgui-${MIN_QT_VER}:5
56 + >=dev-qt/qtnetwork-${MIN_QT_VER}:5
57 + >=dev-qt/qtwidgets-${MIN_QT_VER}:5
58 +"
59 +DEPEND="
60 + sys-libs/zlib:0=
61 + curl? ( net-misc/curl )
62 + fftw? ( sci-libs/fftw:3.0=[threads] )
63 + gimp? (
64 + media-gfx/gimp:0/2
65 + ${QT_DEPEND}
66 + )
67 + graphicsmagick? ( media-gfx/graphicsmagick:= )
68 + jpeg? ( media-libs/libjpeg-turbo:= )
69 + opencv? ( >=media-libs/opencv-2.3.1a-r1:= )
70 + openexr? (
71 + dev-libs/imath:=
72 + media-libs/openexr:=
73 + )
74 + png? ( media-libs/libpng:= )
75 + qt5? ( ${QT_DEPEND} )
76 + tiff? ( media-libs/tiff:= )
77 + X? (
78 + x11-libs/libX11
79 + x11-libs/libXext
80 + )"
81 +RDEPEND="${DEPEND}
82 + ffmpeg? ( media-video/ffmpeg:= )
83 +"
84 +BDEPEND="
85 + virtual/pkgconfig
86 + gimp? (
87 + dev-qt/linguist-tools:5
88 + media-gfx/gimp:0/2
89 + )
90 + qt5? ( dev-qt/linguist-tools:5 )
91 +"
92 +
93 +PATCHES=(
94 + "${FILESDIR}"/${PN}-3.1.6-ar_so.patch
95 + "${FILESDIR}"/${PN}-3.2.0-grep38.patch
96 + "${FILESDIR}"/${PN}-3.2.0-makefile_automagic.patch
97 + "${FILESDIR}"/${PN}-3.2.0-relative_rpath.patch
98 +)
99 +
100 +pkg_pretend() {
101 + [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
102 +}
103 +
104 +pkg_setup() {
105 + [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
106 +}
107 +
108 +gmic_emake() {
109 + local mymakeargs=(
110 + CC="$(tc-getCC)"
111 + CXX="$(tc-getCXX)"
112 + STRIP="/bin/true"
113 + LIB="$(get_libdir)"
114 + OPT_CFLAGS="${CXXFLAGS}"
115 + OPT_LIBS="${LDFLAGS}"
116 + GMIC_USE_CURL=$(usex curl)
117 + GMIC_USE_EXR=$(usex openexr)
118 + GMIC_USE_FFTW=$(usex fftw)
119 + GMIC_USE_GRAPHICSMAGICK=$(usex graphicsmagick)
120 + GMIC_USE_JPEG=$(usex jpeg)
121 + GMIC_USE_OPENCV=$(usex opencv)
122 + GMIC_USE_OPENMP=$(usex openmp)
123 + GMIC_USE_PNG=$(usex png)
124 + GMIC_USE_TIFF=$(usex tiff)
125 + GMIC_USE_X11=$(usex X)
126 + QMAKE="qmake5"
127 + )
128 +
129 + # Possibly unnecessary since 3.2.0, just in case though.
130 + tc-is-clang && mymakeargs+=( OPENMP_LIBS="-lomp" )
131 +
132 + emake -j1 -C src \
133 + "${mymakeargs[@]}" \
134 + $@
135 +}
136 +
137 +src_compile() {
138 + gmic_emake lib libc
139 + use cli && gmic_emake cli_shared
140 + use gimp && gmic_emake gimp_shared
141 + use qt5 && gmic_emake gmic_qt_shared
142 +}
143 +
144 +src_install() {
145 + # See below for why this has to name a directory even if USE=-gimp
146 + local gimp_plugindir="/deleteme"
147 + if use gimp; then
148 + if type gimptool &>/dev/null; then
149 + gimp_plugindir="$(gimptool --gimpplugindir)/plug-ins"
150 + elif type gimptool-2.0 &>/dev/null; then
151 + gimp_plugindir="$(gimptool-2.0 --gimpplugindir)/plug-ins"
152 + elif type gimptool-2.99 &>/dev/null; then
153 + gimp_plugindir="$(gimptool-2.99 --gimpplugindir)/plug-ins"
154 + else
155 + die "Cannot find GIMP plugin directory"
156 + fi
157 + fi
158 +
159 + gmic_emake DESTDIR="${ED}" PLUGINDIR="${gimp_plugindir}" install
160 +
161 + # Upstream build scripts create PLUGINDIR and write some files to it
162 + # regardless of whether the GIMP plug-in has been built or not, or even
163 + # when they haven't been able to execute gimptool to get the base path.
164 + use gimp || rm -rf "${ED}/${gimp_plugindir}"
165 +
166 + # These are already gzipped in the source tarballs
167 + find "${ED}/usr/share/man" -name "*.gz" -exec gunzip {} \; || die
168 +}