# Maintainer: Will Sinatra <wpsinatra@gmail.com>
# Contributor: Will Sinatra <wpsinatra@gmail.com>
pkgname=cage
pkgver=0.1.5
pkgrel=1
pkgdesc="Wayland Kiosk"
url="https://www.hjdskes.nl/projects/cage/"
license="MIT"
arch="all"
options="!check" # no test suite
depends="xwayland"
makedepends="dbus meson wlroots0.16-dev wayland-protocols scdoc"
subpackages="$pkgname-doc $pkgname-run::noarch"
source="$pkgname-$pkgver.tar.gz::https://github.com/cage-kiosk/cage/archive/refs/tags/v$pkgver.tar.gz
	cage-run
	"

build() {
	abuild-meson \
		-Db_lto=true \
		-Dxwayland=true \
		build
	meson compile -C build
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C build
	install -Dm755 "$srcdir"/cage-run -t "$pkgdir"/usr/bin/
}

run() {
	pkgdesc="$pkgdesc (wrapper for headless CI)"
	depends="$pkgname=$pkgver-r$pkgrel dbus"
	amove usr/bin/cage-run
}

sha512sums="
d50fc5b7efa691e487a05c8e4e573ed441a31840b1742eb1d3b0e827a1da381426f8e9c620de197cf928a99cab57af8a3042f08d5aadd3fc4ddf0c5afadb3231  cage-0.1.5.tar.gz
9f9ee6d7670a9b8f7b6ed2e97d6ee3605ef0b7c9ef4ab006f408d0fa4a63f799ac187933200b1e46811f346469a32eaaf250f5fac219c5d47ef4c31f344ad7bc  cage-run
"
