sys-apps/portage: remove old versions
[gentoo.git] / dev-ruby / mini_magick / mini_magick-4.8.0.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 USE_RUBY="ruby23 ruby24 ruby25"
7
8 RUBY_FAKEGEM_RECIPE_TEST="rspec3"
9 RUBY_FAKEGEM_RECIPE_DOC="rdoc"
10 RUBY_FAKEGEM_EXTRADOC="README.md"
11
12 RUBY_FAKEGEM_GEMSPEC="${PN}.gemspec"
13
14 RUBY_FAKEGEM_BINWRAP=""
15
16 inherit ruby-fakegem eutils
17
18 DESCRIPTION="Manipulate images with minimal use of memory"
19 HOMEPAGE="https://github.com/minimagick/minimagick"
20 SRC_URI="https://github.com/minimagick/minimagick/archive/v${PV}.tar.gz -> ${P}.tar.gz"
21 RUBY_S="minimagick-${PV}"
22
23 LICENSE="MIT"
24 SLOT="0"
25 KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
26 IUSE=""
27
28 # It's only used at runtime in this case because this extension only
29 # _calls_ the commands. But when we run tests we're going to need tiff
30 # and jpeg support at a minimum.
31 RDEPEND+=" media-gfx/imagemagick"
32 DEPEND+=" test? ( virtual/imagemagick-tools[jpeg,png,tiff] )"
33
34 USE_RUBY="ruby23 ruby24" ruby_add_bdepend "test? ( dev-ruby/mocha dev-ruby/posix-spawn dev-ruby/webmock )"
35
36 all_ruby_prepare() {
37         # remove executable bit from all files
38         find "${S}" -type f -exec chmod -x {} +
39
40         sed -i -e '/\([Bb]undler\|pry\)/ s:^:#:' spec/spec_helper.rb || die
41
42         # Don't force a specific formatter but use overall Gentoo defaults.
43         sed -i -e '/config.formatter/d' spec/spec_helper.rb || die
44
45         # Avoid broken spec that does not assume . in path name
46         sed -i -e '/reformats a layer/,/end/ s:^:#:' spec/lib/mini_magick/image_spec.rb || die
47
48         # Avoid failing spec that also fails in upstream Travis
49         sed -i -e '/returns a hash of verbose information/,/^        end/ s:^:#:' spec/lib/mini_magick/image_spec.rb || die
50
51         # Make spec more lenient to imagemagick quoting
52         sed -i -e "/unable to open image/ s/'foo'/.foo./" spec/lib/mini_magick/shell_spec.rb || die
53
54         # Avoid graphicsmagick tests because installing both in parallel for
55         # tests is hard.
56         sed -i -e 's/:graphicsmagick//' spec/spec_helper.rb || die
57         sed -i -e '/identifies when gm exists/,/^    end/ s:^:#:' spec/lib/mini_magick/utilities_spec.rb || die
58         sed -i -e '/returns GraphicsMagick/,/^    end/ s:^:#:' spec/lib/mini_magick_spec.rb || die
59 }
60
61 each_ruby_test() {
62         case ${RUBY} in
63                 *ruby23|*ruby24)
64                         each_fakegem_test
65                         ;;
66                 *)
67                         einfo "Skipping tests due to circular dependencies with Rails"
68                         ;;
69         esac
70 }