aboutsummaryrefslogtreecommitdiffstats
path: root/community/lua-lunix/APKBUILD
blob: 77609cdca84e94af8a2fa433f881ccc17e0b24ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
_luaversions="5.1 5.2 5.3"
pkgname=lua-lunix
_pkgname=lunix
pkgver=20190403
pkgrel=0
pkgdesc="Comprehensive Unix API Module for Lua"
url="https://github.com/wahern/lunix"
arch="all"
license="MIT"
depends=""
makedepends=""
subpackages=""
for _v in $_luaversions; do
	makedepends="$makedepends lua$_v-dev"
	subpackages="$subpackages lua$_v-$_pkgname:_package"
done
source="https://github.com/wahern/lunix/archive/rel-$pkgver/$pkgname-$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-rel-$pkgver"

build() {
	local lver; for lver in $_luaversions; do
		msg "Building for Lua $lver..."
		make all$lver
	done
}

package() {
	mkdir -p "$pkgdir"
}

_package() {
	local lver="${subpkgname:3:3}"
	pkgdesc="$pkgdesc $lver"
	install_if="lua$lver $pkgname=$pkgver-r$pkgrel"
	local rockdir="$subpkgdir/usr/lib/luarocks/rocks-$lver/$_pkgname/$pkgver-1"

	cd "$builddir"
	make prefix="/usr" DESTDIR="$subpkgdir" install$lver

	mkdir -p "$rockdir"
	echo 'rock_manifest = {}' > "$rockdir"/rock_manifest
}

sha512sums="f432284896f00c787993bbe79da871b3a903518641adba2d36e7ebdbdadcf2fa18acda0b7c0823d994a9e012436955f8feed6901bc03aed1f090a67ffd555772  lua-lunix-20190403.tar.gz"