summaryrefslogtreecommitdiff
path: root/community/lua-dbus_proxy/APKBUILD
blob: 537a31dabd7906cb90e22883075937188244ea39 (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
# Maintainer: Olliver Schinagl <oliver@schinagl.nl>
_luaversions="5.1 5.2 5.3"
pkgname="lua-dbus_proxy"
_rockname="${pkgname#lua-*}"
pkgver="0.10.2"
pkgrel=1
pkgdesc="Simple API around GLib's GIO:GDBusProxy built on top of lgi"
url="https://github.com/stefano-m/lua-dbus_proxy"
arch="all"
license="Apache-2.0"
depends="dbus lua-lgi"
subpackages="$pkgname-doc"
makedepends="luarocks gobject-introspection-dev"
options="!check" # Tests require running dbus server to interact with
source="$pkgname-$pkgver.tar.gz::https://github.com/stefano-m/lua-dbus_proxy/archive/v$pkgver.tar.gz"

for _luaversion in ${_luaversions}; do
	makedepends="$makedepends lua$_luaversion-dev"
	subpackages="$subpackages lua$_luaversion-${_rockname}:_subpackage"
done

build() {
	for _luaversion in ${_luaversions}; do
		msg "Building for Lua $_luaversion"
		"luarocks-$_luaversion" \
			CC="$CC" \
			CFLAGS="$CFLAGS -fPIC" \
			LUA_INCDIR="$(pkg-config --variable=includedir "lua$_luaversion")" \
			LUA_LIBDIR="$(pkg-config --variable=libdir "lua$_luaversion")" \
			LUA_VERSION="$_luaversion" \
			make --tree="./build-$_luaversion" \
			--deps-mode=none \
			"rockspec/$_rockname-$pkgver-"*".rockspec"
	done
}

package() {
	mkdir -p "$pkgdir/usr/share/doc/$pkgname/"
	cp -r "docs/" "$pkgdir/usr/share/doc/$pkgname/"
}

_subpackage() {
	_luaversion="${subpkgname%-${_rockname}}"
	_luaversion="${_luaversion#lua*}"
	pkgdesc="$pkgdesc - for Lua $_luaversion"
	depends="$depends lua$_luaversion"
	install_if="lua$_luaversion $pkgname=$pkgver-r$pkgrel"

	for _luascript in "$builddir/build-$_luaversion/share/lua/$_luaversion/$_rockname/"*.lua; do
		install -D -m 0644 \
			-t "$subpkgdir/usr/share/lua/$_luaversion/$_rockname" \
			"$_luascript"
	done
}

sha512sums="
e09f8702a1e72eaa43754e98e30f05626670993f3570a0810de0c31944921e182c2579edae698a4fe7ac9b9fdb4c348301409699b02ee5526c4e7cabda966cb9  lua-dbus_proxy-0.10.2.tar.gz
"