Commit 8b2ccf4e authored by Natanael Copa's avatar Natanael Copa

main/lua-iconv: add Lua 5.2/5.3 support

parent 116be0fb
# 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"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment