From f6e92290b371a71aec02483e87f629c7df26aab1 Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Mon, 22 Apr 2019 15:55:18 -0400 Subject: [PATCH] gnome3.gnome-settings-daemon: fix #14168 The issue in brief is caused by the fact that gnome-settings-daemon is non-restartable and if the policy definitions change in any way it won't propagate to the running system because of that. By patching references to the backlight helper to /run/current-system/sw/bin/gsd-backlight-helper the polkit policy will not undergo a change. --- .../core/gnome-settings-daemon/default.nix | 7 +++++ .../global-backlight-helper.patch | 26 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 pkgs/desktops/gnome-3/core/gnome-settings-daemon/global-backlight-helper.patch diff --git a/pkgs/desktops/gnome-3/core/gnome-settings-daemon/default.nix b/pkgs/desktops/gnome-3/core/gnome-settings-daemon/default.nix index f51270bcbd2..899b55b2563 100644 --- a/pkgs/desktops/gnome-3/core/gnome-settings-daemon/default.nix +++ b/pkgs/desktops/gnome-3/core/gnome-settings-daemon/default.nix @@ -50,6 +50,7 @@ stdenv.mkDerivation rec { src = ./fix-paths.patch; inherit tzdata; }) + ./global-backlight-helper.patch ]; nativeBuildInputs = [ @@ -93,6 +94,12 @@ stdenv.mkDerivation rec { "-Dudev_dir=${placeholder "out"}/lib/udev" ]; + # So the polkit policy can reference /run/current-system/sw/bin/gnome-settings-daemon/gsd-backlight-helper + postFixup = '' + mkdir -p $out/bin/gnome-settings-daemon + ln -s $out/libexec/gsd-backlight-helper $out/bin/gnome-settings-daemon/gsd-backlight-helper + ''; + postPatch = '' for f in gnome-settings-daemon/codegen.py plugins/power/gsd-power-constants-update.pl meson_post_install.py; do chmod +x $f diff --git a/pkgs/desktops/gnome-3/core/gnome-settings-daemon/global-backlight-helper.patch b/pkgs/desktops/gnome-3/core/gnome-settings-daemon/global-backlight-helper.patch new file mode 100644 index 00000000000..8f3951af2da --- /dev/null +++ b/pkgs/desktops/gnome-3/core/gnome-settings-daemon/global-backlight-helper.patch @@ -0,0 +1,26 @@ +diff --git a/plugins/power/gsd-backlight.c b/plugins/power/gsd-backlight.c +index d7d10fd2..5619d6ad 100644 +--- a/plugins/power/gsd-backlight.c ++++ b/plugins/power/gsd-backlight.c +@@ -358,7 +358,7 @@ gsd_backlight_run_set_helper (GsdBacklight *backlight, GTask *task) + proc = g_subprocess_new (G_SUBPROCESS_FLAGS_STDOUT_SILENCE, + &error, + "pkexec", +- LIBEXECDIR "/gsd-backlight-helper", ++ "/run/current-system/sw/bin/gnome-settings-daemon/gsd-backlight-helper", + g_udev_device_get_sysfs_path (backlight->udev_device), + data->value_str, NULL); + } else { +diff --git a/plugins/power/org.gnome.settings-daemon.plugins.power.policy.in.in b/plugins/power/org.gnome.settings-daemon.plugins.power.policy.in.in +index f16300f8..79d6bd17 100644 +--- a/plugins/power/org.gnome.settings-daemon.plugins.power.policy.in.in ++++ b/plugins/power/org.gnome.settings-daemon.plugins.power.policy.in.in +@@ -25,7 +25,7 @@ + no + yes + +- @libexecdir@/gsd-backlight-helper ++ /run/current-system/sw/bin/gnome-settings-daemon/gsd-backlight-helper + + +