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