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