aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-yaml/APKBUILD
blob: 3f3a621d6eb0fad3cbbca0728220bb4ed6568170 (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
64
65
66
67
68
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=lua-yaml
_pkgname=yaml
pkgver=1.1.2
pkgrel=1
pkgdesc="LibYaml binding for Lua"
url="http://yaml.luaforge.net"
arch="all"
license="MIT"
depends=""
makedepends="cmake yaml-dev"
subpackages=""
source="$pkgname-$pkgver.tar.gz::https://github.com/lubyk/$_pkgname/archive/REL-$pkgver.tar.gz
	cmake.patch"
builddir="$srcdir/$_pkgname-REL-$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 -p "$builddir"/build/$lver
		cd "$builddir"/build/$lver

		cmake \
			-DCMAKE_C_FLAGS="$CFLAGS -Wall -DNDEBUG $(pkg-config --cflags lua$lver)" \
			-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
			-DCMAKE_SKIP_RPATH=TRUE \
			-DCMAKE_VERBOSE_MAKEFILE=TRUE \
			-DLUA_INSTALL_DIR=/usr/share/lua/$lver \
			-DLUA_INSTALL_BINDIR=/usr/lib/lua/$lver \
			"$builddir" || return 1
		make || return 1
	done
}

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

_subpackage() {
	local lver="${subpkgname:3:3}"
	local rockdir="$subpkgdir/usr/lib/luarocks/rocks-$lver/$_pkgname/$pkgver-1"
	pkgdesc="$pkgdesc $lver"
	depends="$depends lua$lver lua$lver-lub"
	install_if="$pkgname=$pkgver-r$pkgrel lua$lver"
	[ "$lver" = 5.1 ] && replaces="$pkgname"

	cd "$builddir"/build/$lver
	make DESTDIR="$subpkgdir" install

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

md5sums="6665b0c82da0edae184b8a32be7518b5  lua-yaml-1.1.2.tar.gz
44294987c54623c6a5b013ba7ebb5c58  cmake.patch"
sha256sums="b4391d182677ab644403bf1ac028c7421c2605db124f9792193013c582a273ec  lua-yaml-1.1.2.tar.gz
b898249d2dbeff2152b84ba46c94571c058a3b9339db1683de69cb6161575715  cmake.patch"
sha512sums="9d2ff4ddc243922f11c2ebea1d45bb3fa02e96a30752c04e65aec236e76780780511fe605a7a0bdbe9764189764a3951aadff8bb028c402571fd052cd70e35ac  lua-yaml-1.1.2.tar.gz
db024b2acfa88441a4a72ec9c2a42d0980465cd759815474f02e3912ca458d913317aacdecf911e4048d43bab7878f472ce044f57dac3df66d20752e1255a8a8  cmake.patch"