aboutsummaryrefslogtreecommitdiffstats
path: root/main/ruby-rbs/APKBUILD
blob: 0e7888b27acc9c33dd7f0910d40bca0ba36886d3 (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.0.4
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="
d998a1613b7653278460f5cee19f38bbdd13aa46d9deb8e4da8fd710a78c6ede2784580481cad43700f3d2c4c51d0d0b70eac23b156215ad3df2d227d1f6a3b6  rbs-1.0.4.tar.gz
e31431de3e1b13d9ac11277457f7856349029be9b775f1bab87eecd53998737b793cd310ba772ff122424b4c2c79e90dc4ed00debcc26a6d4d496ed19ac28aff  gemspec.patch
"