aboutsummaryrefslogtreecommitdiffstats
path: root/main/ruby-rbs/APKBUILD
blob: 20d389b527fe8c7b73ae143b4511369cd74b8734 (plain) (blame)
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
53
54
55
56
57
58
59
60
61
62
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=ruby-rbs
_gemname=rbs
# Keep version in sync with "Bundled gems" (https://stdgems.org) for the
# packaged Ruby version.
pkgver=1.4.0
pkgrel=0
pkgdesc="Type Signature for Ruby"
url="https://github.com/ruby/rbs"
arch="noarch"
license="BSD-2-Clause AND Ruby"
depends="ruby"
checkdepends="ruby-rake ruby-test-unit"
makedepends="ruby-rdoc"
subpackages="$pkgname-doc"
source="https://github.com/ruby/rbs/archive/v$pkgver/$_gemname-$pkgver.tar.gz
	gemspec.patch
	"
builddir="$srcdir/$_gemname-$pkgver"
options="!check"  # FIXME: require ruby-pry that is not packaged yet

prepare() {
	default_prepare
	sed -i '/require .bundler/d' Rakefile
}

build() {
	gem build $_gemname.gemspec
}

check() {
	rake test
}

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

	gem install \
		--local \
		--install-dir "$gemdir" \
		--bindir "$pkgdir/usr/bin" \
		--ignore-dependencies \
		--document ri \
		--verbose \
		$_gemname

	# Remove unnessecary files
	cd "$gemdir"
	rm -rf build_info cache extensions plugins
}

doc() {
	pkgdesc="$pkgdesc (ri docs)"

	amove "$(ruby -e 'puts Gem.default_dir')"/doc
}

sha512sums="
831206afc76f6aabeb99916c715562f4cf32556cd2950ee94321755b947f5632d9ce0c7d14d8b4aa4310130a43e448819f79bcd9c9b49903f7744f4aecc853d0  rbs-1.4.0.tar.gz
314ac25c79f5b643f80502158347d76a2149437192da3eae75426d54835d3035f3549e2e3462a230941ce54cf82ad03d16a7936ab40a7f7b42a17d51a2f6015f  gemspec.patch
"