APKBUILD 1.3 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=1
Jakub Jirutka's avatar
Jakub Jirutka committed
6 7 8 9 10
pkgdesc="TOML decoder/encoder for Lua"
url="https://github.com/jonstoler/lua-toml"
arch="noarch"
license="Happy"
depends=""
11
checkdepends="luajit lua-busted"
Jakub Jirutka's avatar
Jakub Jirutka committed
12 13 14 15 16 17
source="$pkgname-$pkgver.tar.gz::https://github.com/jonstoler/$pkgname/archive/v$pkgver.tar.gz"
builddir="$srcdir/$pkgname-$pkgver"

_luaversions="5.1 5.2 5.3"
for _v in $_luaversions; do
	subpackages="$subpackages lua$_v-${pkgname#lua-}:_subpackage"
18
	checkdepends="$checkdepends lua$_v"
Jakub Jirutka's avatar
Jakub Jirutka committed
19 20
done

21 22 23 24 25 26 27 28 29
check() {
	cd "$builddir"

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

Jakub Jirutka's avatar
Jakub Jirutka committed
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
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"