# Forked from Alpine for systemd support
# Co-Maintainer: Pablo Correa Gomez <pabloyoyoista@postmarketos.org>
# Co-Maintainer: Achill Gilgenast <achill@achill.org>
maintainer="Newbyte <newbyte@postmarketos.org>"
pkgname=gnome-settings-daemon
_pkgver=48.1
pkgver=9999$_pkgver
pkgrel=1
pkgdesc="GNOME settings daemon"
url="https://gitlab.gnome.org/GNOME/gnome-settings-daemon"
# armhf: pmb#2618
arch="all !armhf"
options="!check" # tests fail on builders
license="GPL-2.0-only AND LGPL-2.1-only"
depends="pulseaudio"
depends_dev="
	alsa-lib-dev
	colord-dev
	cups-dev
	geoclue-dev
	geocode-glib-dev>=3.26.4-r1
	lcms2-dev
	libcanberra-dev
	libgweather4-dev
	libnotify-dev
	libwacom-dev
	modemmanager-dev
	networkmanager-dev
	nss-dev
	pango-dev
	polkit-dev
	pulseaudio-dev
	systemd-dev
	upower-dev
	"
makedepends="
	$depends_dev
	coreutils
	gcr4-dev
	glib-dev
	gnome-desktop-dev
	gsettings-desktop-schemas-dev
	gtk+3.0-dev
	libxml2-utils
	meson
	"
# checkdepends="
# 	gnome-session
# 	gnome-shell
# 	py3-dbusmock
# 	py3-gobject3
# 	umockdev-dev
# 	"
subpackages="
	$pkgname-dev
	$pkgname-lang
	$pkgname-systemd
	"
_gvc_commit="47c47a423ff2f55bb038d92517e4782cf051496a"
source="https://download.gnome.org/sources/gnome-settings-daemon/${_pkgver%.*}/gnome-settings-daemon-$_pkgver.tar.xz
	https://gitlab.gnome.org/GNOME/libgnome-volume-control/-/archive/$_gvc_commit/libgnome-volume-control-$_gvc_commit.tar.gz
	"
builddir="$srcdir/gnome-settings-daemon-$_pkgver"

build() {
	rm -rf "$builddir/subprojects/gvc"
	mv "$srcdir/libgnome-volume-control-$_gvc_commit" $builddir/subprojects/gvc
	abuild-meson \
		-Db_lto=true \
		-Dsystemd=true \
		. output
	meson compile -C output
}

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

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

sha512sums="
b4ce4fe5a2a6b9dcdc3a82f4460488b39adcb56e7345079d9558506146202d234562cfaa522b77d1eb0d468121a5aed5cec42983a78abc2fe0946dd78dc2bc40  gnome-settings-daemon-48.1.tar.xz
f1575dd86772e4bad9357f0322b2ba396478ec45a691c072c4ff98c299d8814aaaf0386fb90f883b3862f88495a07177453ac0fb163ce2b17eb7bb5e65ca5d6c  libgnome-volume-control-47c47a423ff2f55bb038d92517e4782cf051496a.tar.gz
"
