aboutsummaryrefslogtreecommitdiffstats
path: root/community/lua-bitop/APKBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'community/lua-bitop/APKBUILD')
-rw-r--r--community/lua-bitop/APKBUILD48
1 files changed, 48 insertions, 0 deletions
diff --git a/community/lua-bitop/APKBUILD b/community/lua-bitop/APKBUILD
new file mode 100644
index 0000000000..525bbf54be
--- /dev/null
+++ b/community/lua-bitop/APKBUILD
@@ -0,0 +1,48 @@
+# Contributor:
+# Maintainer:
+pkgname="lua-bitop"
+pkgver="1.0.2"
+pkgrel=0
+pkgdesc="Bitwise operations on numbers"
+url="https://bitop.luajit.org/"
+arch="all"
+license="MIT"
+source="https://bitop.luajit.org/download/LuaBitOp-$pkgver.tar.gz"
+builddir="$srcdir/LuaBitOp-$pkgver"
+
+_luaversions="5.1 5.2 5.3"
+for _v in $_luaversions; do
+ makedepends="$makedepends lua$_v-dev"
+ subpackages="$subpackages lua$_v-${pkgname#lua-}:_subpackage"
+done
+
+prepare() {
+ default_prepare
+
+ local lver; for lver in $_luaversions; do
+ cp -r "$builddir" "$builddir-$lver"
+ done
+}
+
+build() {
+ local lver; for lver in $_luaversions; do
+ msg "Building for Lua $lver..."
+ make -C "$builddir-$lver" LUA="lua$lver"
+ done
+}
+
+package() {
+ mkdir -p "$pkgdir"
+}
+
+_subpackage() {
+ local lver="${subpkgname:3:3}"
+ pkgdesc="$pkgdesc (for Lua $lver)"
+ depends="lua$lver"
+ install_if="$pkgname=$pkgver-r$pkgrel lua$lver"
+
+ cd "$builddir-$lver"
+ install -Dm 644 bit.so "$subpkgdir/usr/lib/lua/$lver/bit.so"
+}
+
+sha512sums="a652050ea5c6fbeb8a28b05e2bc4a3550c854cc45f7f42c8c1b0a81f5b76773cdf061e6a839cdb339614118169e578b6e3efa5a3efbe59a2f01874b2fa2b4f2e LuaBitOp-1.0.2.tar.gz"