1 |
commit: 0891d0860e7649d2422d93f9bd05a39522065aa0 |
2 |
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Jan 6 18:36:29 2019 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jan 6 19:50:21 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0891d086 |
7 |
|
8 |
media-gfx/imagemagick: bump to v6.9.10-23 & v7.0.8-23 |
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 |
media-gfx/imagemagick/imagemagick-6.9.10.23.ebuild | 248 ++++++++++++++++++++ |
15 |
media-gfx/imagemagick/imagemagick-7.0.8.23.ebuild | 256 +++++++++++++++++++++ |
16 |
3 files changed, 506 insertions(+) |
17 |
|
18 |
diff --git a/media-gfx/imagemagick/Manifest b/media-gfx/imagemagick/Manifest |
19 |
index 44b20176a32..5df1b49891b 100644 |
20 |
--- a/media-gfx/imagemagick/Manifest |
21 |
+++ b/media-gfx/imagemagick/Manifest |
22 |
@@ -1,6 +1,8 @@ |
23 |
DIST ImageMagick-6.9.10-16.tar.xz 8929036 BLAKE2B 1eb3150c5725d96bb2a9f9f7c07b5037e3da7e8f3871a9ae448352a967e5d8f5ccffdb7c27b608e4d6d9c8c13f7e8a219760292b6b191d37378c17ff182a2d09 SHA512 0adc57158260797df6db68256e87848135b52eba91dc65978e255061e3b22bfe7b3fbee3626ee8fb0183d37649143f0a46cbcbd6e090604cc4bb8e0752255fbd |
24 |
DIST ImageMagick-6.9.10-19.tar.xz 8934480 BLAKE2B d456acd5c40e7149839f7fea93826ce67c8a34b45b2435e2e6e35cdf3487163e47eddc9e81d251ba75d7c7125b5cb67ca58a945f380cc2bda90d9e6b4a6271eb SHA512 17cad58549b7e195693ce8f7c4dc936136792be10a15f47af66b60c3db2c4580b56d413d3034dd597d6e9c36f01d6b9b277bfd7c3b0828792e03ff5e8803dd40 |
25 |
DIST ImageMagick-6.9.10-21.tar.xz 8936048 BLAKE2B 28e522ff0a107526ff46149df8bbf7dfd93f1adacd714eacf43925b24375db005176255f5fccdad4b709d2133301a670abbfb46c93dfabcd1ec28d58074e7817 SHA512 6e3849eaab1cf9abd8ccbff32b6ece27e3bc6f9a5707737b0f9676adbed5d1ddbb352e94b8d25d66d9cccc6689f9b17731d053305310084a3a15fe13fb973e25 |
26 |
+DIST ImageMagick-6.9.10-23.tar.xz 8941044 BLAKE2B 7fd7dc8dcff32d87eb02b6590600813e8c7359b3e8e36fdf4eae9abdaf39941c1f5b4fef398cbf271777c630f7f4d1b149a1685ce34af3607c839facde89cc09 SHA512 b46405916b6beb7048fd0a82426bd890d56584f910092753dd788124006687167321757b3c9a469bcfba7d38e7162ddcd977918f605e6e87c28895eadecc0063 |
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 |
+DIST ImageMagick-7.0.8-23.tar.xz 8636148 BLAKE2B 6db61c1fa8481fe27311211371f626e8f0fbb544cb5bddb51dc62e0ca70aa72faa942a43cea173a1a86980d2798baee50130982bf67ba9b6cf2892935b36d66c SHA512 8063903d9992d89db302f9f95acdf112d3d38609289af5fcef66acf7f684b3223fea64829a0f6dd15f71f6b6b52f74d3c716c2217ffd83558c5b8a4b7a4aec3f |
31 |
|
32 |
diff --git a/media-gfx/imagemagick/imagemagick-6.9.10.23.ebuild b/media-gfx/imagemagick/imagemagick-6.9.10.23.ebuild |
33 |
new file mode 100644 |
34 |
index 00000000000..b09291336cc |
35 |
--- /dev/null |
36 |
+++ b/media-gfx/imagemagick/imagemagick-6.9.10.23.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.23.ebuild b/media-gfx/imagemagick/imagemagick-7.0.8.23.ebuild |
288 |
new file mode 100644 |
289 |
index 00000000000..69c412db11b |
290 |
--- /dev/null |
291 |
+++ b/media-gfx/imagemagick/imagemagick-7.0.8.23.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 |
+} |