aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2014-10-15 08:50:45 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2014-10-15 11:43:27 +0000
commitc48f25b385b024130c0eac050eceaa39d6aace17 (patch)
treedf9f042022b258e270a1c4ffb12f307638572c41
parent618d015435c6b4ebb1ab0ea0cb5b57983bf39962 (diff)
downloadaports-c48f25b385b024130c0eac050eceaa39d6aace17.tar.bz2
aports-c48f25b385b024130c0eac050eceaa39d6aace17.tar.xz
testing/lua-zlib: new aport
Simple streaming interface to zlib for Lua https://github.com/brimworks/lua-zlib fixes #1853
-rw-r--r--testing/lua-zlib/APKBUILD65
1 files changed, 65 insertions, 0 deletions
diff --git a/testing/lua-zlib/APKBUILD b/testing/lua-zlib/APKBUILD
new file mode 100644
index 0000000000..133547ddb0
--- /dev/null
+++ b/testing/lua-zlib/APKBUILD
@@ -0,0 +1,65 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+
+_luaversions="5.1"
+
+pkgname=lua-zlib
+pkgver=0.2
+pkgrel=0
+pkgdesc="Simple streaming interface to zlib for Lua"
+url="https://github.com/brimworks/lua-zlib"
+arch="all"
+license="MIT"
+depends=""
+makedepends="zlib-dev"
+subpackages=
+for _i in $_luaversions; do
+ depends="$depends lua$_i-zlib"
+ makedepends="$makedepends lua$_i-dev"
+ subpackages="$subpackages lua$_i-zlib:_zlib_${_i/./_}"
+done
+install=
+source="$pkgname-$pkgver.tar.gz::https://github.com/brimworks/lua-zlib/archive/v$pkgver.tar.gz"
+
+_builddir="$srcdir"/lua-zlib-$pkgver
+
+prepare() {
+ cd "$_builddir"
+ # apply patches here
+ for _i in $_luaversions; do
+ cp -a "$_builddir" "$srcdir"/build-$_i || return 1
+ done
+}
+
+build() {
+ cd "$_builddir"
+ for _i in $_luaversions; do
+ cd "$srcdir"/build-$_i
+ msg "build for Lua $_i"
+ make zlib.so \
+ CFLAGS="$CFLAGS -fPIC $(pkg-config --cflags lua$_i)" \
+ LDFLAGS="$LDFLAGS -shared" \
+ LIBS="-lz -lm" \
+ || return 1
+ done
+}
+
+package() {
+ mkdir -p "$pkgdir"
+}
+
+_split_zlib() {
+ local _ver=$1
+ pkgdesc="$pkgdesc $_ver"
+ depends=""
+
+ cd "$srcdir"/build-$_ver
+ install -Dm755 zlib.so "$subpkgdir"/usr/lib/lua/$_ver/zlib.so
+}
+
+for _i in $_luaversions; do
+ eval "_zlib_${_i/./_}() { _split_zlib $_i; }"
+done
+
+md5sums="65262bb1fa5f19a62df8c3d42717e590 lua-zlib-0.2.tar.gz"
+sha256sums="f10ceccdb8329b25939bf8f39a13084b7f2e78531245b4eb3823bb831ea8c688 lua-zlib-0.2.tar.gz"
+sha512sums="23ebbb1f81791dfbc2727c9d3426c86fa367b606d2820556637d5eca2976174c86490cf1b35cf97a42e22c8b45189cdf08d39d263d736be59658755c968aef7c lua-zlib-0.2.tar.gz"