aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/lua-iconv/APKBUILD55
1 files changed, 38 insertions, 17 deletions
diff --git a/main/lua-iconv/APKBUILD b/main/lua-iconv/APKBUILD
index 8ddbaa2a7c..d778a98832 100644
--- a/main/lua-iconv/APKBUILD
+++ b/main/lua-iconv/APKBUILD
@@ -1,16 +1,19 @@
-# Contributor:
-# Maintainer:
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+_luaversions="5.1 5.2 5.3"
pkgname=lua-iconv
pkgver=7
-pkgrel=0
+pkgrel=1
pkgdesc="Lua binding to the POSIX 'iconv' library"
-url="http://luaforge.net/projects/lua-iconv/"
+url="http://ittner.github.io/lua-iconv/"
arch="all"
license="MIT"
depends=
-makedepends="libiconv-dev lua-dev"
+makedepends=""
+for _i in $_luaversions; do
+ makedepends="$makedepends lua$_i-dev"
+ subpackages="$subpackages lua$_i-iconv:split_${_i/./_}"
+done
install=
-subpackages=
source="https://github.com/downloads/ittner/lua-iconv/lua-iconv-$pkgver.tar.gz
0001-lua-iconv-make-close-available-from-lua.patch"
@@ -18,24 +21,42 @@ _builddir="$srcdir"/$pkgname-$pkgver
prepare() {
cd "$_builddir"
patch -p1 -i "$srcdir"/0001-lua-iconv-make-close-available-from-lua.patch
+ cd "$srcdir"
+ for _i in $_luaversions; do
+ cp -r $_builddir $_i || return 1
+ done
}
build() {
- cd "$_builddir"
- if [ "$ALPINE_LIBC" = "eglibc" ]; then
- LFLAGS="-llua -shared $LDFLAGS"
- else
- LFLAGS="-llua -liconv -shared $LDFLAGS"
- fi
- make CFLAGS="$CFLAGS" LFLAGS="$LFLAGS" || return 1
+ for _i in $_luaversions; do
+ msg "Build for Lua $_i"
+ cd "$srcdir"/$_i
+ make LUAPKG="lua$_i" \
+ CFLAGS="$CFLAGS $(pkg-config lua$_i --cflags)" \
+ || return 1
+ done
}
package() {
- cd "$_builddir"
- # tests fail
- # make DESTDIR="$pkgdir" INSTALL_PATH=/usr/lib/lua/5.1 install
- install -D -s iconv.so "$pkgdir"/usr/lib/lua/5.1/iconv.so
+ cd "$srcdir"
+ for _i in $_luaversions; do
+ install -D -s $_i/iconv.so "$pkgdir"/usr/lib/lua/$_i/iconv.so \
+ || return 1
+ done
}
+_split() {
+ local d=usr/lib/lua _ver=$1
+ pkgdesc="$pkgdesc for Lua $_ver"
+ install_if="lua$_ver $pkgname=$pkgver-r$pkgrel"
+ depends=
+ mkdir -p "$subpkgdir/$d" || return 1
+ mv "$pkgdir/$d/$1" "$subpkgdir/$d"
+}
+
+for _v in $_luaversions; do
+ eval "split_${_v/./_}() { _split $_v; }"
+done
+
md5sums="8a38b4e6ac8a9290093898793d16fe4b lua-iconv-7.tar.gz
88e23691e79f357a6048f226e8ed8e23 0001-lua-iconv-make-close-available-from-lua.patch"