aboutsummaryrefslogtreecommitdiffstats
path: root/testing/lua-linenoise/APKBUILD
blob: 53a7b4b87858a7a47d8e148fa8b27b85a70b8260 (plain) (blame)
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
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=lua-linenoise
pkgver=0.9
pkgrel=0
pkgdesc="Lua bindings for linenoise"
url="https://github.com/hoelzro/lua-linenoise"
arch="all"
license="MIT"
makedepends="linenoise-dev"
source="lua-linenoise-$pkgver.tar.gz::https://github.com/hoelzro/lua-linenoise/archive/$pkgver.tar.gz"

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

build() {
	for _v in $_luaversions; do
		msg "Lua $_v"
		cp -r "$builddir" "$srcdir"/build-$_v
		make -C "$srcdir"/build-$_v \
			LIBLINENOISE="-l linenoise" \
			CFLAGS="-fPIC $CFLAGS $(pkg-config --cflags lua$_v)"
	done
}

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

_subpackage() {
	local lua="${subpkgname%-*}"
	local lver=${lua#lua}
	pkgdesc="$pkgdesc (for Lua ${lver})"
	depends="$lua"
	install_if="$pkgname=$pkgver-r$pkgrel $lua"

	install -m 644 -D "$srcdir"/build-$lver/linenoise.so \
		"$subpkgdir"/usr/lib/lua/$lver/linenoise.so
}

sha512sums="24cecd36329f74f36026c81afe1b7a9a3213d35c9cdc433e21f45bc4867be9537d61807ecb7344d789585a80a06c4f4d2de2412aab130e84adf817b56ecd0ea5  lua-linenoise-0.9.tar.gz"