Commit 15f1b80a authored by Natanael Copa's avatar Natanael Copa

main/lua-filesystem: build for both lua 5.1 and 5.2

parent 36ba6779
# Maintainer: Natanael Copa <ncopa@alpinelinux.org> # Maintainer: Natanael Copa <ncopa@alpinelinux.org>
_luaversions="5.1 5.2"
_defaultlua="5.1"
pkgname=lua-filesystem pkgname=lua-filesystem
pkgver=1.6.2 pkgver=1.6.2
pkgrel=0 pkgrel=1
pkgdesc="Lua library to complement the set of functions related to file systems" pkgdesc="Filesystem functions for Lua"
url="http://www.keplerproject.org/luafilesystem/" url="http://www.keplerproject.org/luafilesystem/"
arch="all" arch="all"
license="GPL" license="GPL"
depends= depends="lua$_defaultlua-filesystem"
makedepends="lua-dev wget"
install= install=
subpackages=
makedepends=""
subpackages=""
for _i in $_luaversions; do
makedepends="$makedepends lua$_i-dev"
subpackages="$subpackages lua$_i-filesystem:split_${_i/./_}"
done
source="https://github.com/downloads/keplerproject/luafilesystem/luafilesystem-$pkgver.tar.gz" source="https://github.com/downloads/keplerproject/luafilesystem/luafilesystem-$pkgver.tar.gz"
_builddir="$srcdir"/luafilesystem-$pkgver _sdir="$srcdir"/luafilesystem-$pkgver
prepare() { prepare() {
cd "$_builddir" cd "$_sdir"
# apply patches here # apply patches here
cd "$srcdir"
for _i in $_luaversions; do
cp -r "$_sdir" "$srcdir"/build-$_i
done
} }
build() { build() {
cd "$_builddir" for _i in $_luaversions; do
make || return 1 cd "$srcdir"/build-$_i
make CFLAGS="$CFLAGS $( pkg-config lua$_i --cflags ) -fPIC" \
|| return 1
done
} }
package() { package() {
cd "$_builddir" for _i in $_luaversions; do
make LUA_LIBDIR="$pkgdir"/usr/lib/lua/5.1 install cd "$srcdir"/build-$_i
make LUA_LIBDIR="$pkgdir"/usr/lib/lua/$_i install \
|| return 1
done
} }
_split() {
local d= _ver=$1
pkgdesc="Filesystem functions for Lua $_ver"
for d in usr/lib/lua usr/share/lua; do
if [ -d "$pkgdir"/$d/$_ver ]; then
mkdir -p "$subpkgdir"/$d
mv "$pkgdir"/$d/$_ver "$subpkgdir"/$d/ || return 1
fi
done
}
split_5_1() { _split 5.1; }
split_5_2() { _split 5.2; }
md5sums="4e7ec93678c760c4e42cea7d28aafa13 luafilesystem-1.6.2.tar.gz" md5sums="4e7ec93678c760c4e42cea7d28aafa13 luafilesystem-1.6.2.tar.gz"
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