# startxfce4 expects something else to have started the session bus, and
# Everest's D-Bus has no X11 autolaunch: the xinitrc re-runs itself in one.
prepare() {
	sed -i -e '1a if [ -z "$DBUS_SESSION_BUS_ADDRESS" ] && command -v dbus-run-session >/dev/null 2>&1; then' \
		-e '1a \  exec dbus-run-session -- /bin/sh "$0" "$@"' \
		-e '1a fi' scripts/xinitrc.in
	grep -q 'exec dbus-run-session' scripts/xinitrc.in
}

# The session prefix defaults to /usr, whatever --prefix says, and
# configure would record iceauth where the build layers put it (/usr/bin).
configure() {
	configure_args ./configure --prefix="$PREFIX" --sysconfdir=/etc \
		--localstatedir=/var --with-xsession-prefix="$PREFIX" \
		ICEAUTH="$PREFIX/bin/iceauth"
}
