From 4b2dbd4511310d4e15c7af0bf87017880e640d9a Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Thu, 10 Oct 2024 12:24:05 +0200 Subject: [PATCH] colord: add enableSystemd option Since 7f2a6f17fccf ("xdg-desktop-portal-gtk: Enable all default portals unconditionally"), building colord 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 "enableSystemd" for consistency with the existing "enableDaemon" option. As usual in Nixpkgs, the user is responsible for also overriding udev to a non-systemd implementation if necessary. --- pkgs/tools/misc/colord/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/tools/misc/colord/default.nix b/pkgs/tools/misc/colord/default.nix index 986babbf2867..da893702d9d5 100644 --- a/pkgs/tools/misc/colord/default.nix +++ b/pkgs/tools/misc/colord/default.nix @@ -10,7 +10,9 @@ , gusb , lcms2 , sqlite +, udev , systemd +, enableSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd , dbus , gobject-introspection , argyllcms @@ -60,6 +62,11 @@ stdenv.mkDerivation rec { "-Dvapi=true" "-Ddaemon=${lib.boolToString enableDaemon}" "-Ddaemon_user=colord" + (lib.mesonBool "systemd" enableSystemd) + + # The presence of the "udev" pkg-config module (as opposed to "libudev") + # indicates whether rules are supported. + (lib.mesonBool "udev_rules" (lib.elem "udev" udev.meta.pkgConfigModules)) ]; nativeBuildInputs = [ @@ -90,6 +97,8 @@ stdenv.mkDerivation rec { libgudev sane-backends sqlite + udev + ] ++ lib.optionals enableSystemd [ systemd ] ++ lib.optionals enableDaemon [ polkit