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