From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1326206-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 323E6158018
	for <garchives@archives.gentoo.org>; Sat,  2 Oct 2021 20:29:13 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 596B7E088F;
	Sat,  2 Oct 2021 20:29:12 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 3BFBEE088F
	for <gentoo-commits@lists.gentoo.org>; Sat,  2 Oct 2021 20:29:12 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 46E0A342C40
	for <gentoo-commits@lists.gentoo.org>; Sat,  2 Oct 2021 20:29:11 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id AFAAC106
	for <gentoo-commits@lists.gentoo.org>; Sat,  2 Oct 2021 20:29:09 +0000 (UTC)
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" <sam@gentoo.org>
Message-ID: <1633206541.82e18f2bee1f7ac48b24a78838bed12856b0bcbf.sam@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-ruby/rmagick/
X-VCS-Repository: repo/gentoo
X-VCS-Files: dev-ruby/rmagick/rmagick-4.2.2.ebuild
X-VCS-Directories: dev-ruby/rmagick/
X-VCS-Committer: sam
X-VCS-Committer-Name: Sam James
X-VCS-Revision: 82e18f2bee1f7ac48b24a78838bed12856b0bcbf
X-VCS-Branch: master
Date: Sat,  2 Oct 2021 20:29:09 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 88bd16d0-11e0-4b01-bf9d-7196b2d3dedd
X-Archives-Hash: 6b13af892d9cf4573cb6214c985c5d05

commit:     82e18f2bee1f7ac48b24a78838bed12856b0bcbf
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Oct  2 20:28:36 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Oct  2 20:29:01 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=82e18f2b

dev-ruby/rmagick: fix most test failures (on PPC, anyway)

- Require TIFF support in ImageMagick
- Use a custom ImageMagick policy file

Bug: https://bugs.gentoo.org/815856
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-ruby/rmagick/rmagick-4.2.2.ebuild | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/dev-ruby/rmagick/rmagick-4.2.2.ebuild b/dev-ruby/rmagick/rmagick-4.2.2.ebuild
index 3cb79596f21..5513ee23236 100644
--- a/dev-ruby/rmagick/rmagick-4.2.2.ebuild
+++ b/dev-ruby/rmagick/rmagick-4.2.2.ebuild
@@ -29,7 +29,7 @@ KEYWORDS="amd64 ~hppa ~ppc ~ppc64 ~x86"
 IUSE="doc"
 
 RDEPEND+=" >=media-gfx/imagemagick-6.9.0:="
-DEPEND+=" test? ( >=media-gfx/imagemagick-7.1.0:=[jpeg,lqr,webp] )"
+DEPEND+=" test? ( >=media-gfx/imagemagick-7.1.0:=[jpeg,lqr,tiff,webp] )"
 
 all_ruby_prepare() {
 	# Avoid unused dependency on rake-compiler. This also avoids an
@@ -44,7 +44,7 @@ all_ruby_prepare() {
 	sed -i -e '/prefix/ s:ImageMagick:ImageMagick-6:' ext/RMagick/extconf.rb || die
 
 	# Reading PDFs is not allowed by the default Gentoo security policy for imagemagick
-	sed -i -e '/can read PDF file/askip "Not allowed by Gentoo security policy"' spec/rmagick/image/read_spec.rb || die
+	#sed -i -e '/can read PDF file/askip "Not allowed by Gentoo security policy"' spec/rmagick/image/read_spec.rb || die
 
 	# Update version number hardcoded in tests
 	sed -i -e 's/"7.0"/"7.1"/' spec/rmagick/image/channel_mean_spec.rb || die
@@ -53,6 +53,22 @@ all_ruby_prepare() {
 	mkdir tmp
 }
 
+each_ruby_test() {
+	# Borrowed from media-gfx/gscan2pdf
+	# Needed to avoid test failures on e.g. ppc, bug #815856
+	# (Unclear why it doesn't manifest on amd64 here at least)
+	local confdir="${HOME}/.config/ImageMagick"
+	mkdir -p "${confdir}" || die
+	cat > "${confdir}/policy.xml" <<-EOT || die
+		<policymap>
+			<policy domain="coder" rights="read|write" pattern="PDF" />
+			<policy domain="coder" rights="read" pattern="PS" />
+		</policymap>
+	EOT
+
+	RSPEC_VERSION="3" ruby-ng_rspec
+}
+
 all_ruby_install() {
 	all_fakegem_install