diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2017-09-30 18:03:58 +0200 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2017-09-30 18:03:58 +0200 |
commit | bfcd198805772179ebe8f735f396671a2cf5af46 (patch) | |
tree | 54c6a28bc96a3c840d6078b79271e2b53945d590 /community | |
parent | 672293f04aaf5d837203ba132d5d3a49d91f61e8 (diff) | |
download | aports-bfcd198805772179ebe8f735f396671a2cf5af46.tar.bz2 aports-bfcd198805772179ebe8f735f396671a2cf5af46.tar.xz |
community/lua-brieflz: move from testing
Diffstat (limited to 'community')
-rw-r--r-- | community/lua-brieflz/APKBUILD | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/community/lua-brieflz/APKBUILD b/community/lua-brieflz/APKBUILD new file mode 100644 index 0000000000..7583bdbaac --- /dev/null +++ b/community/lua-brieflz/APKBUILD @@ -0,0 +1,70 @@ +# Contributor: Jakub Jirutka <jakub@jirutka.cz> +# Maintainer: Jakub Jirutka <jakub@jirutka.cz> +pkgname=lua-brieflz +_pkgname=brieflz.lua +pkgver=0.1.2 +pkgrel=0 +pkgdesc="Lua binding for BriefLZ compression library" +url="https://github.com/jirutka/brieflz.lua" +arch="all" +license="MIT" +checkdepends="lua-basexx lua-busted moonscript" +makedepends="" +subpackages="" +source="$pkgname-$pkgver.tar.gz::https://github.com/jirutka/$_pkgname/archive/v$pkgver.tar.gz" +builddir="$srcdir/$_pkgname-$pkgver" + +# luajit is not available for s390x +case "$CARCH" in + s390x) _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 brieflz-dev-0.rockspec + done +} + +check() { + cd "$builddir" + + local lver; for lver in $_luaversions $_luajit; do + msg "Testing on lua$lver" + + ln -sf build/lib/lua/${lver/jit/5.1}/brieflz.so . + lua$lver /usr/bin/busted + 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" + install -D -m 755 build/lib/lua/$lver/brieflz.so \ + "$subpkgdir"/usr/lib/lua/$lver/brieflz.so +} + +sha512sums="4f22f90b82e5596b605873fb83365a0e0eaa9d5a27e9e3a14ca886d07c003c60e6840df71d973ee0696c1755cc0e88b366b27bb1bbaca63abaffce852b56bbeb lua-brieflz-0.1.2.tar.gz" |