summaryrefslogtreecommitdiff
path: root/main/lua-lzmq/APKBUILD
blob: 48253608c114772ef9c3bc0fb0335afc86f3f984 (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
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
# TODO: Split C and FFI bindings into subpackages...?
pkgname=lua-lzmq
_pkgname=lzmq
pkgver=0.4.4
pkgrel=5
pkgdesc="Lua bindings to ZeroMQ"
url="https://github.com/zeromq/lzmq"
arch="all"
license="MIT"
makedepends="cmake samurai zeromq-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/zeromq/$_pkgname/archive/v$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"
options="!check"

_luaversions="5.1 5.2 5.3 5.4"
for _v in $_luaversions; do
	makedepends="$makedepends lua$_v-dev"
	subpackages="$subpackages lua$_v-$_pkgname:_package"
done

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

		cmake -B build/$lver -G Ninja \
			-DCMAKE_BUILD_TYPE=MinSizeRel \
			-DCMAKE_INSTALL_PREFIX=/usr \
			-DCMAKE_C_FLAGS="$CFLAGS $(pkg-config --cflags lua$lver)" \
			-DINSTALL_CMOD=/usr/lib/lua/$lver \
			-DINSTALL_LMOD=/usr/share/lua/$lver
		cmake --build build/$lver
	done
}

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

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

	DESTDIR="$subpkgdir" cmake --install "$builddir"/build/$lver
	rm -Rf "$subpkgdir"/usr/share/lzmq

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

sha512sums="
fd7e3e61755ec7e33b631a7fd28a3c34163ee696c5b92c6c271001f2ab5c2e41bca07e11580ba5aa1cd09031ed4f7f0e22f546f0ebcaa29b91598648b86d46fb  lua-lzmq-0.4.4.tar.gz
"