Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-gfx/imagemagick/
Date: Tue, 02 Jun 2020 08:16:23
Message-Id: 1591085771.e7dc825e4efa1d431354cf8e21f9be3722a8eeb4.mgorny@gentoo
1 commit: e7dc825e4efa1d431354cf8e21f9be3722a8eeb4
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jun 2 08:14:54 2020 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Tue Jun 2 08:16:11 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e7dc825e
7
8 media-gfx/imagemagick: Add missing inkscape dep
9
10 Bug: https://bugs.gentoo.org/684686
11 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
12
13 .../imagemagick/imagemagick-7.0.10.16-r1.ebuild | 268 +++++++++++++++++++++
14 1 file changed, 268 insertions(+)
15
16 diff --git a/media-gfx/imagemagick/imagemagick-7.0.10.16-r1.ebuild b/media-gfx/imagemagick/imagemagick-7.0.10.16-r1.ebuild
17 new file mode 100644
18 index 00000000000..06f1ec53f2b
19 --- /dev/null
20 +++ b/media-gfx/imagemagick/imagemagick-7.0.10.16-r1.ebuild
21 @@ -0,0 +1,268 @@
22 +# Copyright 1999-2020 Gentoo Authors
23 +# Distributed under the terms of the GNU General Public License v2
24 +
25 +EAPI="7"
26 +
27 +inherit flag-o-matic libtool perl-functions toolchain-funcs multilib
28 +
29 +if [[ ${PV} == "9999" ]] ; then
30 + EGIT_REPO_URI="https://github.com/ImageMagick/ImageMagick.git"
31 + inherit git-r3
32 + MY_P="imagemagick-9999"
33 +else
34 + MY_PV="$(ver_rs 3 '-')"
35 + MY_P="ImageMagick-${MY_PV}"
36 + SRC_URI="mirror://imagemagick/${MY_P}.tar.xz"
37 + KEYWORDS="~amd64 ~hppa ~ppc ~ppc64 ~x86"
38 +fi
39 +
40 +DESCRIPTION="A collection of tools and libraries for many image formats"
41 +HOMEPAGE="https://www.imagemagick.org/"
42 +
43 +LICENSE="imagemagick"
44 +SLOT="0/7.0.10"
45 +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"
46 +RESTRICT="!test? ( test )"
47 +
48 +REQUIRED_USE="corefonts? ( truetype )
49 + test? ( corefonts )"
50 +
51 +RESTRICT="!test? ( test )"
52 +
53 +BDEPEND="virtual/pkgconfig"
54 +
55 +RDEPEND="
56 + dev-libs/libltdl:0
57 + bzip2? ( app-arch/bzip2 )
58 + corefonts? ( media-fonts/corefonts )
59 + djvu? ( app-text/djvu )
60 + fftw? ( sci-libs/fftw:3.0 )
61 + fontconfig? ( media-libs/fontconfig )
62 + fpx? ( >=media-libs/libfpx-1.3.0-r1 )
63 + graphviz? ( media-gfx/graphviz )
64 + heif? ( media-libs/libheif:= )
65 + jbig? ( >=media-libs/jbigkit-2:= )
66 + jpeg? ( virtual/jpeg:0 )
67 + jpeg2k? ( >=media-libs/openjpeg-2.1.0:2 )
68 + lcms? ( media-libs/lcms:2= )
69 + lqr? ( media-libs/liblqr )
70 + opencl? ( virtual/opencl )
71 + openexr? ( media-libs/openexr:0= )
72 + pango? ( x11-libs/pango )
73 + perl? ( >=dev-lang/perl-5.8.8:0= )
74 + png? ( media-libs/libpng:0= )
75 + postscript? ( app-text/ghostscript-gpl )
76 + raw? ( media-libs/libraw:= )
77 + svg? (
78 + gnome-base/librsvg
79 + media-gfx/inkscape
80 + media-gfx/potrace
81 + )
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 +
99 +DEPEND="${RDEPEND}
100 + !media-gfx/graphicsmagick[imagemagick]
101 + X? ( x11-base/xorg-proto )"
102 +
103 +S="${WORKDIR}/${MY_P}"
104 +
105 +src_prepare() {
106 + default
107 +
108 + # Apply hardening #664236
109 + cp "${FILESDIR}"/policy-hardening.snippet "${S}" || die
110 + sed -i -e '/^<policymap>$/ {
111 + r policy-hardening.snippet
112 + d
113 + }' \
114 + config/policy.xml || \
115 + die "Failed to apply hardening of policy.xml"
116 + einfo "policy.xml hardened"
117 +
118 + elibtoolize # for Darwin modules
119 +
120 + # For testsuite, see https://bugs.gentoo.org/show_bug.cgi?id=500580#c3
121 + local ati_cards mesa_cards nvidia_cards render_cards
122 + shopt -s nullglob
123 + ati_cards=$(echo -n /dev/ati/card* | sed 's/ /:/g')
124 + if test -n "${ati_cards}"; then
125 + addpredict "${ati_cards}"
126 + fi
127 + mesa_cards=$(echo -n /dev/dri/card* | sed 's/ /:/g')
128 + if test -n "${mesa_cards}"; then
129 + addpredict "${mesa_cards}"
130 + fi
131 + nvidia_cards=$(echo -n /dev/nvidia* | sed 's/ /:/g')
132 + if test -n "${nvidia_cards}"; then
133 + addpredict "${nvidia_cards}"
134 + fi
135 + render_cards=$(echo -n /dev/dri/renderD128* | sed 's/ /:/g')
136 + if test -n "${render_cards}"; then
137 + addpredict "${render_cards}"
138 + fi
139 + shopt -u nullglob
140 + addpredict /dev/nvidiactl
141 +}
142 +
143 +src_configure() {
144 + local depth=16
145 + use q8 && depth=8
146 + use q32 && depth=32
147 +
148 + local openmp=disable
149 + use openmp && { tc-has-openmp && openmp=enable; }
150 +
151 + use perl && perl_check_env
152 +
153 + [[ ${CHOST} == *-solaris* ]] && append-ldflags -lnsl -lsocket
154 +
155 + local myeconfargs=(
156 + $(use_enable static-libs static)
157 + $(use_enable hdri)
158 + $(use_enable opencl)
159 + --with-threads
160 + --with-modules
161 + --with-quantum-depth=${depth}
162 + $(use_with cxx magick-plus-plus)
163 + $(use_with perl)
164 + --with-perl-options='INSTALLDIRS=vendor'
165 + --with-gs-font-dir="${EPREFIX}"/usr/share/fonts/urw-fonts
166 + $(use_with bzip2 bzlib)
167 + $(use_with X x)
168 + $(use_with zlib)
169 + --without-autotrace
170 + $(use_with postscript dps)
171 + $(use_with djvu)
172 + --with-dejavu-font-dir="${EPREFIX}"/usr/share/fonts/dejavu
173 + $(use_with fftw)
174 + $(use_with fpx)
175 + $(use_with fontconfig)
176 + $(use_with truetype freetype)
177 + $(use_with postscript gslib)
178 + $(use_with graphviz gvc)
179 + $(use_with heif heic)
180 + $(use_with jbig)
181 + $(use_with jpeg)
182 + $(use_with jpeg2k openjp2)
183 + --without-jxl
184 + $(use_with lcms)
185 + $(use_with lqr)
186 + $(use_with lzma)
187 + $(use_with openexr)
188 + $(use_with pango)
189 + $(use_with png)
190 + $(use_with raw)
191 + $(use_with svg rsvg)
192 + $(use_with tiff)
193 + $(use_with webp)
194 + $(use_with corefonts windows-font-dir "${EPREFIX}"/usr/share/fonts/corefonts)
195 + $(use_with wmf)
196 + $(use_with xml)
197 + --${openmp}-openmp
198 + --with-gcc-arch=no-automagic
199 + )
200 + CONFIG_SHELL=$(type -P bash) econf "${myeconfargs[@]}"
201 +}
202 +
203 +src_test() {
204 + # Install default (unrestricted) policy in $HOME for test suite #664238
205 + local _im_local_config_home="${HOME}/.config/ImageMagick"
206 + mkdir -p "${_im_local_config_home}" || \
207 + die "Failed to create IM config dir in '${_im_local_config_home}'"
208 + cp "${FILESDIR}"/policy.test.xml "${_im_local_config_home}/policy.xml" || \
209 + die "Failed to install default blank policy.xml in '${_im_local_config_home}'"
210 +
211 + local im_command= IM_COMMANDS=()
212 + if [[ ${PV} == "9999" ]] ; then
213 + IM_COMMANDS+=( "magick -version" ) # Show version we are using -- cannot verify because of live ebuild
214 + else
215 + IM_COMMANDS+=( "magick -version | grep -q -- \"${MY_PV}\"" ) # Verify that we are using version we just built
216 + fi
217 + IM_COMMANDS+=( "magick -list policy" ) # Verify that policy.xml is used
218 + IM_COMMANDS+=( "emake check" ) # Run tests
219 +
220 + for im_command in "${IM_COMMANDS[@]}"; do
221 + eval "${S}"/magick.sh \
222 + ${im_command} || \
223 + die "Failed to run \"${im_command}\""
224 + done
225 +}
226 +
227 +src_install() {
228 + # Ensure documentation installation files and paths with each release!
229 + emake \
230 + DESTDIR="${D}" \
231 + DOCUMENTATION_PATH="${EPREFIX}"/usr/share/doc/${PF}/html \
232 + install
233 +
234 + rm -f "${ED}"/usr/share/doc/${PF}/html/{ChangeLog,LICENSE,NEWS.txt}
235 + dodoc {AUTHORS,README}.txt ChangeLog
236 +
237 + if use perl; then
238 + find "${ED}" -type f -name perllocal.pod -exec rm -f {} +
239 + find "${ED}" -depth -mindepth 1 -type d -empty -exec rm -rf {} +
240 + fi
241 +
242 + find "${ED}" -name '*.la' -exec sed -i -e "/^dependency_libs/s:=.*:='':" {} +
243 + # .la files in parent are not needed, keep plugin .la files
244 + rm "${ED}"/usr/$(get_libdir)/*.la || die
245 +
246 + if use opencl; then
247 + cat <<-EOF > "${T}"/99${PN}
248 + SANDBOX_PREDICT="/dev/nvidiactl:/dev/nvidia-uvm:/dev/ati/card:/dev/dri/card:/dev/dri/renderD128"
249 + EOF
250 +
251 + insinto /etc/sandbox.d
252 + doins "${T}"/99${PN} #472766
253 + fi
254 +
255 + insinto /usr/share/${PN}
256 + doins config/*icm
257 +}
258 +
259 +pkg_postinst() {
260 + local _show_policy_xml_notice=
261 +
262 + if [[ -z "${REPLACING_VERSIONS}" ]]; then
263 + # This is a new installation
264 + _show_policy_xml_notice=yes
265 + else
266 + local v
267 + for v in ${REPLACING_VERSIONS}; do
268 + if ! ver_test "${v}" -gt "7.0.8.10-r2"; then
269 + # This is an upgrade
270 + _show_policy_xml_notice=yes
271 +
272 + # Show this elog only once
273 + break
274 + fi
275 + done
276 + fi
277 +
278 + if [[ -n "${_show_policy_xml_notice}" ]]; then
279 + elog "For security reasons, a policy.xml file was installed in /etc/ImageMagick-7"
280 + elog "which will prevent the usage of the following coders by default:"
281 + elog ""
282 + elog " - PS"
283 + elog " - PS2"
284 + elog " - PS3"
285 + elog " - EPS"
286 + elog " - PDF"
287 + elog " - XPS"
288 + fi
289 +}