aboutsummaryrefslogtreecommitdiffstats
path: root/community/lua-luassert/APKBUILD
blob: d515d40ed8e3016ab403a0d1320d16dcfd5d1e6e (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
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=lua-luassert
_pkgname=luassert
pkgver=1.7.10
pkgrel=0
pkgdesc="Assertion library for Lua"
url="https://github.com/Olivine-Labs/luassert"
arch="noarch"
license="MIT"
subpackages=""
source="$pkgname-$pkgver.tar.gz::https://github.com/Olivine-Labs/$_pkgname/archive/v$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"
# This module needs lua-busted to run tests, but lua-busted depends on
# lua-luassert and we wanna avoid circular dependencies.
options="!check"

_luaversions="5.1 5.2 5.3"
for _v in $_luaversions; do
	subpackages="$subpackages lua$_v-${pkgname#lua-}:_subpackage"
done

package() {
	mkdir -p "$pkgdir"
}

_subpackage() {
	local lver="${subpkgname:3:3}"
	pkgdesc="$pkgdesc (for Lua $lver)"
	depends="lua$lver lua$lver-say"
	install_if="$pkgname=$pkgver-r$pkgrel lua$lver"
	local destdir="$subpkgdir/usr/share/lua/$lver/$_pkgname"

	cd "$builddir"
	mkdir -p "$destdir"
	cp -r src/* "$destdir"/
}

sha512sums="2d5ca354b5f7b971f0d3420c305d921143cd7f9e1a6f4559cb466b833886a00a045e7b7c594bd9ec3c929b3d5bb8a7a4a6de75a6599e5cba7614b7652061bf05  lua-luassert-1.7.10.tar.gz"