aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-unit/APKBUILD
blob: 16b968369b3b7cbb49c284121d2c30c62906d5c0 (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
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=lua-unit
_pkgname=$(echo ${pkgname/-/} | tr '[:lower:]' '[:upper:]')
pkgver=3.3
_pkgver=${pkgver/./_}
pkgrel=0
pkgdesc="Unit-testing framework for Lua"
url="https://github.com/bluebird75/luaunit"
arch="noarch"
license="BSD-2-Clause"
depends="lua5.2"
makedepends="python3"
options="!check" # test suite suitable for Windows only
source="https://github.com/bluebird75/luaunit/archive/${_pkgname}_V${_pkgver}.tar.gz"
builddir="$srcdir"/${pkgname/-/}-${_pkgname}_V${_pkgver}

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

check() {
	python3 doit.py runtests
}

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

_subpackage() {
	local lver="${subpkgname:3:3}"
	pkgdesc="$pkgdesc (for Lua $lver)"
	depends="lua$lver"
	install_if="$pkgname=$pkgver-r$pkgrel lua$lver"
	install -m644 -D "$builddir"/luaunit.lua \
		"$subpkgdir"/usr/share/lua/$lver/luaunit.lua
}

sha512sums="bf0ea8f714fe93123ca019e7c9a61fb81592f1300a7943ca2f1d0717c1882d673316f4c800e6204c38cdc4e90467f35475df9a6420e4d675d753db46d2ca57ac  LUAUNIT_V3_3.tar.gz"