aboutsummaryrefslogtreecommitdiffstats
path: root/community/lua-lpeg/APKBUILD
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2017-05-12 21:51:54 +0200
committerJakub Jirutka <jakub@jirutka.cz>2017-05-12 22:23:07 +0200
commit04170b314686f4117edf1052d5ef951f570de158 (patch)
treebf6c3c1cfea640230914543366313a66488a0dd8 /community/lua-lpeg/APKBUILD
parent1f89c5f7ea9a5188e5d6a5352ae1fd6bf74fa8d5 (diff)
downloadaports-04170b314686f4117edf1052d5ef951f570de158.tar.bz2
aports-04170b314686f4117edf1052d5ef951f570de158.tar.xz
community/lua-lpeg: run tests on check
Diffstat (limited to 'community/lua-lpeg/APKBUILD')
-rw-r--r--community/lua-lpeg/APKBUILD23
1 files changed, 20 insertions, 3 deletions
diff --git a/community/lua-lpeg/APKBUILD b/community/lua-lpeg/APKBUILD
index afd28a4579..b1ca9b5e34 100644
--- a/community/lua-lpeg/APKBUILD
+++ b/community/lua-lpeg/APKBUILD
@@ -3,7 +3,7 @@
pkgname=lua-lpeg
_pkgname=lpeg
pkgver=1.0.1
-pkgrel=1
+pkgrel=2
pkgdesc="Pattern-matching library for Lua"
url="http://www.inf.puc-rio.br/~roberto/lpeg"
arch="all"
@@ -11,9 +11,16 @@ license="MIT"
depends=""
makedepends=""
subpackages=""
-source="http://www.inf.puc-rio.br/~roberto/lpeg/$_pkgname-$pkgver.tar.gz"
+source="http://www.inf.puc-rio.br/~roberto/lpeg/$_pkgname-$pkgver.tar.gz
+ test-fix-setlocale.patch"
builddir="$srcdir/$_pkgname-$pkgver"
+# luajit is not available for selected arches
+case "$CARCH" in
+ s390x) _luajit="";;
+ *) checkdepends="luajit" _luajit="jit";;
+esac
+
_luaversions="5.1 5.2 5.3"
for _v in $_luaversions; do
makedepends="$makedepends lua$_v-dev"
@@ -41,6 +48,15 @@ build() {
done
}
+check() {
+ local lver; for lver in $_luaversions $_luajit; do
+ msg "Testing on lua$lver"
+
+ cd "$builddir-${lver/jit/5.1}"
+ lua$lver test.lua
+ done
+}
+
package() {
mkdir -p "$pkgdir"
}
@@ -59,4 +75,5 @@ _package() {
"$subpkgdir"/usr/share/lua/$lver/re.lua || return 1
}
-sha512sums="7b43fbee7eff443000986684bc56bba6d2796a31cf860740746c70e155bdea1b62a46b93f97e2747e3ef0f63e965148778ac2985d0f2d83e1e37ec4ebbabf4aa lpeg-1.0.1.tar.gz"
+sha512sums="7b43fbee7eff443000986684bc56bba6d2796a31cf860740746c70e155bdea1b62a46b93f97e2747e3ef0f63e965148778ac2985d0f2d83e1e37ec4ebbabf4aa lpeg-1.0.1.tar.gz
+49ce012e6c2f6e07b3aae4f52630f3b4aa43f936f76dbfb2b8e33208fb05aec54e2e6c815215d606ee0dfc860b07917a042c77cdc0ea5b6b14a8028fa0e724f8 test-fix-setlocale.patch"