# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=libnma
pkgver=1.10.6
pkgrel=2
pkgdesc="NetworkManager GUI client library"
url="https://wiki.gnome.org/Projects/NetworkManager/"
arch="all"
license="LGPL-2.1-or-later"
depends="mobile-broadband-provider-info"
makedepends="
	gcr4-dev
	glib-dev
	gobject-introspection-dev
	gtk+3.0-dev
	gtk4.0-dev
	iso-codes-dev
	meson
	networkmanager-dev
	vala
	"
subpackages="$pkgname-dev $pkgname-lang"
source="https://download.gnome.org/sources/libnma/${pkgver%.*}/libnma-$pkgver.tar.xz"

build() {
	abuild-meson \
		-Db_lto=true \
		-Dlibnma_gtk4=true \
		-Dgtk_doc=false \
		. output
	meson compile -C output
}

check() {
	meson test --print-errorlogs --no-rebuild -C output
}

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

	# in network-manager-applet
	rm "$pkgdir"/usr/share/glib-2.0/schemas/org.gnome.nm-applet.gschema.xml
}

sha512sums="
4801db35a8d510c651fc91da4f394a665a4ba5c35fbefe0496363c404b49d5f4e103f49084220ee58b995684d2ac93643320b7d1777ebeea555e7657768a1f6a  libnma-1.10.6.tar.xz
"
