aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2019-06-25 21:07:23 +0200
committerJakub Jirutka <jakub@jirutka.cz>2019-06-25 21:08:21 +0200
commit9382cd83e91986741b9aee419df5a58a6b8ab68e (patch)
tree23cab826ea50d895bf5c8389452e19ecfa50af45
parent6516b3e65ef38e1595ec6d984eb8b7f11b1896b8 (diff)
downloadaports-9382cd83e91986741b9aee419df5a58a6b8ab68e.tar.bz2
aports-9382cd83e91986741b9aee419df5a58a6b8ab68e.tar.xz
testing/lua-xml: new aport
-rw-r--r--testing/lua-xml/APKBUILD74
1 files changed, 74 insertions, 0 deletions
diff --git a/testing/lua-xml/APKBUILD b/testing/lua-xml/APKBUILD
new file mode 100644
index 0000000000..0c62351436
--- /dev/null
+++ b/testing/lua-xml/APKBUILD
@@ -0,0 +1,74 @@
+# Contributor: Jakub Jirutka <jakub@jirutka.cz>
+# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
+pkgname=lua-xml
+_rockname=xml
+pkgver=1.1.3
+pkgrel=0
+pkgdesc="Very fast XML parser for Lua based on RapidXML"
+url="https://github.com/lubyk/xml"
+arch="all"
+license="MIT BSL-1.0"
+depends="lua-lub"
+checkdepends="lua-lut"
+makedepends=""
+subpackages=""
+source="https://github.com/lubyk/$_rockname/archive/REL-$pkgver/$pkgname-$pkgver.tar.gz"
+builddir="$srcdir/$_rockname-REL-$pkgver"
+
+# luajit is not available for s390x
+case "$CARCH" in
+ s390x|aarch64) _luajit="";;
+ *) checkdepends="$checkdepends luajit" _luajit="jit";;
+esac
+
+_luaversions="5.1 5.2 5.3"
+for _v in $_luaversions; do
+ makedepends="$makedepends lua$_v-dev luarocks$_v"
+ subpackages="$subpackages lua$_v-${pkgname#lua-}:_subpackage"
+done
+
+build() {
+ cd "$builddir"
+
+ local lver; for lver in $_luaversions; do
+ msg "Building for Lua $lver..."
+
+ luarocks-$lver \
+ CC="$CC" \
+ CFLAGS="$CFLAGS -fPIC" \
+ LUA_INCDIR="$(pkg-config --variable=includedir lua$lver)" \
+ LUA_LIBDIR="$(pkg-config --variable=libdir lua$lver)" \
+ make --tree=./build-$lver \
+ $_rockname-$pkgver-*.rockspec
+ done
+}
+
+check() {
+ cd "$builddir"
+
+ local lver; for lver in $_luaversions $_luajit; do
+ msg "Testing on lua$lver"
+
+ ln -sf ../build-${lver/jit/5.1}/lib/lua/${lver/jit/5.1}/xml/core.so xml/
+ lua$lver test/all.lua
+ done
+}
+
+package() {
+ mkdir -p "$pkgdir"
+}
+
+_subpackage() {
+ local lver="${subpkgname:3:3}"
+ pkgdesc="$pkgdesc (for Lua $lver)"
+ depends="$depends lua$lver"
+ install_if="$pkgname=$pkgver-r$pkgrel lua$lver"
+ local rocksdir="$subpkgdir/usr/lib/luarocks/rocks-$lver"
+
+ mkdir -p "$subpkgdir"/usr
+ cp -r "$builddir"/build-$lver/* "$subpkgdir"/usr/
+
+ rm -r "$rocksdir"/manifest "$rocksdir"/$_rockname/*/doc
+}
+
+sha512sums="fdbfab6aaf46e71a02a2ac6dd0b3f708ee7e712f9704a2b834c2240696519dbcbb28fcee555bd6f12f992ee8713597aaee4b7057efcc1c004303bbe0f2223776 lua-xml-1.1.3.tar.gz"