aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-lyaml/APKBUILD
blob: adda5f35c2ddf2a47871b98b7f3fe5fe49e7e951 (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
47
48
49
50
51
52
53
54
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
_pkgname=lyaml
pkgname=lua-$_pkgname
pkgver=6.2
pkgrel=3
pkgdesc="LibYAML binding for Lua"
url="https://github.com/gvvaughan/lyaml"
arch="all"
license="MIT"
depends=""
makedepends="yaml-dev"
subpackages=""
replaces="lua-yaml"
source="$_pkgname-$pkgver.tar.gz::https://github.com/gvvaughan/lyaml/archive/v$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

_luaversions="5.1 5.2 5.3"
for _v in $_luaversions; do
	makedepends="$makedepends lua$_v-dev"
	subpackages="$subpackages lua$_v-$_pkgname:_subpackage"
done

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

		cp -r "$builddir" "$srcdir"/build-$lver
		cd "$srcdir"/build-$lver
		lua$lver build-aux/luke
	done
}

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

_subpackage() {
	local lver="${subpkgname%-lyaml}"
	lver=${lver#lua}
	pkgdesc="$pkgdesc $lver"
	depends="lua$lver lua$lver-stdlib-normalize"
	install_if="$pkgname=$pkgver-r$pkgrel lua$lver"
	local rockdir="$subpkgdir/usr/lib/luarocks/rocks-$lver/$_pkgname/$pkgver-1"

	cd "$srcdir"/build-$lver

	lua$lver build-aux/luke PREFIX="$subpkgdir"/usr install
	rm -Rf "$subpkgdir"/usr/share/doc

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

sha512sums="357a89f096decb8b6ad89c2b0ffd93c27d424a9a2ba65f48370c585f7ffeff3f41addc3fe8785b3d8e81405a6f08a3855c4d8ba9d641b1f551fab269c3e87b51  lyaml-6.2.tar.gz"