# Template file for 'accountsservice'
pkgname=accountsservice
version=23.13.9
revision=2
build_style=meson
build_helper="gir"
configure_args="-Dsystemdsystemunitdir=/usr/lib/systemd/system
 -Dwtmpfile=/var/log/wtmp $(vopt_bool gir introspection)"
hostmakedepends="glib-devel pkg-config polkit gettext $(vopt_if gir vala)
 python3-dbus python3-gobject python3-dbusmock"
makedepends="polkit-devel elogind-devel"
short_desc="D-Bus interfaces for querying and manipulating user account information"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="GPL-3.0-or-later"
homepage="https://www.freedesktop.org/wiki/Software/AccountsService/"
distfiles="${FREEDESKTOP_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
checksum=adda4cdeae24fa0992e7df3ffff9effa7090be3ac233a3edfdf69d5a9c9b924f
make_dirs="
 /var/lib/AccountsService/users 755 root root
 /var/lib/AccountsService/icons 755 root root"
CFLAGS="-D_GNU_SOURCE" # fgetgrent

if [ "$XBPS_TARGET_LIBC" = "glibc" ]; then
	makedepends+=" libxcrypt-devel"
fi

# Package build options
build_options="gir"
build_options_default="gir"

pre_configure() {
	# Assumes system locale is en_IE
	vsed -e 's/test_languages/disabled_test_languages/g' -i tests/test-daemon.py
}

accountsservice-devel_package() {
	depends="${sourcepkg}>=${version}_${revision} polkit-devel"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/include
		vmove usr/lib/pkgconfig
		vmove "usr/lib/*.so"
		if [ "$build_option_gir" ]; then
			vmove usr/share/gir-1.0
		fi
	}
}
