aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-lyaml/APKBUILD
blob: f0b1671c561c782aeae7aed0da9227d9a840d9a9 (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
55
56
57
58
59
60
61
62
63
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
_pkgname=lyaml
pkgname=lua-$_pkgname
pkgver=6.1
pkgrel=1
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/$_pkgname/archive/release-v$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-release-v$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..."

		mkdir "$builddir"/build-$lver
		cd "$builddir"/build-$lver

		LUA="lua$lver" \
		LUA_INCLUDE="$(pkg-config --cflags lua$lver)" \
		../configure \
			--build=$CBUILD \
			--host=$CHOST \
			--prefix=/usr \
			--sysconfdir=/etc \
			--mandir=/usr/share/man \
			--infodir=/usr/share/info \
			--localstatedir=/var \
			|| return 1
		make || return 1
	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"

	cd "$builddir"/build-$lver

	make DESTDIR="$subpkgdir" install || return 1
	rm -Rf "$subpkgdir"/usr/share/doc
}

md5sums="e11c2bf29b539674dfc5b4a094550dc5  lua-lyaml-6.1.tar.gz"
sha256sums="7063e50dfcee25f87f1a29fc2d75d12e5d8fd83522a99936d51841c3f374851a  lua-lyaml-6.1.tar.gz"
sha512sums="0730001fcd171f88a8fe8917f9fb8c403d5d7461dda8dfee73a555ac7899dc6c6042fda1ce0e69bb335ba0930ff650763a3e15b363ce61832bb3bb838de22bd6  lua-lyaml-6.1.tar.gz"