# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Luca Weiss <luca@lucaweiss.eu>
pkgname=openrc-settingsd
pkgver=1.5.0
pkgrel=0
pkgdesc="System settings D-Bus service for OpenRC"
url="https://gitlab.com/postmarketOS/openrc-settingsd"
arch="all"
license="GPL-2.0-or-later"
depends="tzdata"
makedepends="
	dbus-dev
	glib-dev
	libdaemon-dev
	meson
	openrc-dev
	polkit-dev
	"
install="$pkgname.post-install $pkgname.post-upgrade"
subpackages="$pkgname-doc $pkgname-openrc"
source="https://gitlab.com/postmarketOS/openrc-settingsd/-/archive/v$pkgver/openrc-settingsd-v$pkgver.tar.gz"
builddir="$srcdir/$pkgname-v$pkgver"

build() {
	abuild-meson \
		-Denv-update= \
		. output
	meson compile -C output
}

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

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
	# Remove dbus service files to avoid auto-launch.
	# The user is expected to start the service with openrc instead.
	rm -rv "$pkgdir"/usr/share/dbus-1/system-services
}

sha512sums="
e7fc02f9d888a174e4034f0cfe45ac562a2579882f81e9fe7f18cf7b24737f4e52c1e4ad423f7bb400527ca77df9addd97b357ae90ba7eb46982576945913204  openrc-settingsd-v1.5.0.tar.gz
"
