evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / by-name / gn / gnome-settings-daemon / add-gnome-session-ctl-option.patch
blob8bdf39ce37b62548725282aee483aa7a691b0696
1 From aae1e774dd9de22fe3520cf9eb2bfbf7216f5eb0 Mon Sep 17 00:00:00 2001
2 From: WORLDofPEACE <worldofpeace@protonmail.ch>
3 Date: Sun, 20 Sep 2020 16:09:36 -0400
4 Subject: [PATCH] build: add a gnome_session_ctl_path option
6 In gsd.service.in the ExecStopPost expects g-s-d libexecdir to
7 be from the same prefix as gnome-session's, and this is not necessarily
8 true as there are linux distro's that install their packages into their
9 own individual prefixes (like NixOS or Guix).
10 ---
11 meson_options.txt | 1 +
12 plugins/gsd.service.in | 2 +-
13 plugins/meson.build | 6 ++++++
14 3 files changed, 8 insertions(+), 1 deletion(-)
16 diff --git a/meson_options.txt b/meson_options.txt
17 index 3e04cf64f..21e003c61 100644
18 --- a/meson_options.txt
19 +++ b/meson_options.txt
20 @@ -1,4 +1,5 @@
21 option('udev_dir', type: 'string', value: '', description: 'Absolute path of the udev base directory')
22 +option('gnome_session_ctl_path', type: 'string', value: '', description: 'Absolute path to the gnome-session-ctl binary')
23 option('systemd', type: 'boolean', value: true, description: 'Enable systemd integration')
25 option('alsa', type: 'boolean', value: true, description: 'build with ALSA support (not optional on Linux platforms)')
26 diff --git a/plugins/gsd.service.in b/plugins/gsd.service.in
27 index 79b5f5536..bfbde6d05 100644
28 --- a/plugins/gsd.service.in
29 +++ b/plugins/gsd.service.in
30 @@ -23,4 +23,4 @@ BusName=@plugin_dbus_name@
31 TimeoutStopSec=5
32 # We cannot use OnFailure as e.g. dependency failures are normal
33 # https://github.com/systemd/systemd/issues/12352
34 -ExecStopPost=@libexecdir@/gnome-session-ctl --exec-stop-check
35 +ExecStopPost=@gnome_session_ctl@ --exec-stop-check
36 diff --git a/plugins/meson.build b/plugins/meson.build
37 index 83e018854..266a0f093 100644
38 --- a/plugins/meson.build
39 +++ b/plugins/meson.build
40 @@ -20,6 +20,11 @@ all_plugins = [
42 disabled_plugins = []
44 +gnome_session_ctl = get_option('gnome_session_ctl_path')
45 +if gnome_session_ctl == ''
46 + gnome_session_ctl = join_paths(gsd_libexecdir, 'gnome-session-ctl')
47 +endif
49 if not enable_smartcard
50 disabled_plugins += ['smartcard']
51 endif
52 @@ -125,6 +130,7 @@ foreach plugin: all_plugins
53 unit_conf.set('plugin_name', plugin_name)
54 unit_conf.set('description', plugin_description)
55 unit_conf.set('libexecdir', gsd_libexecdir)
56 + unit_conf.set('gnome_session_ctl', gnome_session_ctl)
57 unit_conf.set('plugin_dbus_name', plugin_dbus_name)
58 unit_conf.set('plugin_restart', plugin_restart_rule.get(plugin_name, 'on-failure'))