diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2020-02-05 10:48:44 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2020-02-05 10:49:32 +0000 |
commit | 59dce43224343dc7e5c069c01a519503d56f9f4e (patch) | |
tree | 482e84674f33715f511db97fafa855c18749d8bb /testing/lua-psl | |
parent | d26ed17b92f5355f86d5ea407bbc30bb44e8fb99 (diff) | |
download | aports-59dce43224343dc7e5c069c01a519503d56f9f4e.tar.bz2 aports-59dce43224343dc7e5c069c01a519503d56f9f4e.tar.xz |
testing/lua-psl: new aport
Lua binding to libpsl
https://github.com/daurnimator/lua-psl
fixes #11180
Diffstat (limited to 'testing/lua-psl')
-rw-r--r-- | testing/lua-psl/APKBUILD | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/testing/lua-psl/APKBUILD b/testing/lua-psl/APKBUILD new file mode 100644 index 0000000000..7c42adab37 --- /dev/null +++ b/testing/lua-psl/APKBUILD @@ -0,0 +1,48 @@ +# Maintainer: Natanael Copa <ncopa@alpinelinux.org> +_luaversions="5.1 5.2 5.3" +pkgname=lua-psl +pkgver=0.3 +pkgrel=0 +pkgdesc="Lua binding to libpsl" +url="https://github.com/daurnimator/lua-psl" +arch="all" +license="MIT" +makedepends="libpsl-dev luarocks" +for _i in $_luaversions; do + makedepends="$makedepends lua$_i-dev" + subpackages="$subpackages lua$_i-psl:_package" +done +source="$pkgname-$pkgver.tar.gz::https://github.com/daurnimator/lua-psl/archive/v$pkgver.tar.gz" +builddir="$srcdir/lua-psl-$pkgver" + +build() { + cd "$builddir" + + local lver; for lver in $_luaversions; do + msg "Building for Lua $lver" + mkdir -p $lver + # no makefile, only rocksfile so compile the single .c by hand + echo " [CC] $lver/psl.so" + ${CC:-gcc} $(pkg-config --cflags libpsl lua$lver) -shared -o $lver/psl.so psl/psl.c + done +} + +package() { + mkdir -p "$pkgdir" + local lver; for lver in $_luaversions; do + install -Dm755 $lver/psl.so "$pkgdir"/usr/lib/lua/$lver/psl.so + done +} + +_package() { + local lver=${subpkgname:3:3} + pkgdesc="$pkgdesc - for Lua $lver" + depends="lua$lver" + install_if="lua$lver $pkgname=$pkgver-r$pkgrel" + local rockdir="$subpkgdir/usr/lib/luarocks/rocks-$lver/$pkgname/$pkgver-0" + mkdir -p "$rockdir" "$subpkgdir"/usr/lib/lua/ + mv "$pkgdir"/usr/lib/lua/$lver "$subpkgdir"/usr/lib/lua/ + echo 'rock_manifest = {}' > "$rockdir"/rock_manifest +} + +sha512sums="b77806f6deb4c668a7ce97583b41297494ef91a05a0f44041d17b52ef6542180f332169577195159bba554a0909fed697bd5f6e5e4de9174273b54739554f79f lua-psl-0.3.tar.gz" |