git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #57620 from worldofpeace/gnome-brightness-fix

gnome3.gnome-settings-daemon: fix #14168

commit44bf322dfb1ff5a12e43849dc4c10a4aa5dbda01 authorworldofpeace <worldofpeace@users.noreply.github.com> dateTue 30 Apr 2019, 13:14 (8 years ago) parent366f70ef6e9229
2 files changed+33
pkgs/desktops/gnome-3/core/gnome-settings-daemon/default.nix+7 pkgs/desktops/gnome-3/core/gnome-settings-daemon/global-backlight-helper.patch+26
pkgs/desktops/gnome-3/core/gnome-settings-daemon/default.nix+7
@@ -51,6 +51,7 @@ stdenv.mkDerivation rec {
5151 src = ./fix-paths.patch;
5252 inherit tzdata mousetweaks;
5353 })
54+ ./global-backlight-helper.patch
5455 ];
5556
5657 nativeBuildInputs = [
@@ -94,6 +95,12 @@ stdenv.mkDerivation rec {
9495 "-Dudev_dir=${placeholder "out"}/lib/udev"
9596 ];
9697
98+ # So the polkit policy can reference /run/current-system/sw/bin/gnome-settings-daemon/gsd-backlight-helper
99+ postFixup = ''
100+ mkdir -p $out/bin/gnome-settings-daemon
101+ ln -s $out/libexec/gsd-backlight-helper $out/bin/gnome-settings-daemon/gsd-backlight-helper
102+ '';
103+
97104 postPatch = ''
98105 for f in gnome-settings-daemon/codegen.py plugins/power/gsd-power-constants-update.pl meson_post_install.py; do
99106 chmod +x $f
pkgs/desktops/gnome-3/core/gnome-settings-daemon/global-backlight-helper.patchnew file+26
@@ -0,0 +1,26 @@
1+diff --git a/plugins/power/gsd-backlight.c b/plugins/power/gsd-backlight.c
2+index d7d10fd2..5619d6ad 100644
3+--- a/plugins/power/gsd-backlight.c
4++++ b/plugins/power/gsd-backlight.c
5+@@ -358,7 +358,7 @@ gsd_backlight_run_set_helper (GsdBacklight *backlight, GTask *task)
6+ proc = g_subprocess_new (G_SUBPROCESS_FLAGS_STDOUT_SILENCE,
7+ &error,
8+ "pkexec",
9+- LIBEXECDIR "/gsd-backlight-helper",
10++ "/run/current-system/sw/bin/gnome-settings-daemon/gsd-backlight-helper",
11+ g_udev_device_get_sysfs_path (backlight->udev_device),
12+ data->value_str, NULL);
13+ } else {
14+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
15+index f16300f8..79d6bd17 100644
16+--- a/plugins/power/org.gnome.settings-daemon.plugins.power.policy.in.in
17++++ b/plugins/power/org.gnome.settings-daemon.plugins.power.policy.in.in
18+@@ -25,7 +25,7 @@
19+ <allow_inactive>no</allow_inactive>
20+ <allow_active>yes</allow_active>
21+ </defaults>
22+- <annotate key="org.freedesktop.policykit.exec.path">@libexecdir@/gsd-backlight-helper</annotate>
23++ <annotate key="org.freedesktop.policykit.exec.path">/run/current-system/sw/bin/gnome-settings-daemon/gsd-backlight-helper</annotate>
24+ </action>
25+
26+ </policyconfig>