1 |
commit: e8e2327b6bc6ed9eaaf396293eed3519daf2e640 |
2 |
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jun 25 11:18:39 2021 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jun 25 11:18:39 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e8e2327b |
7 |
|
8 |
media-gfx/imagemagick: bump to v6.9.12-16 & v7.1.0-1 |
9 |
|
10 |
Package-Manager: Portage-3.0.21, Repoman-3.0.3 |
11 |
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org> |
12 |
|
13 |
media-gfx/imagemagick/Manifest | 2 + |
14 |
media-gfx/imagemagick/imagemagick-6.9.12.16.ebuild | 262 ++++++++++++++++++++ |
15 |
media-gfx/imagemagick/imagemagick-7.1.0.1.ebuild | 269 +++++++++++++++++++++ |
16 |
3 files changed, 533 insertions(+) |
17 |
|
18 |
diff --git a/media-gfx/imagemagick/Manifest b/media-gfx/imagemagick/Manifest |
19 |
index 183b3d22195..914c11ef587 100644 |
20 |
--- a/media-gfx/imagemagick/Manifest |
21 |
+++ b/media-gfx/imagemagick/Manifest |
22 |
@@ -1,6 +1,8 @@ |
23 |
DIST ImageMagick-6.9.12-12.tar.xz 9141288 BLAKE2B 95ec30e77fc3f963bb0cae5280ad8e72ba9b6e0c8419fdf41f1899371ecbf5f64bbb70cc6193e751da0c3365551bdb2442e9f4746284ecff92ca351fc906fa4c SHA512 7e680809954326d32439c922cbcb65c9076823c50bd56ba2a230ec4a6d46f00a03a032d2ff153fe9b7651a9f6bac9625fe2aea7acccba56e15b6dce96e477c8d |
24 |
DIST ImageMagick-6.9.12-13.tar.xz 9172456 BLAKE2B cc931e49f152945a0022f6e57e49db08dc45169d5913b884cdf47d18d1f3d7a453f02b3ade56395e985cbe3f996584b8ad1686d947b6b4c04cc85475ca4f65c4 SHA512 4273e6cc864e759c55b5612475c268095948bb0ebabc1188637df87ac8595a97ce94ef7307687f0abd1325646ba23a8bf1219081655307b17ec96b335a01de6c |
25 |
DIST ImageMagick-6.9.12-15.tar.xz 9181060 BLAKE2B 099482e71ce899a95e22dd63ae4e3f0a36ed722f318a22796e5b28552d9c3770f33fef9d3dbeebbdcf91e78ac30421e7e48f9a3db7fdf73bfbdbafea4894ddc5 SHA512 7336b832abf96fed5d0f861b9c3724c27770a4f9fa868399406bb49003184a06a5fc51a96d3c66fa8d1ca85bcdfaa9ed59d9e80c751ae4c660f38f4d50a931ef |
26 |
+DIST ImageMagick-6.9.12-16.tar.xz 9186096 BLAKE2B ce6db7e7d47f983be14f6a99dd7742fc249980bc3c872c613bf3e18b53c33060b767fd540498f76ec69252ddcf326cd95210185ef49c57d18e10d84f30d763dc SHA512 9248a916a4f930b797afc40600561555df362fdb80fab33d07bf0bca2444309eeb8d5fb564f442d3f3171557a91f33a9c0d9c7ebd30103c304ef579f36795d34 |
27 |
DIST ImageMagick-7.0.11-12.tar.xz 10284100 BLAKE2B 2b664106152f764948f34fe766552cb48e7ff2a5c83f3f8b7e0a83861ed218bbda278f487678704d42aee900f1ef4be4252d94ccafda2192f39d9a3701115520 SHA512 f5faf124a1923d8b3d362ae59c594dff4d92cf097b42995f6631812bbb320830cee71ca10a15b3894cecf1a286b4fa10e874d213c7438356d194d3ebff778cbe |
28 |
DIST ImageMagick-7.0.11-13.tar.xz 10305476 BLAKE2B 464ea44f8e31148bdcbdf2e66410e5eb9fe0526d06b2b1376311018f7e4897648601d5f4d541469e9f8a72ecbc279695f23288e90725e564a917f68df92f8aed SHA512 8b5fe1ad06ca3af752454f67f53a066842668832bbd4efede35c515449cd2b970e6f7f23e716928ba598f89a7ec020bd988cc392196c89117586fb97a48e1d9e |
29 |
DIST ImageMagick-7.1.0-0.tar.xz 10307628 BLAKE2B cd59142d40fffa583e19b5bb3016ad84afd1901c3dc679798341f764ff2b341f85a5049907c560eeb58866ccb21985910a99ea92a5ca734d60e5af35fbbe8378 SHA512 51a52ee2c09bb8ea276445393cc2f3398a54c10047d58eaea29a1a1d231ddae0fc00d81b930f299661fed0a3940c08e8c9f0b3932ffd46128186348ebb89fb00 |
30 |
+DIST ImageMagick-7.1.0-1.tar.xz 10313392 BLAKE2B f451101f524d3b43de300bb7a54779c698a97bf8afece444849d491ef78e7b69cd68d97908243cda99adf8041013f449f84dc6c5c9a13c48a4e2baca8f62a70e SHA512 42eb8aee1f62782cff9e0e6e7ac1ef1dfb27ed03c803cf53a5d2a5c794110efc475ae886e8879e05219d067971d2359b4a183ad5802e8bc1f41a42fcd21bf19e |
31 |
|
32 |
diff --git a/media-gfx/imagemagick/imagemagick-6.9.12.16.ebuild b/media-gfx/imagemagick/imagemagick-6.9.12.16.ebuild |
33 |
new file mode 100644 |
34 |
index 00000000000..d17773f5081 |
35 |
--- /dev/null |
36 |
+++ b/media-gfx/imagemagick/imagemagick-6.9.12.16.ebuild |
37 |
@@ -0,0 +1,262 @@ |
38 |
+# Copyright 1999-2021 Gentoo Authors |
39 |
+# Distributed under the terms of the GNU General Public License v2 |
40 |
+ |
41 |
+EAPI="7" |
42 |
+ |
43 |
+inherit flag-o-matic libtool perl-functions toolchain-funcs multilib |
44 |
+ |
45 |
+if [[ ${PV} == "9999" ]] ; then |
46 |
+ EGIT_REPO_URI="https://github.com/ImageMagick/ImageMagick6.git" |
47 |
+ inherit git-r3 |
48 |
+ MY_P="imagemagick-9999" |
49 |
+else |
50 |
+ MY_PV="$(ver_rs 3 '-')" |
51 |
+ MY_P="ImageMagick-${MY_PV}" |
52 |
+ SRC_URI="mirror://imagemagick/${MY_P}.tar.xz" |
53 |
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~x64-solaris ~x86-solaris" |
54 |
+fi |
55 |
+ |
56 |
+DESCRIPTION="A collection of tools and libraries for many image formats" |
57 |
+HOMEPAGE="https://www.imagemagick.org/" |
58 |
+ |
59 |
+LICENSE="imagemagick" |
60 |
+SLOT="0/6.9.11-60" |
61 |
+IUSE="bzip2 corefonts +cxx djvu fftw fontconfig fpx graphviz hdri heif jbig jpeg jpeg2k lcms lqr lzma opencl openexr openmp pango perl +png postscript q32 q8 raw static-libs svg test tiff truetype webp wmf X xml zlib" |
62 |
+ |
63 |
+REQUIRED_USE="corefonts? ( truetype ) |
64 |
+ svg? ( xml ) |
65 |
+ test? ( corefonts )" |
66 |
+ |
67 |
+RESTRICT="!test? ( test )" |
68 |
+ |
69 |
+BDEPEND="virtual/pkgconfig" |
70 |
+ |
71 |
+RDEPEND=" |
72 |
+ dev-libs/libltdl:0 |
73 |
+ bzip2? ( app-arch/bzip2 ) |
74 |
+ corefonts? ( media-fonts/corefonts ) |
75 |
+ djvu? ( app-text/djvu ) |
76 |
+ fftw? ( sci-libs/fftw:3.0 ) |
77 |
+ fontconfig? ( media-libs/fontconfig ) |
78 |
+ fpx? ( >=media-libs/libfpx-1.3.0-r1 ) |
79 |
+ graphviz? ( media-gfx/graphviz ) |
80 |
+ heif? ( media-libs/libheif:= ) |
81 |
+ jbig? ( >=media-libs/jbigkit-2:= ) |
82 |
+ jpeg? ( virtual/jpeg:0 ) |
83 |
+ jpeg2k? ( >=media-libs/openjpeg-2.1.0:2 ) |
84 |
+ lcms? ( media-libs/lcms:2= ) |
85 |
+ lqr? ( media-libs/liblqr ) |
86 |
+ opencl? ( virtual/opencl ) |
87 |
+ openexr? ( media-libs/openexr:0= ) |
88 |
+ pango? ( x11-libs/pango ) |
89 |
+ perl? ( >=dev-lang/perl-5.8.8:0= ) |
90 |
+ png? ( media-libs/libpng:0= ) |
91 |
+ postscript? ( app-text/ghostscript-gpl ) |
92 |
+ raw? ( media-libs/libraw:= ) |
93 |
+ svg? ( |
94 |
+ gnome-base/librsvg |
95 |
+ media-gfx/potrace |
96 |
+ ) |
97 |
+ tiff? ( media-libs/tiff:0= ) |
98 |
+ truetype? ( |
99 |
+ media-fonts/urw-fonts |
100 |
+ >=media-libs/freetype-2 |
101 |
+ ) |
102 |
+ webp? ( media-libs/libwebp:0= ) |
103 |
+ wmf? ( media-libs/libwmf ) |
104 |
+ X? ( |
105 |
+ x11-libs/libICE |
106 |
+ x11-libs/libSM |
107 |
+ x11-libs/libXext |
108 |
+ x11-libs/libXt |
109 |
+ ) |
110 |
+ xml? ( dev-libs/libxml2:= ) |
111 |
+ lzma? ( app-arch/xz-utils ) |
112 |
+ zlib? ( sys-libs/zlib:= )" |
113 |
+ |
114 |
+DEPEND="${RDEPEND} |
115 |
+ !media-gfx/graphicsmagick[imagemagick] |
116 |
+ X? ( x11-base/xorg-proto )" |
117 |
+ |
118 |
+S="${WORKDIR}/${MY_P}" |
119 |
+ |
120 |
+src_prepare() { |
121 |
+ default |
122 |
+ |
123 |
+ # Apply hardening #664236 |
124 |
+ cp "${FILESDIR}"/policy-hardening.snippet "${S}" || die |
125 |
+ sed -i -e '/^<policymap>$/ { |
126 |
+ r policy-hardening.snippet |
127 |
+ d |
128 |
+ }' \ |
129 |
+ config/policy.xml || \ |
130 |
+ die "Failed to apply hardening of policy.xml" |
131 |
+ einfo "policy.xml hardened" |
132 |
+ |
133 |
+ elibtoolize # for Darwin modules |
134 |
+ |
135 |
+ # For testsuite, see https://bugs.gentoo.org/show_bug.cgi?id=500580#c3 |
136 |
+ local ati_cards mesa_cards nvidia_cards render_cards |
137 |
+ shopt -s nullglob |
138 |
+ ati_cards=$(echo -n /dev/ati/card* | sed 's/ /:/g') |
139 |
+ if test -n "${ati_cards}"; then |
140 |
+ addpredict "${ati_cards}" |
141 |
+ fi |
142 |
+ mesa_cards=$(echo -n /dev/dri/card* | sed 's/ /:/g') |
143 |
+ if test -n "${mesa_cards}"; then |
144 |
+ addpredict "${mesa_cards}" |
145 |
+ fi |
146 |
+ nvidia_cards=$(echo -n /dev/nvidia* | sed 's/ /:/g') |
147 |
+ if test -n "${nvidia_cards}"; then |
148 |
+ addpredict "${nvidia_cards}" |
149 |
+ fi |
150 |
+ render_cards=$(echo -n /dev/dri/renderD128* | sed 's/ /:/g') |
151 |
+ if test -n "${render_cards}"; then |
152 |
+ addpredict "${render_cards}" |
153 |
+ fi |
154 |
+ shopt -u nullglob |
155 |
+ addpredict /dev/nvidiactl |
156 |
+} |
157 |
+ |
158 |
+src_configure() { |
159 |
+ local depth=16 |
160 |
+ use q8 && depth=8 |
161 |
+ use q32 && depth=32 |
162 |
+ |
163 |
+ local openmp=disable |
164 |
+ use openmp && { tc-has-openmp && openmp=enable; } |
165 |
+ |
166 |
+ use perl && perl_check_env |
167 |
+ |
168 |
+ [[ ${CHOST} == *-solaris* ]] && append-ldflags -lnsl -lsocket |
169 |
+ |
170 |
+ local myeconfargs=( |
171 |
+ $(use_enable static-libs static) |
172 |
+ $(use_enable hdri) |
173 |
+ $(use_enable opencl) |
174 |
+ --with-threads |
175 |
+ --with-modules |
176 |
+ --with-quantum-depth=${depth} |
177 |
+ $(use_with cxx magick-plus-plus) |
178 |
+ $(use_with perl) |
179 |
+ --with-perl-options='INSTALLDIRS=vendor' |
180 |
+ --with-gs-font-dir="${EPREFIX}"/usr/share/fonts/urw-fonts |
181 |
+ $(use_with bzip2 bzlib) |
182 |
+ $(use_with X x) |
183 |
+ $(use_with zlib) |
184 |
+ --without-autotrace |
185 |
+ $(use_with postscript dps) |
186 |
+ $(use_with djvu) |
187 |
+ --with-dejavu-font-dir="${EPREFIX}"/usr/share/fonts/dejavu |
188 |
+ $(use_with fftw) |
189 |
+ $(use_with fpx) |
190 |
+ $(use_with fontconfig) |
191 |
+ $(use_with truetype freetype) |
192 |
+ $(use_with postscript gslib) |
193 |
+ $(use_with graphviz gvc) |
194 |
+ $(use_with heif heic) |
195 |
+ $(use_with jbig) |
196 |
+ $(use_with jpeg) |
197 |
+ $(use_with jpeg2k openjp2) |
198 |
+ $(use_with lcms) |
199 |
+ $(use_with lqr) |
200 |
+ $(use_with lzma) |
201 |
+ $(use_with openexr) |
202 |
+ $(use_with pango) |
203 |
+ $(use_with png) |
204 |
+ $(use_with raw) |
205 |
+ $(use_with svg rsvg) |
206 |
+ $(use_with tiff) |
207 |
+ $(use_with webp) |
208 |
+ $(use_with corefonts windows-font-dir "${EPREFIX}"/usr/share/fonts/corefonts) |
209 |
+ $(use_with wmf) |
210 |
+ $(use_with xml) |
211 |
+ --${openmp}-openmp |
212 |
+ --with-gcc-arch=no-automagic |
213 |
+ ) |
214 |
+ CONFIG_SHELL=$(type -P bash) econf "${myeconfargs[@]}" |
215 |
+} |
216 |
+ |
217 |
+src_test() { |
218 |
+ # Install default (unrestricted) policy in $HOME for test suite #664238 |
219 |
+ local _im_local_config_home="${HOME}/.config/ImageMagick" |
220 |
+ mkdir -p "${_im_local_config_home}" || \ |
221 |
+ die "Failed to create IM config dir in '${_im_local_config_home}'" |
222 |
+ cp "${FILESDIR}"/policy.test.xml "${_im_local_config_home}/policy.xml" || \ |
223 |
+ die "Failed to install default blank policy.xml in '${_im_local_config_home}'" |
224 |
+ |
225 |
+ local im_command= IM_COMMANDS=() |
226 |
+ IM_COMMANDS+=( "identify -version | grep -q -- \"${MY_PV}\"" ) # Verify that we are using version we just built |
227 |
+ IM_COMMANDS+=( "identify -list policy" ) # Verify that policy.xml is used |
228 |
+ IM_COMMANDS+=( "emake check" ) # Run tests |
229 |
+ |
230 |
+ for im_command in "${IM_COMMANDS[@]}"; do |
231 |
+ eval "${S}"/magick.sh \ |
232 |
+ ${im_command} || \ |
233 |
+ die "Failed to run \"${im_command}\"" |
234 |
+ done |
235 |
+} |
236 |
+ |
237 |
+src_install() { |
238 |
+ # Ensure documentation installation files and paths with each release! |
239 |
+ emake \ |
240 |
+ DESTDIR="${D}" \ |
241 |
+ DOCUMENTATION_PATH="${EPREFIX}"/usr/share/doc/${PF}/html \ |
242 |
+ install |
243 |
+ |
244 |
+ rm -f "${ED}"/usr/share/doc/${PF}/html/{ChangeLog,LICENSE,NEWS.txt} |
245 |
+ dodoc {AUTHORS,README}.txt ChangeLog |
246 |
+ |
247 |
+ if use perl; then |
248 |
+ find "${ED}" -type f -name perllocal.pod -exec rm -f {} + |
249 |
+ find "${ED}" -depth -mindepth 1 -type d -empty -exec rm -rf {} + |
250 |
+ fi |
251 |
+ |
252 |
+ find "${ED}" -name '*.la' -exec sed -i -e "/^dependency_libs/s:=.*:='':" {} + |
253 |
+ # .la files in parent are not needed, keep plugin .la files |
254 |
+ find "${ED}"/usr/$(get_libdir)/ -maxdepth 1 -name "*.la" -delete || die |
255 |
+ |
256 |
+ if use opencl; then |
257 |
+ cat <<-EOF > "${T}"/99${PN} |
258 |
+ SANDBOX_PREDICT="/dev/nvidiactl:/dev/nvidia-uvm:/dev/ati/card:/dev/dri/card:/dev/dri/card0:/dev/dri/renderD128" |
259 |
+ EOF |
260 |
+ |
261 |
+ insinto /etc/sandbox.d |
262 |
+ doins "${T}"/99${PN} #472766 |
263 |
+ fi |
264 |
+ |
265 |
+ insinto /usr/share/${PN} |
266 |
+ doins config/*icm |
267 |
+} |
268 |
+ |
269 |
+pkg_postinst() { |
270 |
+ local _show_policy_xml_notice= |
271 |
+ |
272 |
+ if [[ -z "${REPLACING_VERSIONS}" ]]; then |
273 |
+ # This is a new installation |
274 |
+ _show_policy_xml_notice=yes |
275 |
+ else |
276 |
+ local v |
277 |
+ for v in ${REPLACING_VERSIONS}; do |
278 |
+ if ! ver_test "${v}" -gt "6.9.10.10-r2"; then |
279 |
+ # This is an upgrade |
280 |
+ _show_policy_xml_notice=yes |
281 |
+ |
282 |
+ # Show this elog only once |
283 |
+ break |
284 |
+ fi |
285 |
+ done |
286 |
+ fi |
287 |
+ |
288 |
+ if [[ -n "${_show_policy_xml_notice}" ]]; then |
289 |
+ elog "For security reasons, a policy.xml file was installed in /etc/ImageMagick-6" |
290 |
+ elog "which will prevent the usage of the following coders by default:" |
291 |
+ elog "" |
292 |
+ elog " - PS" |
293 |
+ elog " - PS2" |
294 |
+ elog " - PS3" |
295 |
+ elog " - EPS" |
296 |
+ elog " - PDF" |
297 |
+ elog " - XPS" |
298 |
+ fi |
299 |
+} |
300 |
|
301 |
diff --git a/media-gfx/imagemagick/imagemagick-7.1.0.1.ebuild b/media-gfx/imagemagick/imagemagick-7.1.0.1.ebuild |
302 |
new file mode 100644 |
303 |
index 00000000000..42e59445111 |
304 |
--- /dev/null |
305 |
+++ b/media-gfx/imagemagick/imagemagick-7.1.0.1.ebuild |
306 |
@@ -0,0 +1,269 @@ |
307 |
+# Copyright 1999-2021 Gentoo Authors |
308 |
+# Distributed under the terms of the GNU General Public License v2 |
309 |
+ |
310 |
+EAPI="7" |
311 |
+ |
312 |
+inherit flag-o-matic libtool perl-functions toolchain-funcs multilib |
313 |
+ |
314 |
+if [[ ${PV} == "9999" ]] ; then |
315 |
+ EGIT_REPO_URI="https://github.com/ImageMagick/ImageMagick.git" |
316 |
+ inherit git-r3 |
317 |
+ MY_P="imagemagick-9999" |
318 |
+else |
319 |
+ MY_PV="$(ver_rs 3 '-')" |
320 |
+ MY_P="ImageMagick-${MY_PV}" |
321 |
+ SRC_URI="mirror://imagemagick/${MY_P}.tar.xz" |
322 |
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~x64-solaris ~x86-solaris" |
323 |
+fi |
324 |
+ |
325 |
+DESCRIPTION="A collection of tools and libraries for many image formats" |
326 |
+HOMEPAGE="https://www.imagemagick.org/" |
327 |
+ |
328 |
+LICENSE="imagemagick" |
329 |
+SLOT="0/7.1.0-0" |
330 |
+IUSE="bzip2 corefonts +cxx djvu fftw fontconfig fpx graphviz hdri heif jbig jpeg jpeg2k lcms lqr lzma opencl openexr openmp pango perl +png postscript q32 q8 raw static-libs svg test tiff truetype webp wmf X xml zip zlib" |
331 |
+ |
332 |
+REQUIRED_USE="corefonts? ( truetype ) |
333 |
+ svg? ( xml ) |
334 |
+ test? ( corefonts )" |
335 |
+ |
336 |
+RESTRICT="!test? ( test )" |
337 |
+ |
338 |
+BDEPEND="virtual/pkgconfig" |
339 |
+ |
340 |
+RDEPEND=" |
341 |
+ dev-libs/libltdl:0 |
342 |
+ bzip2? ( app-arch/bzip2 ) |
343 |
+ corefonts? ( media-fonts/corefonts ) |
344 |
+ djvu? ( app-text/djvu ) |
345 |
+ fftw? ( sci-libs/fftw:3.0 ) |
346 |
+ fontconfig? ( media-libs/fontconfig ) |
347 |
+ fpx? ( >=media-libs/libfpx-1.3.0-r1 ) |
348 |
+ graphviz? ( media-gfx/graphviz ) |
349 |
+ heif? ( media-libs/libheif:= ) |
350 |
+ jbig? ( >=media-libs/jbigkit-2:= ) |
351 |
+ jpeg? ( virtual/jpeg:0 ) |
352 |
+ jpeg2k? ( >=media-libs/openjpeg-2.1.0:2 ) |
353 |
+ lcms? ( media-libs/lcms:2= ) |
354 |
+ lqr? ( media-libs/liblqr ) |
355 |
+ opencl? ( virtual/opencl ) |
356 |
+ openexr? ( media-libs/openexr:0= ) |
357 |
+ pango? ( x11-libs/pango ) |
358 |
+ perl? ( >=dev-lang/perl-5.8.8:0= ) |
359 |
+ png? ( media-libs/libpng:0= ) |
360 |
+ postscript? ( app-text/ghostscript-gpl ) |
361 |
+ raw? ( media-libs/libraw:= ) |
362 |
+ svg? ( |
363 |
+ gnome-base/librsvg |
364 |
+ media-gfx/potrace |
365 |
+ ) |
366 |
+ tiff? ( media-libs/tiff:0= ) |
367 |
+ truetype? ( |
368 |
+ media-fonts/urw-fonts |
369 |
+ >=media-libs/freetype-2 |
370 |
+ ) |
371 |
+ webp? ( media-libs/libwebp:0= ) |
372 |
+ wmf? ( media-libs/libwmf ) |
373 |
+ X? ( |
374 |
+ x11-libs/libICE |
375 |
+ x11-libs/libSM |
376 |
+ x11-libs/libXext |
377 |
+ x11-libs/libXt |
378 |
+ ) |
379 |
+ xml? ( dev-libs/libxml2:= ) |
380 |
+ lzma? ( app-arch/xz-utils ) |
381 |
+ zip? ( dev-libs/libzip:= ) |
382 |
+ zlib? ( sys-libs/zlib:= )" |
383 |
+ |
384 |
+DEPEND="${RDEPEND} |
385 |
+ !media-gfx/graphicsmagick[imagemagick] |
386 |
+ X? ( x11-base/xorg-proto )" |
387 |
+ |
388 |
+S="${WORKDIR}/${MY_P}" |
389 |
+ |
390 |
+src_prepare() { |
391 |
+ default |
392 |
+ |
393 |
+ # Apply hardening #664236 |
394 |
+ cp "${FILESDIR}"/policy-hardening.snippet "${S}" || die |
395 |
+ sed -i -e '/^<policymap>$/ { |
396 |
+ r policy-hardening.snippet |
397 |
+ d |
398 |
+ }' \ |
399 |
+ config/policy.xml || \ |
400 |
+ die "Failed to apply hardening of policy.xml" |
401 |
+ einfo "policy.xml hardened" |
402 |
+ |
403 |
+ elibtoolize # for Darwin modules |
404 |
+ |
405 |
+ # For testsuite, see https://bugs.gentoo.org/show_bug.cgi?id=500580#c3 |
406 |
+ local ati_cards mesa_cards nvidia_cards render_cards |
407 |
+ shopt -s nullglob |
408 |
+ ati_cards=$(echo -n /dev/ati/card* | sed 's/ /:/g') |
409 |
+ if test -n "${ati_cards}"; then |
410 |
+ addpredict "${ati_cards}" |
411 |
+ fi |
412 |
+ mesa_cards=$(echo -n /dev/dri/card* | sed 's/ /:/g') |
413 |
+ if test -n "${mesa_cards}"; then |
414 |
+ addpredict "${mesa_cards}" |
415 |
+ fi |
416 |
+ nvidia_cards=$(echo -n /dev/nvidia* | sed 's/ /:/g') |
417 |
+ if test -n "${nvidia_cards}"; then |
418 |
+ addpredict "${nvidia_cards}" |
419 |
+ fi |
420 |
+ render_cards=$(echo -n /dev/dri/renderD128* | sed 's/ /:/g') |
421 |
+ if test -n "${render_cards}"; then |
422 |
+ addpredict "${render_cards}" |
423 |
+ fi |
424 |
+ shopt -u nullglob |
425 |
+ addpredict /dev/nvidiactl |
426 |
+} |
427 |
+ |
428 |
+src_configure() { |
429 |
+ local depth=16 |
430 |
+ use q8 && depth=8 |
431 |
+ use q32 && depth=32 |
432 |
+ |
433 |
+ local openmp=disable |
434 |
+ use openmp && { tc-has-openmp && openmp=enable; } |
435 |
+ |
436 |
+ use perl && perl_check_env |
437 |
+ |
438 |
+ [[ ${CHOST} == *-solaris* ]] && append-ldflags -lnsl -lsocket |
439 |
+ |
440 |
+ local myeconfargs=( |
441 |
+ $(use_enable static-libs static) |
442 |
+ $(use_enable hdri) |
443 |
+ $(use_enable opencl) |
444 |
+ --with-threads |
445 |
+ --with-modules |
446 |
+ --with-quantum-depth=${depth} |
447 |
+ $(use_with cxx magick-plus-plus) |
448 |
+ $(use_with perl) |
449 |
+ --with-perl-options='INSTALLDIRS=vendor' |
450 |
+ --with-gs-font-dir="${EPREFIX}"/usr/share/fonts/urw-fonts |
451 |
+ $(use_with bzip2 bzlib) |
452 |
+ $(use_with X x) |
453 |
+ $(use_with zip) |
454 |
+ $(use_with zlib) |
455 |
+ --without-autotrace |
456 |
+ $(use_with postscript dps) |
457 |
+ $(use_with djvu) |
458 |
+ --with-dejavu-font-dir="${EPREFIX}"/usr/share/fonts/dejavu |
459 |
+ $(use_with fftw) |
460 |
+ $(use_with fpx) |
461 |
+ $(use_with fontconfig) |
462 |
+ $(use_with truetype freetype) |
463 |
+ $(use_with postscript gslib) |
464 |
+ $(use_with graphviz gvc) |
465 |
+ $(use_with heif heic) |
466 |
+ $(use_with jbig) |
467 |
+ $(use_with jpeg) |
468 |
+ $(use_with jpeg2k openjp2) |
469 |
+ --without-jxl |
470 |
+ $(use_with lcms) |
471 |
+ $(use_with lqr) |
472 |
+ $(use_with lzma) |
473 |
+ $(use_with openexr) |
474 |
+ $(use_with pango) |
475 |
+ $(use_with png) |
476 |
+ $(use_with raw) |
477 |
+ $(use_with svg rsvg) |
478 |
+ $(use_with tiff) |
479 |
+ $(use_with webp) |
480 |
+ $(use_with corefonts windows-font-dir "${EPREFIX}"/usr/share/fonts/corefonts) |
481 |
+ $(use_with wmf) |
482 |
+ $(use_with xml) |
483 |
+ --${openmp}-openmp |
484 |
+ --with-gcc-arch=no-automagic |
485 |
+ ) |
486 |
+ CONFIG_SHELL=$(type -P bash) econf "${myeconfargs[@]}" |
487 |
+} |
488 |
+ |
489 |
+src_test() { |
490 |
+ # Install default (unrestricted) policy in $HOME for test suite #664238 |
491 |
+ local _im_local_config_home="${HOME}/.config/ImageMagick" |
492 |
+ mkdir -p "${_im_local_config_home}" || \ |
493 |
+ die "Failed to create IM config dir in '${_im_local_config_home}'" |
494 |
+ cp "${FILESDIR}"/policy.test.xml "${_im_local_config_home}/policy.xml" || \ |
495 |
+ die "Failed to install default blank policy.xml in '${_im_local_config_home}'" |
496 |
+ |
497 |
+ local im_command= IM_COMMANDS=() |
498 |
+ if [[ ${PV} == "9999" ]] ; then |
499 |
+ IM_COMMANDS+=( "magick -version" ) # Show version we are using -- cannot verify because of live ebuild |
500 |
+ else |
501 |
+ IM_COMMANDS+=( "magick -version | grep -q -- \"${MY_PV}\"" ) # Verify that we are using version we just built |
502 |
+ fi |
503 |
+ IM_COMMANDS+=( "magick -list policy" ) # Verify that policy.xml is used |
504 |
+ IM_COMMANDS+=( "emake check" ) # Run tests |
505 |
+ |
506 |
+ for im_command in "${IM_COMMANDS[@]}"; do |
507 |
+ eval "${S}"/magick.sh \ |
508 |
+ ${im_command} || \ |
509 |
+ die "Failed to run \"${im_command}\"" |
510 |
+ done |
511 |
+} |
512 |
+ |
513 |
+src_install() { |
514 |
+ # Ensure documentation installation files and paths with each release! |
515 |
+ emake \ |
516 |
+ DESTDIR="${D}" \ |
517 |
+ DOCUMENTATION_PATH="${EPREFIX}"/usr/share/doc/${PF}/html \ |
518 |
+ install |
519 |
+ |
520 |
+ rm -f "${ED}"/usr/share/doc/${PF}/html/{ChangeLog,LICENSE,NEWS.txt} |
521 |
+ dodoc {AUTHORS,README}.txt ChangeLog |
522 |
+ |
523 |
+ if use perl; then |
524 |
+ find "${ED}" -type f -name perllocal.pod -exec rm -f {} + |
525 |
+ find "${ED}" -depth -mindepth 1 -type d -empty -exec rm -rf {} + |
526 |
+ fi |
527 |
+ |
528 |
+ find "${ED}" -name '*.la' -exec sed -i -e "/^dependency_libs/s:=.*:='':" {} + |
529 |
+ # .la files in parent are not needed, keep plugin .la files |
530 |
+ find "${ED}"/usr/$(get_libdir)/ -maxdepth 1 -name "*.la" -delete || die |
531 |
+ |
532 |
+ if use opencl; then |
533 |
+ cat <<-EOF > "${T}"/99${PN} |
534 |
+ SANDBOX_PREDICT="/dev/nvidiactl:/dev/nvidia-uvm:/dev/ati/card:/dev/dri/card:/dev/dri/card0:/dev/dri/renderD128" |
535 |
+ EOF |
536 |
+ |
537 |
+ insinto /etc/sandbox.d |
538 |
+ doins "${T}"/99${PN} #472766 |
539 |
+ fi |
540 |
+ |
541 |
+ insinto /usr/share/${PN} |
542 |
+ doins config/*icm |
543 |
+} |
544 |
+ |
545 |
+pkg_postinst() { |
546 |
+ local _show_policy_xml_notice= |
547 |
+ |
548 |
+ if [[ -z "${REPLACING_VERSIONS}" ]]; then |
549 |
+ # This is a new installation |
550 |
+ _show_policy_xml_notice=yes |
551 |
+ else |
552 |
+ local v |
553 |
+ for v in ${REPLACING_VERSIONS}; do |
554 |
+ if ! ver_test "${v}" -gt "7.0.8.10-r2"; then |
555 |
+ # This is an upgrade |
556 |
+ _show_policy_xml_notice=yes |
557 |
+ |
558 |
+ # Show this elog only once |
559 |
+ break |
560 |
+ fi |
561 |
+ done |
562 |
+ fi |
563 |
+ |
564 |
+ if [[ -n "${_show_policy_xml_notice}" ]]; then |
565 |
+ elog "For security reasons, a policy.xml file was installed in /etc/ImageMagick-7" |
566 |
+ elog "which will prevent the usage of the following coders by default:" |
567 |
+ elog "" |
568 |
+ elog " - PS" |
569 |
+ elog " - PS2" |
570 |
+ elog " - PS3" |
571 |
+ elog " - EPS" |
572 |
+ elog " - PDF" |
573 |
+ elog " - XPS" |
574 |
+ fi |
575 |
+} |