aboutsummaryrefslogtreecommitdiffstats
path: root/community/lua-copas/APKBUILD
blob: d8b8e853c4f5ba082240a986ac5c9293249c3831 (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
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=lua-copas
_pkgname=copas
pkgver=2.0.2
_pkgver=${pkgver//./_}
pkgrel=1
pkgdesc="Coroutine Oriented Portable Asynchronous Services for Lua"
url="http://keplerproject.github.io/copas/"
arch="noarch"
license="MIT"
depends="lua-socket"
checkdepends="lua5.1-coxpcall lua-sec"
subpackages=""
source="$pkgname-$pkgver.tar.gz::https://github.com/keplerproject/$_pkgname/archive/v$_pkgver.tar.gz
	ipv4-only.patch"
builddir="$srcdir/$_pkgname-$_pkgver"

# luajit is not available on s390x
# XXX: tests/largetransfer.lua segfaults on ppc64le LuaJIT
case "$CARCH" in
	s390x | ppc64le) _luajit="";;
	*) checkdepends="$checkdepends luajit" _luajit="jit";;
esac

_luaversions="5.1 5.2 5.3"
for _v in $_luaversions; do
	subpackages="$subpackages lua$_v-$_pkgname:_subpackage"
	checkdepends="$checkdepends lua$_v"
done

check() {
	cd "$builddir"

	local lver; for lver in $_luaversions $_luajit; do
		msg "Testing on lua$lver"
		make test LUA=lua$lver
	done
}

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

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

	cd "$builddir"
	make LUA_DIR="$subpkgdir/usr/share/lua/$lver" install

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

sha512sums="dd83a513fbddb2f0164c3573b417623f5cc556413c4937be7e362f4c1667bad83391143e1bf609480726730ce488c4080e810f2ce12a98a7abb5293993c10182  lua-copas-2.0.2.tar.gz
4fb2b65f41869b9729cc4672eebbfb2745a2d01af1cd54341b8306f57510f98e118eac77c77a980f4c8e8b181b6fda150061dc39819269e9ee64bf07656dfd54  ipv4-only.patch"