aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-04-06 09:27:20 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2015-04-06 09:32:47 +0000
commitc90505bd32fa92606d1aba972e8f879a66c3be91 (patch)
tree0d0d4dc36af0cfe2cc32dff70cf59eda992c73e5 /main
parent8975a9ad3a73c0a9dee5b0c529d6d8b29c7090b8 (diff)
downloadaports-c90505bd32fa92606d1aba972e8f879a66c3be91.tar.bz2
aports-c90505bd32fa92606d1aba972e8f879a66c3be91.tar.xz
main/lua-bitlib: add support for 5.1 -> 5.3
Diffstat (limited to 'main')
-rw-r--r--main/lua-bitlib/APKBUILD68
-rw-r--r--main/lua-bitlib/Makefile11
-rw-r--r--main/lua5.1-bitlib/APKBUILD42
3 files changed, 79 insertions, 42 deletions
diff --git a/main/lua-bitlib/APKBUILD b/main/lua-bitlib/APKBUILD
new file mode 100644
index 0000000000..71da7b9b4e
--- /dev/null
+++ b/main/lua-bitlib/APKBUILD
@@ -0,0 +1,68 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+_luaversions="5.1 5.2 5.3"
+pkgname=lua-bitlib
+_name=bitlib
+pkgver=5.3.0
+pkgrel=0
+pkgdesc="A lua library providing bitwise operations"
+url="https://github.com/keplerproject/lua-compat-5.2"
+arch="all"
+license="MIT/X11"
+depends=""
+makedepends=""
+subpackages=""
+for _i in $_luaversions; do
+ makedepends="$makedepends lua$_i-dev"
+ subpackages="$subpackages lua$_i-$_name:split_${_i/./}"
+done
+source="lua-compat-bitlib-$pkgver.tar.gz::https://github.com/keplerproject/lua-compat-5.2/archive/bitlib-$pkgver.tar.gz
+ Makefile
+ "
+
+_builddir="$srcdir"/lua-compat-5.2-bitlib-$pkgver
+
+prepare() {
+ cd "$_builddir"
+}
+
+build() {
+ cd "$_builddir"
+ for _i in $_luaversions; do
+ msg "build for Lua $_i"
+ make -f "$srcdir"/Makefile LUAVER=$_i
+ done
+}
+
+package() {
+ cd "$_builddir"
+ for _i in $_luaversions; do
+ install -D $_i/bit32.so "$pkgdir"/usr/lib/lua/$_i/bit32.so \
+ || return 1
+ done
+}
+
+_split() {
+ local d= _ver=$1
+ pkgdesc="$pkgdesc for Lua $_ver"
+ install_if="lua$_ver $pkgname=$pkgver-r$pkgrel"
+ depends=
+ for d in usr/lib/lua usr/share/lua; do
+ if [ -d "$pkgdir"/$d/$_ver ]; then
+ mkdir -p "$subpkgdir"/$d
+ mv "$pkgdir"/$d/$_ver "$subpkgdir"/$d/ || return 1
+ fi
+ done
+}
+
+
+for _v in $_luaversions; do
+ eval "split_${_v/./}() { _split $_v; }"
+done
+
+
+md5sums="f3b9c497654059ba775913ac1fcfb3fc lua-compat-bitlib-5.3.0.tar.gz
+422a43f67780d4363672f2648fb45688 Makefile"
+sha256sums="dc1197b9e996b7bd2c6a679b86ed75106d5722424b3e731b8084f56626ec5552 lua-compat-bitlib-5.3.0.tar.gz
+727a6f2e85b6270066b8cb35da93775110f34671fb71f0591b37c0d7a31ac342 Makefile"
+sha512sums="234807e201197bc27720864a328f5b63a9fe8bf88bf1fb64cd178532c0745a330b23455fcff0e50d365034f3e43af3c835de7f10a685275da66a7a1ca873e90a lua-compat-bitlib-5.3.0.tar.gz
+077dd4b397a9e4eb04ac131ceeef148b5f0790970398d69823f1bad485dcb3ab57126fc7b99428c7ec8255dc6b4d4aeee5a88ddf6a7dd9a767886e2fb357265e Makefile"
diff --git a/main/lua-bitlib/Makefile b/main/lua-bitlib/Makefile
new file mode 100644
index 0000000000..8450f9f482
--- /dev/null
+++ b/main/lua-bitlib/Makefile
@@ -0,0 +1,11 @@
+
+
+LUAVER = 5.1
+
+LUAPC := lua$(LUAVER)
+LUA_CFLAGS := $(shell pkg-config --cflags $(LUAPC))
+
+$(LUAVER)/bit32.so: lbitlib.c
+ mkdir -p $(LUAVER)
+ $(CC) -I c-api $(CFLAGS) $(LUA_CFLAGS) -shared -fPIC $(LDFLAGS) -o $@ $<
+
diff --git a/main/lua5.1-bitlib/APKBUILD b/main/lua5.1-bitlib/APKBUILD
deleted file mode 100644
index 583380d9c9..0000000000
--- a/main/lua5.1-bitlib/APKBUILD
+++ /dev/null
@@ -1,42 +0,0 @@
-# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
-pkgname=lua5.1-bitlib
-_name=bitlib
-pkgver=26
-pkgrel=0
-pkgdesc="A lua library providing bitwise operations"
-url="http://luaforge.net/projects/bitli://github.com/LuaDist/bitlib"
-arch="all"
-license="MIT/X11"
-depends=""
-makedepends="lua5.1-dev"
-subpackages=""
-source="lua-bitlib-$pkgver.tar.gz::https://github.com/LuaDist/bitlib/archive/$pkgver.tar.gz"
-replaces="lua-bitlib"
-
-_builddir="$srcdir"/$_name-$pkgver
-
-prepare() {
- cd "$_builddir"
- update_config_sub || return 1
-}
-
-build() {
- cd "$_builddir"
- LUA=lua5.1 \
- ./configure \
- --build=$CBUILD \
- --host=$CHOST \
- --prefix=/usr \
- || return 1
- make || return 1
-}
-
-package() {
- cd "$_builddir"
- make DESTDIR="$pkgdir" install
- rm -f "$pkgdir"/usr/lib/lua/5.1/*a
-}
-
-md5sums="1c5bc4f544d8de7d4d50f0fccda733e8 lua-bitlib-26.tar.gz"
-sha256sums="6f8902067ce1184bdef0e14a240d5e8c1ee56d7fcd59cff2cebe8bb0b9540d4c lua-bitlib-26.tar.gz"
-sha512sums="a9900788b2e7c3f79f0dc7fe5edecd1d1fa4328a4f3d3410be59c303d804dae2e89936d21bb6684dc2b8ffcd2e9b9c339bac214c8a314ab6341dbf67c51445ef lua-bitlib-26.tar.gz"