aboutsummaryrefslogtreecommitdiffstats
path: root/community/lua-binaryheap/APKBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'community/lua-binaryheap/APKBUILD')
-rw-r--r--community/lua-binaryheap/APKBUILD54
1 files changed, 54 insertions, 0 deletions
diff --git a/community/lua-binaryheap/APKBUILD b/community/lua-binaryheap/APKBUILD
new file mode 100644
index 0000000000..d5014e6a48
--- /dev/null
+++ b/community/lua-binaryheap/APKBUILD
@@ -0,0 +1,54 @@
+# Contributor: Jakub Jirutka <jakub@jirutka.cz>
+# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
+pkgname=lua-binaryheap
+_rockname=binaryheap
+pkgver=0.4
+_pkgver=${pkgver%%.*}v${pkgver#*.}
+pkgrel=0
+pkgdesc="Binary heap implementation in Lua"
+url="https://tieske.github.io/binaryheap.lua/"
+arch="noarch"
+license="MIT"
+depends="lua"
+checkdepends="lua-busted"
+source="https://github.com/Tieske/binaryheap.lua/archive/version_$_pkgver/binaryheap.lua-$pkgver.tar.gz"
+builddir="$srcdir/binaryheap.lua-version_$_pkgver"
+
+case "$CARCH" in
+ # luajit is not available for s390x
+ s390x) _luajit="";;
+ *) checkdepends="$checkdepends luajit" _luajit="jit";;
+esac
+
+_luaversions="5.1 5.2 5.3"
+for _v in $_luaversions; do
+ checkdepends="$checkdepends lua$_v lua$_v-busted"
+done
+
+prepare() {
+ default_prepare
+ rm .busted
+}
+
+check() {
+ local lver; for lver in $_luaversions $_luajit; do
+ msg "Testing on lua$lver"
+ lua$lver /usr/bin/busted || {
+ # FIXME: Allow failure on Lua 5.3.
+ # https://github.com/Tieske/binaryheap.lua/issues/17
+ [ $lver = 5.3 ] || return 1
+ }
+ done
+}
+
+package() {
+ local rockdir="$pkgdir/usr/lib/luarocks/rocks-common/$_rockname/$pkgver-1"
+
+ install -m 644 -D "$builddir"/src/binaryheap.lua \
+ "$pkgdir"/usr/share/lua/common/binaryheap.lua
+
+ mkdir -p "$rockdir"
+ echo 'rock_manifest = {}' > "$rockdir"/rock_manifest
+}
+
+sha512sums="2d26108af024f6de5873d9ad2a10dc2fec5b603770c5ff3b3b36289c73261ad6952ed790caad6886bd313a41f9bd42a8257585dd653508d7f1bcd5d1236d2e12 binaryheap.lua-0.4.tar.gz"