aboutsummaryrefslogtreecommitdiffstats
path: root/community/ruby-rmagick/APKBUILD
blob: 3066ccd44e7a96212e126b37d65341b0799492c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=ruby-rmagick
_gemname=rmagick
pkgver=2.16.0
_pkgver=${pkgver//./-}
pkgrel=2
pkgdesc="Ruby bindings for ImageMagick"
url="https://rmagick.github.io/"
arch="all"
license="MIT"
depends="ghostscript-fonts"
checkdepends="ruby-rake ruby-rspec"
makedepends="imagemagick6-dev ruby ruby-dev"
source="https://github.com/rmagick/rmagick/archive/RMagick_$_pkgver.tar.gz
	gemspec.patch"
builddir="$srcdir/rmagick-RMagick_$_pkgver"

build() {
	cd "$builddir"

	gem build $_gemname.gemspec
	gem install --local \
		--install-dir dist \
		--ignore-dependencies \
		--no-document \
		--verbose \
		$_gemname
}

check() {
	cd "$builddir"

	GEM_PATH='dist:.gem' rspec
}

package() {
	local gemdir="$pkgdir/$(ruby -e 'puts Gem.default_dir')"
	cd "$builddir"/dist

	mkdir -p "$gemdir"
	cp -r extensions gems specifications "$gemdir"/

	# Remove unnecessary files and rubbish...
	find "$gemdir"/extensions/ -name mkmf.log -delete

	cd "$gemdir"/gems/$_gemname-$pkgver
	rm -r ext/ lib/*.so
}

sha512sums="2ff7c482815a31c383e0d761d9e1e5a1921b00f83c3701bc253bb96cb82fefb3313e7b73ca80f5a320323488ed697a826ac6f890130bc11c3b41ea46c0eaa191  RMagick_2-16-0.tar.gz
b609012c32bda1405bdd55110aaa000914a6e0a23f8527673508cc0244a601fa0ac65374a8c00f595cb9d8118d8cae256435036df4faa80a2d686dd3f62ed281  gemspec.patch"