aboutsummaryrefslogtreecommitdiffstats
path: root/community/ruby-pygments/APKBUILD
blob: 3eacebc55b07e16d40b047cd329b4bc326b09d5d (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
53
54
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=ruby-pygments
_gemname=pygments.rb
pkgver=1.1.2
pkgrel=0
pkgdesc="Pygments syntax highlighting in Ruby"
url="https://github.com/tmm1/pygments.rb"
arch="noarch"
license="MIT"
depends="python2 py2-pygments ruby ruby-json ruby-multi_json"
checkdepends="ruby-bundler ruby-rake ruby-test-unit"
source="$pkgname-$pkgver.tar.gz::https://github.com/tmm1/$_gemname/archive/v$pkgver.tar.gz
	use-system-pygments-only.patch
	fix-gemspec.patch"
builddir="$srcdir/$_gemname-$pkgver"

prepare() {
	default_prepare

	cd "$builddir"

	# Specify files to be installed.
	sed -i 's|`git ls-files.*|Dir["lib/**/*", "lexers"]|' $_gemname.gemspec

	# Remove bundled dependencies.
	rm -r vendor
}

build() {
	cd "$builddir"
	gem build $_gemname.gemspec
}

check() {
	cd "$builddir"
	rake test
}

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

	cd "$builddir"
	gem install --local \
		--install-dir "$gemdir" \
		--ignore-dependencies \
		--no-document \
		--verbose \
		$_gemname-$pkgver.gem
}

sha512sums="e7d6c7b391894d22edb6aa64d5aa604a6b43912245507b8693084dff8e02a33cd94cac0aa6dcd52040648019f8eadb88707b71aeffe5f0ce10002733a8dd674a  ruby-pygments-1.1.2.tar.gz
a8e5d64d8209dacb5090378e8507095359b38ef55ac6896f5bd95fa9676691beb278d6d19eb47cbc51fac843b326b8e21fbf1dd9ed39e123ed0943293b0a82ca  use-system-pygments-only.patch
ddc8654d788a9b3906fd8b92476bf3fe83b07d0206e32b21453e39cfa69e116ea9906a263d4427faf8eeb6a8595fce4af55281508f49103e87a8b31dd3dd99e1  fix-gemspec.patch"