aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-cqueues/APKBUILD
blob: 070eec6593d66ca9b8033ea5c4ce39bb2feb9a29 (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
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
_luaversions="5.1 5.2 5.3"
pkgname=lua-cqueues
pkgver=20150119
pkgrel=0
pkgdesc="Lua event loop using coroutines"
url="http://25thandclement.com/~william/projects/cqueues.html"
arch="all"
license="MIT"
depends=""
depends_dev=""
subpackages=""
makedepends="$depends_dev openssl-dev m4 bsd-compat-headers"
install=""
source="http://25thandclement.com/~william/projects/releases/cqueues-$pkgver.tgz"

for _i in $_luaversions; do
	makedepends="$makedepends lua${_i}-dev"
	subpackages="$subpackages lua${_i}-cqueues:_split_${_i/./}"
done

_builddir="$srcdir"/cqueues-$pkgver
prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	cd "$_builddir"
	for _i in $_luaversions; do
		msg "Build for Lua $_i"
		make all${_i} || return 1
	done
}

package() {
	cd "$_builddir"
	for _i in $_luaversions; do
		msg "Install for Lua $_i"
		make DESTDIR="$pkgdir" prefix=/usr install${_i} || return 1
	done
	rm -f "$pkgdir"/usr/lib/*.la
}

_split() {
	local d= _ver=$1
	pkgdesc="$pkgdesc - for Lua $_ver"
	depends=
	install_if="lua$_ver $pkgname=$pkgver-r$pkgrel"
	for d in usr/lib/lua usr/share/lua; do
		if [ -d "$pkgdir"/$d/$_ver ]; then
			mkdir -p "$subpkgdir"/$d
			mv "$pkgdir"/$d/$_ver "$subpkgdir"/$d/ || return 1
		fi
	done
}

for _i in $_luaversions; do
	eval "_split_${_i/./}() { _split $_i; }"
done


md5sums="9d4a566f86265a8270186f587789aadf  cqueues-20150119.tgz"
sha256sums="70a7072c36fb9663f04825cc7a5773a928ad3101849f5f7754698982e41c2142  cqueues-20150119.tgz"
sha512sums="603b5d93f5db05d09cfcc2be72cf01bd89830134e1a163ad9023b93cf484a7f5c84cbe3a734ec336cb0cc34a91eb51b29bea1b3d46d415d5668a507a98dbb46e  cqueues-20150119.tgz"