summaryrefslogtreecommitdiff
path: root/lua-cpml/PKGBUILD
blob: 399b13f32a8f941840374ae364995ed258a9a167 (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
# Maintainer: Aki <please at ignore pl>

pkgname=lua-cpml
_commit=eb209f6
pkgver=1.0.0.r64.g$_commit
pkgrel=2
pkgdesc="Cirno's Perfect Math Library"
arch=('any')
url='https://github.com/excessive/cpml'
license=('BSD' 'MIT' 'CC0')
makedepends=('luarocks')
source=("git+https://github.com/excessive/cpml.git#commit=$_commit" 'lua_version.diff' 'modules.diff')
sha256sums=('SKIP' 'SKIP' 'SKIP')


pkgver() {
	cd cpml
	git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}


prepare() {
	cd cpml
	patch --forward --strip=1 --input="$srcdir/lua_version.diff"
	patch --forward --strip=1 --input="$srcdir/modules.diff"
}


build() {
	cd cpml
	luarocks make --pack-binary-rock cpml-scm-1.rockspec
}


package() {
	cd cpml
	luarocks --lua-version=5.4 --tree="$pkgdir/usr" install --deps-mode=none cpml-scm-1.all.rock
	find "$pkgdir/usr" -name manifest -delete
}