diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2017-04-16 02:34:43 +0200 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2017-04-16 02:34:43 +0200 |
commit | 4c0838dd9ec06e7a23c4b4fe6b40872e39ffa476 (patch) | |
tree | 85a5b9930046d28070acbae2bf89a9e79af6e97a /community/lua-dromozoa-utf8 | |
parent | 0d5882d59e141e21d9cbd500dc9a7ef5816b5403 (diff) | |
download | aports-4c0838dd9ec06e7a23c4b4fe6b40872e39ffa476.tar.bz2 aports-4c0838dd9ec06e7a23c4b4fe6b40872e39ffa476.tar.xz |
community/lua-dromozoa-utf8: move from testing
Diffstat (limited to 'community/lua-dromozoa-utf8')
-rw-r--r-- | community/lua-dromozoa-utf8/APKBUILD | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/community/lua-dromozoa-utf8/APKBUILD b/community/lua-dromozoa-utf8/APKBUILD new file mode 100644 index 0000000000..147ba0c5cf --- /dev/null +++ b/community/lua-dromozoa-utf8/APKBUILD @@ -0,0 +1,58 @@ +# Contributor: Jakub Jirutka <jakub@jirutka.cz> +# Maintainer: Jakub Jirutka <jakub@jirutka.cz> +pkgname=lua-dromozoa-utf8 +_pkgname=dromozoa-utf8 +pkgver=1.3 +pkgrel=0 +pkgdesc="Lua 5.3 compatible pure-Lua UTF-8 implementation" +url="https://github.com/dromozoa/dromozoa-utf8/" +arch="all" +license="GPL3" +depends="" +checkdepends="" +source="$pkgname-$pkgver.tar.gz::https://github.com/dromozoa/$_pkgname/archive/v$pkgver.tar.gz" +builddir="$srcdir/$_pkgname-$pkgver" + +# luajit is not available for selected arches +case "$CARCH" in + s390x) _luajit="";; + *) checkdepends="$checkdepends luajit" _luajit="jit";; +esac + +_luaversions="5.1 5.2 5.3" +for _v in $_luaversions; do + subpackages="$subpackages lua$_v-${pkgname#lua-}:_subpackage" + checkdepends="$checkdepends lua$_v" +done + +check() { + local out + cd "$builddir" + + local lver; for lver in $_luaversions $_luajit; do + msg "Testing on lua$lver" + out=$(lua$lver test.lua test.exp 2>&1) || { + echo "Tests failed, printing last 30 lines of the output..." + printf '%s\n' "$out" | tail -n 30 + return 1 + } + done +} + +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" + local lmod_dir="$subpkgdir/usr/share/lua/$lver" + + cd "$builddir" + mkdir -p "$lmod_dir" + cp -r dromozoa "$lmod_dir"/ +} + +sha512sums="c1894692f80cc2204683b7a8f540d59b1a23447bc61492acef3c6bac7f50884ca39b0b372e2d56f4473b92a8263da2c705243e7c341eea43583578964bedd4f4 lua-dromozoa-utf8-1.3.tar.gz" |