aboutsummaryrefslogtreecommitdiffstats
path: root/testing/lua-ansicolors/APKBUILD
blob: ec8057507d3f450811fbc300f0fb732913a86c3a (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
# Maintainer: Guilherme Felipe da Silva <gfsilva.eng@gmail.com>
pkgname=lua-ansicolors
_rockname="${pkgname#lua-}"
pkgver=1.0.2
pkgrel=1
pkgdesc="ANSI terminal color manipulation for Lua"
url="https://github.com/kikito/ansicolors.lua"
license="MIT"
arch="all"
makedepends="luarocks"
options="!check" # Test dependencies not available
source="$_rockname-$pkgver.tar.gz::https://github.com/kikito/$_rockname.lua/archive/v$pkgver.tar.gz"
builddir="$srcdir/$_rockname.lua-$pkgver"

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

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

		luarocks-$lver \
		               --deps-mode=none \
		               LUA_INCDIR="$(pkg-config --variable=includedir lua$lver)" \
		               LUA_LIBDIR="$(pkg-config --variable=libdir lua$lver)" \
		               make --tree="./build" \
		               "$_rockname-${pkgver%??}-1.rockspec"

		rm "./build/lib/luarocks/rocks-$lver/manifest"
	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 path; for path in "lib/luarocks/rocks-$lver" "share/lua/$lver"; do
		mkdir -p "$subpkgdir/usr/${path%/*}"
		mv "$builddir/build/$path" "$subpkgdir/usr/$path/"
	done
}
sha512sums="d7052fc63ec09076c0fa940f506fa06ebd210cf590f35310a21c80062cbf062b6d2607c3f89b8dbb39377793e25ea11f471101913e620a7566957e7ed7efbb04  ansicolors-1.0.2.tar.gz"