aboutsummaryrefslogtreecommitdiffstats
path: root/community/lua-copas/APKBUILD
blob: 1555011e0f9010c3d51516f6b7ac8ad90ccc320e (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
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=lua-copas
_pkgname=copas
pkgver=2.0.2
_pkgver=${pkgver//./_}
pkgrel=2
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
	default-tls1.2.patch
	test-certs.patch
	ipv4-only.patch
	skip-broken-test.patch"
builddir="$srcdir/$_pkgname-$_pkgver"

# luajit is not available on s390x
# XXX: tests/largetransfer.lua segfaults on ppc64le LuaJIT
# on aarch64: luajit: bad light userdata pointer
case "$CARCH" in
	s390x | ppc64le | aarch64) _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"

	# tests keep running indefinitely
	case "$CARCH" in armv7) return 0;; esac

	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
d65a2d26ff025ec4b7c652bdf179a9f18078f736ec8f9166df077a47ec34cc4731cdeaa984d25c9556f332b36bfd9b4a7e2069284f8b63a4344e8a81b5ad72bc  default-tls1.2.patch
f775cda7762f7924be8794ea2c77eb49740741a3cf9f67ca7b7e7563868d51f386ed473833e40b673af3aee5660a5e4767f43522bda1e0c38b2bf07c9df183df  test-certs.patch
4fb2b65f41869b9729cc4672eebbfb2745a2d01af1cd54341b8306f57510f98e118eac77c77a980f4c8e8b181b6fda150061dc39819269e9ee64bf07656dfd54  ipv4-only.patch
f661d6b5651496174d04bb26357ab37180b949d5c3a50d67fb090152ee3c63e37eda72754d8d6f2a84351569f74a2088ef4588e9f313583baec5057d11cc7170  skip-broken-test.patch"