# polkit - Authorisation framework
# Generated from manifest.tsv by gen-ports.py. Edit the manifest, not this file,
# unless the package needs something the template cannot express - in which case
# drop a `recipe.local` beside it and it will be preserved.
name=polkit
version=126
release=1
desc="Authorisation framework"
url="https://gitlab.freedesktop.org/polkit/polkit"
license="Apache-2.0"
depend="glib duktape dbus"
makedepend="meson ninja"
source="https://github.com/polkit-org/polkit/archive/refs/tags/126.tar.gz"
sha256="SKIP"

build() {
	unset LD_LIBRARY_PATH
	cd "polkit-126"
	# introspection=false: g-ir-scanner compiles a probe and *runs* it
	# against the freshly-built library, and meson sets its own
	# LD_LIBRARY_PATH for that one step regardless of what this recipe
	# unset above - the host's clang then loads the sysroot's own
	# libLLVM (present because llvm ended up seeded into this sysroot)
	# instead of its own matching copy and crashes the same
	# __pointer_chk_guard way as everything else this session. Not
	# needed anyway - only used for language bindings, not polkitd/
	# pkexec/pkcheck, which link fine without it.
	# ScrapLinux has no systemd and no elogind - 'ConsoleKit' is the one
	# session_tracking value that does not pull in either as a hard
	# dependency (it is a real meson option value, not a package ScrapLinux
	# needs to build).
	meson setup build \
		--prefix=/usr \
		--libdir=/usr/lib \
		--sysconfdir=/etc \
		--localstatedir=/var \
		--buildtype=release \
		--wrap-mode=nodownload \
		-Dsession_tracking=ConsoleKit \
		-Dintrospection=false \
		-Db_lto=true
	ninja -C build -j"$JOBS"
}

package() {
	cd "polkit-126"
	DESTDIR="$pkgdir" ninja -C build install
}
