APKBUILD 1.45 KB
Newer Older
Jakub Jirutka's avatar
Jakub Jirutka committed
1 2 3 4
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=lua-toml
pkgver=1.0
5
pkgrel=4
Jakub Jirutka's avatar
Jakub Jirutka committed
6 7
pkgdesc="TOML decoder/encoder for Lua"
url="https://github.com/jonstoler/lua-toml"
8
arch="noarch"
Jakub Jirutka's avatar
Jakub Jirutka committed
9 10
license="Happy"
depends=""
11
checkdepends="lua-busted"
Jakub Jirutka's avatar
Jakub Jirutka committed
12 13 14
source="$pkgname-$pkgver.tar.gz::https://github.com/jonstoler/$pkgname/archive/v$pkgver.tar.gz"
builddir="$srcdir/$pkgname-$pkgver"

15 16 17 18 19 20
# luajit is not available for selected arches
case "$CARCH" in
	ppc64le | s390x) _luajit="";;
	*) checkdepends="$checkdepends luajit" _luajit="jit";;
esac

Jakub Jirutka's avatar
Jakub Jirutka committed
21 22 23
_luaversions="5.1 5.2 5.3"
for _v in $_luaversions; do
	subpackages="$subpackages lua$_v-${pkgname#lua-}:_subpackage"
24
	checkdepends="$checkdepends lua$_v"
Jakub Jirutka's avatar
Jakub Jirutka committed
25 26
done

27 28
check() {
	cd "$builddir"
29 30 31 32 33

	local lver; for lver in $_luaversions $_luajit; do
		msg "Testing on lua$lver"
		lua$lver /usr/bin/busted || return 1
	done
34 35
}

Jakub Jirutka's avatar
Jakub Jirutka committed
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
package() {
	mkdir -p "$pkgdir"
}

_subpackage() {
	local lver="${subpkgname:3:3}"
	pkgdesc="$pkgdesc $lver"
	depends="lua$lver"
	install_if="$pkgname=$pkgver-r$pkgrel lua$lver"

	cd "$builddir"
	install -m 644 -D toml.lua "$subpkgdir"/usr/share/lua/$lver/toml.lua
}

md5sums="00422b0ef80b8903706360761fe204a1  lua-toml-1.0.tar.gz"
sha256sums="4c81ae8c338d3da3d7007978f4ec2c736ea89448beaa5583fba7092e46a90e0d  lua-toml-1.0.tar.gz"
sha512sums="f04ed6f26f47d6492c7a21c310da09b1091476724022c32b81a5492713340a4571bc04c51f34dded73f4f1cf1085dbe08e280356b0f1fa88ef0efefd0685c77e  lua-toml-1.0.tar.gz"