Diff imagemagick-6.9.12.96 with a imagemagick-7.1.1.6-r1

/usr/portage/media-gfx/imagemagick/imagemagick-7.1.1.6-r1.ebuild 2023-10-09 14:52:31.632368404 +0300
4 4
EAPI=8
5 5

  
6 6
QA_PKGCONFIG_VERSION=$(ver_cut 1-3)
7
inherit flag-o-matic libtool perl-functions toolchain-funcs
7
inherit autotools flag-o-matic perl-functions toolchain-funcs
8 8

  
9 9
if [[ ${PV} == 9999 ]] ; then
10
	EGIT_REPO_URI="https://github.com/ImageMagick/ImageMagick6.git"
10
	EGIT_REPO_URI="https://github.com/ImageMagick/ImageMagick.git"
11 11
	inherit git-r3
12 12
	MY_P="imagemagick-9999"
13 13
else
14 14
	MY_PV="$(ver_rs 3 '-')"
15 15
	MY_P="ImageMagick-${MY_PV}"
16 16
	SRC_URI="mirror://imagemagick/${MY_P}.tar.xz"
17
	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
17
	KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
18 18
fi
19 19

  
20 20
S="${WORKDIR}/${MY_P}"
......
25 25
LICENSE="imagemagick"
26 26
# Please check this on bumps, SONAME is often not updated! Use abidiff on old/new.
27 27
# If ABI is broken, change the bit after the '-'.
28
SLOT="0/$(ver_cut 1-3)-96"
29
IUSE="bzip2 corefonts +cxx djvu fftw fontconfig fpx graphviz hardened 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"
28
SLOT="0/$(ver_cut 1-3)-43"
29
IUSE="bzip2 corefonts +cxx djvu fftw fontconfig fpx graphviz hdri heif jbig jpeg jpeg2k jpegxl 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"
30 30

  
31
REQUIRED_USE="
32
	corefonts? ( truetype )
31
REQUIRED_USE="corefonts? ( truetype )
33 32
	svg? ( xml )
34
	test? ( corefonts )
35
"
33
	test? ( corefonts )"
36 34

  
37 35
RESTRICT="!test? ( test )"
38 36

  
......
50 48
	jbig? ( >=media-libs/jbigkit-2:= )
51 49
	jpeg? ( media-libs/libjpeg-turbo:= )
52 50
	jpeg2k? ( >=media-libs/openjpeg-2.1.0:2 )
51
	jpegxl? ( >=media-libs/libjxl-0.6:= )
53 52
	lcms? ( media-libs/lcms:2= )
54 53
	lqr? ( media-libs/liblqr )
55 54
	opencl? ( virtual/opencl )
......
78 77
	)
79 78
	xml? ( dev-libs/libxml2 )
80 79
	lzma? ( app-arch/xz-utils )
81
	zlib? ( sys-libs/zlib:= )
82
"
83
DEPEND="
84
	${RDEPEND}
85
	X? ( x11-base/xorg-proto )
86
"
80
	zip? ( dev-libs/libzip:= )
81
	zlib? ( sys-libs/zlib:= )"
82
DEPEND="${RDEPEND}
83
	X? ( x11-base/xorg-proto )"
87 84
BDEPEND="virtual/pkgconfig"
88 85

  
86
PATCHES=(
87
	"${FILESDIR}/${PN}-9999-nocputuning.patch"
88
)
89

  
89 90
pkg_pretend() {
90 91
	[[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
91 92
}
......
97 98
src_prepare() {
98 99
	default
99 100

  
100
	# for Darwin modules
101
	elibtoolize
101
	#elibtoolize # for Darwin modules
102
	eautoreconf
103

  
104
	# Apply hardening, bug #664236
105
	cp "${FILESDIR}"/policy-hardening.snippet "${S}" || die
106
	sed -i -e '/^<policymap>$/ {
107
			r policy-hardening.snippet
108
			d
109
		}' \
110
		config/policy.xml || \
111
		die "Failed to apply hardening of policy.xml"
112
	einfo "policy.xml hardened"
102 113

  
103
	# For testsuite, see bug #500580#c3
114
	# For testsuite, see https://bugs.gentoo.org/show_bug.cgi?id=500580#c3
104 115
	local ati_cards mesa_cards nvidia_cards render_cards
105 116
	shopt -s nullglob
106 117
	ati_cards=$(echo -n /dev/ati/card* | sed 's/ /:/g')
......
146 157
		--with-gs-font-dir="${EPREFIX}"/usr/share/fonts/urw-fonts
147 158
		$(use_with bzip2 bzlib)
148 159
		$(use_with X x)
160
		$(use_with zip)
149 161
		$(use_with zlib)
150 162
		--without-autotrace
151 163
		$(use_with postscript dps)
......
161 173
		$(use_with jbig)
162 174
		$(use_with jpeg)
163 175
		$(use_with jpeg2k openjp2)
176
		$(use_with jpegxl jxl)
164 177
		$(use_with lcms)
165 178
		$(use_with lqr)
166 179
		$(use_with lzma)
......
174 187
		$(use_with corefonts windows-font-dir "${EPREFIX}"/usr/share/fonts/corefonts)
175 188
		$(use_with wmf)
176 189
		$(use_with xml)
177
		--with-gcc-arch=no-automagic
178

  
179
		# Default upstream (as of 6.9.12.96/7.1.1.18 anyway) is open
180
		# For now, let's make USE=hardened do 'limited', and have USE=-hardened
181
		# reflect the upstream default of 'open'.
182
		#
183
		# We might change it to 'secure' and 'limited' at some point.
184
		# See also bug #716674.
185
		--with-security-policy=$(usex hardened limited open)
186 190
	)
187 191

  
188 192
	CONFIG_SHELL="${BROOT}"/bin/bash econf "${myeconfargs[@]}"
189 193
}
190 194

  
191 195
src_test() {
192
	# Install default (unrestricted) policy in ${HOME} for test suite, bug #664238
196
	# Install default (unrestricted) policy in $HOME for test suite, bug #664238
193 197
	local _im_local_config_home="${HOME}/.config/ImageMagick"
194 198
	mkdir -p "${_im_local_config_home}" || \
195 199
		die "Failed to create IM config dir in '${_im_local_config_home}'"
......
197 201
		die "Failed to install default blank policy.xml in '${_im_local_config_home}'"
198 202

  
199 203
	local im_command= IM_COMMANDS=()
200
	IM_COMMANDS+=( "identify -version | grep -q -- \"${MY_PV}\"" ) # Verify that we are using version we just built
201
	IM_COMMANDS+=( "identify -list policy" ) # Verify that policy.xml is used
204
	if [[ ${PV} == 9999 ]] ; then
205
		IM_COMMANDS+=( "magick -version" ) # Show version we are using -- cannot verify because of live ebuild
206
	else
207
		IM_COMMANDS+=( "magick -version | grep -q -- \"${MY_PV}\"" ) # Verify that we are using version we just built
208
	fi
209
	IM_COMMANDS+=( "magick -list policy" ) # Verify that policy.xml is used
202 210
	IM_COMMANDS+=( "emake check" ) # Run tests
203 211

  
204 212
	for im_command in "${IM_COMMANDS[@]}"; do
......
233 241
		EOF
234 242

  
235 243
		insinto /etc/sandbox.d
236
		# bug #472766
237
		doins "${T}"/99${PN}
244
		doins "${T}"/99${PN} #472766
238 245
	fi
239 246

  
240 247
	insinto /usr/share/${PN}
241 248
	doins config/*icm
242 249
}
250

  
251
pkg_postinst() {
252
	local _show_policy_xml_notice=
253

  
254
	if [[ -z "${REPLACING_VERSIONS}" ]]; then
255
		# This is a new installation
256
		_show_policy_xml_notice=yes
257
	else
258
		local v
259
		for v in ${REPLACING_VERSIONS}; do
260
			if ! ver_test "${v}" -gt "7.0.8.10-r2"; then
261
				# This is an upgrade
262
				_show_policy_xml_notice=yes
263

  
264
				# Show this elog only once
265
				break
266
			fi
267
		done
268
	fi
269

  
270
	if [[ -n "${_show_policy_xml_notice}" ]]; then
271
		elog "For security reasons, a policy.xml file was installed in /etc/ImageMagick-7"
272
		elog "which will prevent the usage of the following coders by default:"
273
		elog ""
274
		elog "  - PS"
275
		elog "  - PS2"
276
		elog "  - PS3"
277
		elog "  - EPS"
278
		elog "  - PDF"
279
		elog "  - XPS"
280
	fi
281
}
Thank you!