# Contributor: fossdd <fossdd@pwned.life>
# Maintainer: fossdd <fossdd@pwned.life>
pkgname=gtk4-layer-shell
pkgver=1.0.4
pkgrel=1
pkgdesc="Library to create desktop components for Wayland using the Layer Shell protocol and GTK4"
url="https://github.com/wmww/gtk4-layer-shell"
arch="all"
license="MIT"
makedepends="
	meson
	gtk4.0-dev
	gobject-introspection-dev
	vala
	"
checkdepends="
	font-dejavu
	luajit
	python3
	xvfb-run
	"
subpackages="$pkgname-dev $pkgname-demo $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/wmww/gtk4-layer-shell/archive/refs/tags/v$pkgver.tar.gz"
options="!check" # tests fail

build() {
	abuild-meson \
		-Dtests="$(want_check && echo true || echo false)" \
		-Dexamples=true \
		. output
	meson compile -C output
}

check() {
	XDG_RUNTIME_DIR="$(mktemp -d -p "$builddir")" \
		xvfb-run -a \
		meson test --no-rebuild --print-errorlogs -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output

	install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}

demo() {
	pkgdesc="Demo of GTK4 Layer Shell"

	amove usr/bin/gtk4-layer-demo
}

sha512sums="
bd849f4e79810b88c502bcaf8afa497ab9a117e3045c250679418fd78e6293359ecb3b5b527ef74f3f6c30c9743de1c5b9fc0a179593b2fe4fe153980d02a4f5  gtk4-layer-shell-1.0.4.tar.gz
"
