From 82e18f2bee1f7ac48b24a78838bed12856b0bcbf Mon Sep 17 00:00:00 2001 From: Sam James Date: Sat, 2 Oct 2021 21:28:36 +0100 Subject: 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 --- 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 3cb79596f21d..5513ee23236c 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 + + + + + EOT + + RSPEC_VERSION="3" ruby-ng_rspec +} + all_ruby_install() { all_fakegem_install -- cgit v1.2.3-65-gdbad