1 |
commit: 7498dac31f5b75b943ee2fa6685479ad1e812806 |
2 |
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Nov 1 01:17:51 2021 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Nov 1 01:17:51 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7498dac3 |
7 |
|
8 |
media-gfx/imagemagick: bump to v6.9.12-28 & v7.1.0-13 |
9 |
|
10 |
Package-Manager: Portage-3.0.28, 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.28.ebuild | 262 ++++++++++++++++++++ |
15 |
media-gfx/imagemagick/imagemagick-7.1.0.13.ebuild | 269 +++++++++++++++++++++ |
16 |
3 files changed, 533 insertions(+) |
17 |
|
18 |
diff --git a/media-gfx/imagemagick/Manifest b/media-gfx/imagemagick/Manifest |
19 |
index d7ea5483e8e..646883d0488 100644 |
20 |
--- a/media-gfx/imagemagick/Manifest |
21 |
+++ b/media-gfx/imagemagick/Manifest |
22 |
@@ -1,6 +1,8 @@ |
23 |
DIST ImageMagick-6.9.12-20.tar.xz 9174816 BLAKE2B ccdb4775867224d08871b7147fa20e6b09305f6501a07de85ad53b862c47921c5b6b39eaf62fa86258c1a6fea1abe417817b4a4887a981a6f5a786636fa57946 SHA512 2ba849ef7212b0255f1db6509b718f7dd3825d16e45ea115a77ecf6b8afc41cb823ba0ddddc124aa0afe5605f1aa5e2865daa00da88568bf5874225de6620fe3 |
24 |
DIST ImageMagick-6.9.12-21.tar.xz 9173096 BLAKE2B 0d8e0a414f2026539be16873ada2d097ce11beb0becf1e132eb6f7d9e4a69063a46eef4834c55268f5af5abbb87e17bb79c5f1182291d144e5155e5f68393070 SHA512 1ec038d555f0e72b79f830602047019819e36ffeb9053317685ac13a84e83d8d694980ff7203139e222568adab812d7f7b113793031e87cafb94aa75737b0b5d |
25 |
DIST ImageMagick-6.9.12-25.tar.xz 9177972 BLAKE2B d115f6722bdb4122d022182849b7fb40f13320f82909e00675806621511356651f3e9c3f1189fde69276509c0e7916a5127e76b9294da591b8dd963bc8fceec3 SHA512 34b25bb9c46960ffd4258d7476d9111fb2334819dd7bb68e08749c6ac483e0403bd36f8da0ab5ea0fc5838a3cffbd9622649ab95272f9fb56a0092fe0257b8ff |
26 |
+DIST ImageMagick-6.9.12-28.tar.xz 9181044 BLAKE2B 2efc03da9e4c53b82479badfcc9a25f05e2d9766031807500a6bb39cba2a800c39a93a16864ca9af3a0b33d0c1c95cb2f33264c7e00149204ca742673c3d07ff SHA512 ec96fca6b385379873ead007b011d87fb3939ed4e3631d2a9401f1467db59d1d1ced072fd4fefe1577d04302a1060dbc324631b420f41a99bf32465b540ec979 |
27 |
DIST ImageMagick-7.1.0-10.tar.xz 10304648 BLAKE2B 8688c52387c185fd190e98d84d9c285191b9a827058c8e1200a7676399e43b8950a2f8f1cefc99dcfbf967ed3f803d67f2a8677a48932fa7c44ebe5c01ac6993 SHA512 72ef704460473af9c8fbd0d49cb264fc23eaaf24ce3e319916e7f23ad715d45f44f4ecebc02b9edba55a584b59c407f0a777fa9add2e49f7c69341bcac169c4b |
28 |
+DIST ImageMagick-7.1.0-13.tar.xz 10311564 BLAKE2B 7cb3e58f548cbe0b9e1239df47ff4f42af2cd0b6ff4c417a62515ff9bd434ecabed2cc7f7cb7cf8880f20af3f6d7de33d7368f146b9ac7668149959966a463d8 SHA512 dac1fc229599a63703fc3aa1378de313dc94dfbfa71913dc408ef65c88ef33820b5ddab4c9a064a86cc35c0abb0136f0adb626bff9e227b52ed0d90993688044 |
29 |
DIST ImageMagick-7.1.0-5.tar.xz 10308228 BLAKE2B c65f0bb04133a6390770cb06ed4a102fef58647b6d03c09ad840a0b0abf18a5875c244c5d8fb10492f5ccc62d976c170659ead93ad7b8a8178c88fe3778dfa20 SHA512 1fc66c57e4dbe01c2730508c42cd8a8e94be087751b3ad460318e1d4a7aa2c1af95d22b2f432037590af5e7f4a8e3cdeb276278423ed30d485267a907c7006d6 |
30 |
DIST ImageMagick-7.1.0-6.tar.xz 10316740 BLAKE2B a0b6591300d48b648004c9701d2cb21afbb652760230384b4711a8d741875ba28d31b0c1b468f93c33338278a01aeef94eed0dbe14a3670ae7207704bb0eda1a SHA512 951541ad24095a2ac03fa26bfb38363795d7e86f1cae90ede9ab5991b28090dd05cc6c5bec62a0c3d664fa5191021fa01b760cfa7ccd94c80d93f24484afa5d3 |
31 |
|
32 |
diff --git a/media-gfx/imagemagick/imagemagick-6.9.12.28.ebuild b/media-gfx/imagemagick/imagemagick-6.9.12.28.ebuild |
33 |
new file mode 100644 |
34 |
index 00000000000..2475294ebb2 |
35 |
--- /dev/null |
36 |
+++ b/media-gfx/imagemagick/imagemagick-6.9.12.28.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="8" |
42 |
+ |
43 |
+inherit flag-o-matic libtool perl-functions toolchain-funcs |
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:=[x265] ) |
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.13.ebuild b/media-gfx/imagemagick/imagemagick-7.1.0.13.ebuild |
302 |
new file mode 100644 |
303 |
index 00000000000..d47b238fb19 |
304 |
--- /dev/null |
305 |
+++ b/media-gfx/imagemagick/imagemagick-7.1.0.13.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="8" |
311 |
+ |
312 |
+inherit flag-o-matic libtool perl-functions toolchain-funcs |
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:=[x265] ) |
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 |
+} |