aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2017-10-30 14:59:54 +0200
committerTimo Teräs <timo.teras@iki.fi>2017-10-30 15:00:32 +0200
commit6e3cccc193e522a0a8b08dd792f253171837ebd3 (patch)
tree0d65eec2ef36de21e536f1a939ef1b62b4a327cb
parent31bd4a8c2dc00ae79a821f6fe0ad2f23e1534f50 (diff)
downloadaports-6e3cccc193e522a0a8b08dd792f253171837ebd3.tar.gz
aports-6e3cccc193e522a0a8b08dd792f253171837ebd3.tar.bz2
aports-6e3cccc193e522a0a8b08dd792f253171837ebd3.tar.xz
community/lua-hiredis: modernize, compile all in build step
-rw-r--r--community/lua-hiredis/APKBUILD38
1 files changed, 14 insertions, 24 deletions
diff --git a/community/lua-hiredis/APKBUILD b/community/lua-hiredis/APKBUILD
index e2feb7d72a..dfb9d1eb83 100644
--- a/community/lua-hiredis/APKBUILD
+++ b/community/lua-hiredis/APKBUILD
@@ -4,12 +4,11 @@ _luaversions="5.1 5.2 5.3"
pkgname=lua-hiredis
pkgver=0.2.1
-pkgrel=2
+pkgrel=3
pkgdesc="Binding to hiredis for Lua"
url="https://github.com/agladysh/lua-hiredis"
arch="all"
license="MIT"
-depends="hiredis"
depends_dev=""
makedepends="$depends_dev hiredis-dev"
subpackages=""
@@ -25,22 +24,19 @@ source="lua-hiredis-$pkgver.tar.gz::https://github.com/agladysh/lua-hiredis/arch
0002-lua-hiredis-master.patch
0003-lua-5-2-compatibility.patch
0004-lua-5-3-compatibility.patch"
-_builddir="$srcdir"/lua-hiredis-$pkgver
-prepare() {
- local i
- cd "$_builddir"
- for i in $source; do
- case $i in
- *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
- esac
- done
- for _v in $_luaversions; do
- cp -r $_builddir "$srcdir"/$pkgname-$_v
- done
-}
+builddir="$srcdir"/lua-hiredis-$pkgver
build() {
- cd "$_builddir"
+ cd "$builddir"
+ local _v
+ for _v in $_luaversions; do
+ mkdir -p "$srcdir/build-$_v/"
+ ${CC:-gcc} src/lua-hiredis.c ${CFLAGS} -shared -fPIC \
+ $(pkg-config --cflags hiredis lua$_v) \
+ $(pkg-config --libs hiredis lua$_v) \
+ -I/usr/include/lua$_ver -I/usr/include/hiredis \
+ -o "$srcdir/build-$_v/hiredis.so"
+ done
}
check() {
@@ -54,16 +50,10 @@ package() {
_split() {
local _ver="$1"
- cd "$srcdir"/$pkgname-$_ver || return 1
pkgdesc="$pkgdesc (Lua $_ver)"
install_if="lua$_ver $pkgname=$pkgver-r$pkgrel"
- ${CC:-gcc} src/lua-hiredis.c ${CFLAGS} -shared -fPIC \
- $(pkg-config --cflags hiredis lua$_ver) \
- $(pkg-config --libs hiredis lua$_ver) \
- -I/usr/include/lua$_ver -I/usr/include/hiredis \
- -o hiredis.so || return 1
- install -Dm755 hiredis.so \
- "$subpkgdir"/usr/lib/lua/$_ver/hiredis.so || return 1
+
+ install -Dm755 "$srcdir/build-$_v/hiredis.so" "$subpkgdir"/usr/lib/lua/$_ver/hiredis.so
}
sha512sums="b53eea8b51ddfbfa4592e7a3bb004416edd6240a860656ec809b603349357d3e754a2b5f2a92cb33d0a46259beae86f1c99981e848193f112888982d97cb94b7 lua-hiredis-0.2.1.tar.gz