diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2017-03-30 12:16:45 +0200 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2017-03-30 12:32:26 +0200 |
commit | 2eef7be4220b4c8e8bdfe7b8cbe772e4555066ad (patch) | |
tree | 43eafd7a738901b38d749fe4453c9961d410a05e /community/lua-busted | |
parent | 1a7d38e19717a7711816789c341b9265e83ff758 (diff) | |
download | aports-2eef7be4220b4c8e8bdfe7b8cbe772e4555066ad.tar.bz2 aports-2eef7be4220b4c8e8bdfe7b8cbe772e4555066ad.tar.xz |
community/lua-busted: clean the mess with luajit condition
Diffstat (limited to 'community/lua-busted')
-rw-r--r-- | community/lua-busted/APKBUILD | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/community/lua-busted/APKBUILD b/community/lua-busted/APKBUILD index af93b73882..4881315ce0 100644 --- a/community/lua-busted/APKBUILD +++ b/community/lua-busted/APKBUILD @@ -4,7 +4,7 @@ pkgname=lua-busted _pkgname=busted pkgver=2.0_rc12 _pkgver=${pkgver/_/.}-1 -pkgrel=2 +pkgrel=3 pkgdesc="Elegant Lua unit testing" url="https://olivinelabs.com/busted/" arch="noarch" @@ -12,7 +12,8 @@ license="MIT" # Note: We have replaced dkjson with lua-cjson. depends="lua-cliargs lua-filesystem lua-system lua-cjson lua-say lua-luassert lua-term lua-penlight lua-mediator" -[ "$CARCH" == "s390x" ] && [ "$CARCH" == "ppc64le" ] && checkdepends="" || checkdepends="luajit" +checkdepends="" +subpackages="" source="$pkgname-$pkgver.tar.gz::https://github.com/Olivine-Labs/$_pkgname/archive/v$_pkgver.tar.gz fix-tests.patch use-cjson.patch" @@ -20,6 +21,12 @@ builddir="$srcdir/$_pkgname-$_pkgver" # tests fail on x86_64 because cl_standalone.lua output is different, i don't know why --kaniini options="!check" +# luajit is not available for selected arches +case "$CARCH" in + ppc64le | 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" @@ -31,7 +38,7 @@ prepare() { cd "$builddir" - local lver; for lver in $_luaversions jit; do + local lver; for lver in $_luaversions $_luajit; do sed "s|/usr/bin/env lua|/usr/bin/lua$lver|" \ bin/busted > bin/busted-$lver || return 1 done @@ -39,20 +46,19 @@ prepare() { check() { cd "$builddir" - # luajit not avail for selected arches - if printf "$checkdepends\n" | grep -q "luajit"; then - if [ "$CARCH" != "ppc64le" ] && [ "$CARCH" != "s390x" ]; then - mv bin/busted bin/busted.orig - local lver; for lver in $_luaversions jit; do - # Some specs invokes bin/busted as subprocess, so we must - # ensure that it will run on the correct Lua version. - install -m 755 bin/busted-$lver bin/busted || return 1 - msg "Running tests on lua$lver..." - lua$lver bin/busted spec || return 1 - done - mv bin/busted.orig bin/busted - fi - fi + + mv bin/busted bin/busted.orig + + local lver; for lver in $_luaversions $_luajit; do + # Some specs invokes bin/busted as subprocess, so we must + # ensure that it will run on the correct Lua version. + install -m 755 bin/busted-$lver bin/busted || return 1 + + msg "Running tests on lua$lver..." + lua$lver bin/busted spec || return 1 + done + + mv bin/busted.orig bin/busted } package() { |