# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=sysprof
pkgver=47.2
pkgrel=0
pkgdesc="System-wide profiler for Linux"
url="http://www.sysprof.com/"
arch="all"
license="GPL-2.0-or-later"
depends_dev="$pkgname=$pkgver-r$pkgrel" # sysprof's lib setup is a bit weird...
makedepends="
	desktop-file-utils
	elogind-dev
	glib-dev
	gtk4.0-dev
	itstool
	json-glib-dev
	libadwaita-dev
	libdex-dev
	libpanel-dev
	libunwind-dev
	meson
	polkit-dev
	"
#options="!check" # test-model-filter fails
subpackages="$pkgname-static $pkgname-dev $pkgname-doc $pkgname-lang"
source="https://download.gnome.org/sources/sysprof/${pkgver%.*}/sysprof-$pkgver.tar.xz"

build() {
	abuild-meson \
		-Dgtk=true \
		-Dsystemdunitdir=systemd \
		. output
	meson compile -C output
}

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

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
	rm -rf "$pkgdir"/usr/systemd
}

sha512sums="
3673b8035ba115f581c3d4d881a6ac99f15d96d461f5d0824d727cfb504ae41363c5b5e0fc117acd202b203c251bb514e53307799c1dbea1d2b0d320ed2fd104  sysprof-47.2.tar.xz
"
