diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2017-05-29 21:07:40 +0200 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2017-05-29 21:12:59 +0200 |
commit | 0f6247ef8c25643dd183e38138b17182ccf63d90 (patch) | |
tree | 768d10d79da9c015ed48931fa5df038ac2d7015a /testing/lua-depgraph | |
parent | 22774f4a614b4efc84be2f6ecc780d25e45a5c97 (diff) | |
download | aports-0f6247ef8c25643dd183e38138b17182ccf63d90.tar.bz2 aports-0f6247ef8c25643dd183e38138b17182ccf63d90.tar.xz |
testing/lua-depgraph: new aport
https://github.com/mpeterv/depgraph
A library and CLI tool for analyzing graph of dependencies between Lua modules
Diffstat (limited to 'testing/lua-depgraph')
-rw-r--r-- | testing/lua-depgraph/APKBUILD | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/testing/lua-depgraph/APKBUILD b/testing/lua-depgraph/APKBUILD new file mode 100644 index 0000000000..e203a2d055 --- /dev/null +++ b/testing/lua-depgraph/APKBUILD @@ -0,0 +1,61 @@ +# Contributor: Jakub Jirutka <jakub@jirutka.cz> +# Maintainer: Jakub Jirutka <jakub@jirutka.cz> +pkgname=lua-depgraph +_pkgname=depgraph +pkgver=0.1.1 +pkgrel=0 +pkgdesc="A library and CLI tool for analyzing graph of dependencies between Lua modules" +url="https://github.com/mpeterv/depgraph" +arch="noarch" +license="MIT" +depends="lua lua-argparse lua-filesystem" +makedepends="" +checkdepends="" +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 -p .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;$builddir/src/?/init.lua;;" \ + PATH="$builddir/.bin:$PATH" \ + lua$lver /usr/bin/busted + done +} + +package() { + cd "$builddir" + + install -m 755 -D bin/luadepgraph.lua "$pkgdir"/usr/bin/luadepgraph +} + +_subpackage() { + local lver="${subpkgname:3:3}" + pkgdesc="$pkgdesc $lver" + depends="lua$lver lua$lver-filesystem" + install_if="$pkgname=$pkgver-r$pkgrel lua$lver" + local lmod_dir="$subpkgdir/usr/share/lua/$lver" + + cd "$builddir" + mkdir -p "$lmod_dir" + cp -r src/$_pkgname "$lmod_dir"/ +} + +sha512sums="2ea8f2907da25cf17754f1a526f390a7e532644198c03fecdf1b8ffd48c7737464b80046b9b088554abeb3f05b026f9ebdfc07a1977dc84b19e32ad418f15e4a lua-depgraph-0.1.1.tar.gz" |