mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-04-02 12:22:43 +02:00
71 lines
1.9 KiB
Plaintext
71 lines
1.9 KiB
Plaintext
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
|
|
pkgname=lua-filesystem
|
|
_pkgname=luafilesystem
|
|
pkgver=1.8.0
|
|
_pkgver=${pkgver//./_}
|
|
_rockver=${pkgver%.*}-${pkgver##*.}
|
|
pkgrel=5
|
|
pkgdesc="Filesystem functions for Lua"
|
|
url="https://lunarmodules.github.io/luafilesystem/"
|
|
arch="all"
|
|
license="MIT"
|
|
source="$_pkgname-$pkgver.tar.gz::https://github.com/lunarmodules/$_pkgname/archive/v$_pkgver.tar.gz
|
|
lua5.5.patch
|
|
"
|
|
builddir="$srcdir/$_pkgname-$_pkgver"
|
|
|
|
_luaversions="5.1 5.2 5.3 5.4 5.5"
|
|
[ -n "$BOOTSTRAP" ] && _luaversions="5.5"
|
|
for _v in $_luaversions; do
|
|
makedepends_host="$makedepends_host lua$_v-dev"
|
|
subpackages="$subpackages lua$_v-${pkgname#lua-}:_subpackage"
|
|
done
|
|
|
|
prepare() {
|
|
default_prepare
|
|
|
|
local lver; for lver in $_luaversions; do
|
|
cp -r "$builddir" "$builddir-$lver"
|
|
done
|
|
}
|
|
|
|
build() {
|
|
local lver; for lver in $_luaversions; do
|
|
msg "Building for Lua $lver..."
|
|
make -C "$builddir-$lver" CC="$CC" \
|
|
CFLAGS="$CFLAGS $(pkg-config lua$lver --cflags) -fPIC"
|
|
done
|
|
}
|
|
|
|
check() {
|
|
local lver; for lver in $_luaversions; do
|
|
msg "Testing on lua$lver"
|
|
|
|
cd "$builddir-${lver/jit/5.1}"
|
|
LUA_CPATH="./src/?.so" lua$lver tests/test.lua
|
|
done
|
|
}
|
|
|
|
package() {
|
|
mkdir -p "$pkgdir"
|
|
}
|
|
|
|
_subpackage() {
|
|
local lver="${subpkgname:3:3}"
|
|
pkgdesc="$pkgdesc $lver"
|
|
depends="lua$lver"
|
|
install_if="$pkgname=$pkgver-r$pkgrel lua$lver"
|
|
local install_cmod=$(PKG_CONFIG_SYSROOT_DIR= pkg-config --variable=INSTALL_CMOD lua$lver)
|
|
local rockdir="$subpkgdir/usr/lib/luarocks/rocks-$lver/$_pkgname/$_rockver"
|
|
|
|
make -C "$builddir-$lver" LUA_LIBDIR="$subpkgdir/$install_cmod" install
|
|
|
|
mkdir -p "$rockdir"
|
|
echo 'rock_manifest = {}' > "$rockdir"/rock_manifest
|
|
}
|
|
|
|
sha512sums="
|
|
79d964f13ae43716281dc8521d2f128b22f2261234c443e242b857cfdf621e208bdf4512f8ba710baa113e9b3b71e2544609de65e2c483f569c243a5cf058247 luafilesystem-1.8.0.tar.gz
|
|
6a70958e4b14f827a674157970eb5c41639362ec146390cfab24f01543632225061a3d6c201c3e378020e32ef9f55ec54133beb26722ee6a4a86061b6daabad2 lua5.5.patch
|
|
"
|