aboutsummaryrefslogtreecommitdiffstats
path: root/community
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2017-06-05 00:41:27 +0200
committerJakub Jirutka <jakub@jirutka.cz>2017-06-05 00:41:27 +0200
commit815632a1a9020c74465dfa9837678a14178231bb (patch)
tree77aa4d24a7e0d66ca2307a5f895e4d514153f88f /community
parent796f99cb55b5b0cdaebfa442639deed397b84a3c (diff)
downloadaports-815632a1a9020c74465dfa9837678a14178231bb.tar.bz2
aports-815632a1a9020c74465dfa9837678a14178231bb.tar.xz
community/lua-argparse: move from testing
Diffstat (limited to 'community')
-rw-r--r--community/lua-argparse/APKBUILD58
1 files changed, 58 insertions, 0 deletions
diff --git a/community/lua-argparse/APKBUILD b/community/lua-argparse/APKBUILD
new file mode 100644
index 0000000000..c0f15131dc
--- /dev/null
+++ b/community/lua-argparse/APKBUILD
@@ -0,0 +1,58 @@
+# Contributor: Jakub Jirutka <jakub@jirutka.cz>
+# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
+pkgname=lua-argparse
+_pkgname=argparse
+pkgver=0.5.0
+pkgrel=0
+pkgdesc="Feature-rich command line parser for Lua"
+url="https://github.com/mpeterv/argparse"
+arch="noarch"
+license="MIT"
+depends=""
+checkdepends="lua-busted"
+subpackages=""
+source="$pkgname-$pkgver.tar.gz::https://github.com/mpeterv/$_pkgname/archive/$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() {
+ cd "$builddir"
+ mkdir .bin
+
+ local lver; for lver in $_luaversions $_luajit; do
+ msg "Testing on lua$lver"
+
+ ln -sf /usr/bin/lua$lver .bin/lua
+ LUA_PATH="$builddir/src/?.lua;;" \
+ PATH="$builddir/.bin:$PATH" \
+ lua /usr/bin/busted
+ done
+}
+
+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 -D -m 644 src/argparse.lua \
+ "$subpkgdir"/usr/share/lua/$lver/argparse.lua
+}
+
+sha512sums="29ab0d53a985fee135ff8f4237129df338b9fcea3da7c10450bab8de4f7fde64f96bf863c97dc403388c21551a66280049c6f49531c5ea483f3fa0801e685422 lua-argparse-0.5.0.tar.gz"