gnome-desktop: add withSystemd option

Since 7f2a6f17fc ("xdg-desktop-portal-gtk: Enable all default
portals unconditionally"), building gnome-desktop is necessary to
build xdg-desktop-portal-gtk, but it wasn't possible for systems that
can't use systemd.

I've called the option "withSystemd" as it's the most common name for
this kind of option in Nixpkgs.
This commit is contained in:
Alyssa Ross
2024-10-13 11:49:44 +02:00
parent 744ab7a50e
commit 6f700a0b61
@@ -18,11 +18,13 @@
, wayland
, libseccomp
, systemd
, udev
, bubblewrap
, gobject-introspection
, gtk-doc
, docbook-xsl-nons
, gsettings-desktop-schemas
, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd
}:
stdenv.mkDerivation rec {
@@ -64,11 +66,13 @@ stdenv.mkDerivation rec {
gtk3
gtk4
glib
] ++ lib.optionals withSystemd [
systemd
] ++ lib.optionals stdenv.hostPlatform.isLinux [
bubblewrap
wayland
libseccomp
systemd
udev
];
propagatedBuildInputs = [
@@ -78,8 +82,8 @@ stdenv.mkDerivation rec {
mesonFlags = [
"-Dgtk_doc=true"
"-Ddesktop_docs=false"
(lib.mesonEnable "systemd" withSystemd)
] ++ lib.optionals (!stdenv.hostPlatform.isLinux) [
"-Dsystemd=disabled"
"-Dudev=disabled"
];