# Contributor: Adam Plumb <adamplumb@gmail.com>
# Maintainer: Steven Guikal <void@fluix.one>
pkgname=libadwaita
pkgver=1.5.3
pkgrel=0
pkgdesc="Building blocks for modern GNOME applications"
url="https://gitlab.gnome.org/GNOME/libadwaita"
arch="all"
license="LGPL-2.1-or-later"
makedepends="
	appstream-dev
	fribidi-dev
	glib-dev
	gobject-introspection-dev
	gtk4.0-dev
	meson
	sassc
	vala
	"
# Tests need any font
checkdepends="
	dbus
	font-dejavu
	mesa-dri-gallium
	xvfb-run
	"
subpackages="$pkgname-dbg $pkgname-dev $pkgname-lang $pkgname-demo"
source="https://gitlab.gnome.org/GNOME/libadwaita/-/archive/$pkgver/libadwaita-$pkgver.tar.gz"

build() {
	CFLAGS="$CFLAGS -g1" \
	CPPFLAGS="$CPPFLAGS -g1" \
	abuild-meson \
		-Db_lto=true \
		-Dexamples=true \
		-Dgtk_doc=false \
		. output
	meson compile -C output
}

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

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

demo() {
	pkgdesc="$pkgdesc (libadwaita demo)"
	amove usr/share usr/bin
}

sha512sums="
62314def3f1daf57f6a6cab5c2bf5c201c7f2312ad4ad15cc6ac75925599fa6d8c874885cbf73b499475c2a21ffa2ac759784172592863017c8c7eef754c0745  libadwaita-1.5.3.tar.gz
"
