aboutsummaryrefslogtreecommitdiffstats
path: root/testing/lua-lcurses/APKBUILD
blob: d9be8ce239fa10a25deabbe99866643fa17aabac (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
69
70
71
72
73
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=lua-lcurses
_rockname=${pkgname#lua-}
pkgver=9.0.0
pkgrel=0
pkgdesc="Lua bindings for Curses"
url="https://lcurses.github.io/lcurses"
arch="all"
license="MIT"
depends="lua"
makedepends="autoconf automake libtool ncurses-dev"
subpackages=""
options="!check"  # FIXME requires lua-specl that we don't have yet
source="$pkgname-$pkgver.tar.gz::https://github.com/lcurses/$_rockname/archive/release-v$pkgver.tar.gz
	bootstrap.patch"
builddir="$srcdir/$_rockname-release-v$pkgver"

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

prepare() {
	default_prepare

	cd "$builddir"
	./bootstrap --skip-git

	local lver; for lver in $_luaversions; do
		cp -r "$builddir" "$builddir-$lver"
	done
}

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

		cd "$builddir-$lver"
		./configure \
			--build=$CBUILD \
			--host=$CHOST \
			--prefix=/usr \
			LUA=lua$lver \
			LUA_INCLUDE=$(pkg-config --cflags-only-I lua$lver)
		make
	done
}

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

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

	cd "$builddir-$lver"
	make DESTDIR="$subpkgdir" install

	rm -r "$subpkgdir"/usr/share/doc

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

sha512sums="4c6b4cf95f1ec91ac7c990c102c7e25716bb8083a25cc03812df04466dff4717d46fcabebdc37abc2596245ef3b072821294368d8a060db72f3c7922938c8371  lua-lcurses-9.0.0.tar.gz
b9d861ba7aa66d16a92bc3f5086daecfc26d150e7aa787ffbf13cf0bd09eba00e602c509010d4942a25f186857abbbe85ae76f7bae5f1dc7fb43d376e0656cc0  bootstrap.patch"