1 From 78e625dbafa8543b17ffaf9c42cf90c9cf9a612e Mon Sep 17 00:00:00 2001
2 From: Alyssa Ross <hi@alyssa.is>
3 Date: Wed, 8 May 2024 11:20:42 +0200
4 Subject: [PATCH] Fix configuration with elogind
6 Previously, it would try to get sysusers_dir from systemd even though
7 systemd_dep was undefined. Determining systemd_systemdsystemunitdir
8 from systemd was already checking for systemd logind specifically, and
9 systemd_sysusers_dir is only used in the systemd logind case, so move
10 both of those into the systemd-logind-specific branch above.
12 (cherry picked from commit b58b58af10c390ab9a11a4cfe6a4ff3d50cc0fa5)
14 meson.build | 22 +++++++++++-----------
15 1 file changed, 11 insertions(+), 11 deletions(-)
17 diff --git a/meson.build b/meson.build
18 index 2f81c90..0888322 100644
21 @@ -202,6 +202,16 @@ if enable_logind
22 if not logind_dep.found()
23 logind_dep = dependency('libsystemd-login', not_found_message: 'libsystemd support requested but libsystemd or libsystemd-login library not found')
26 + # systemd unit / service files
27 + systemd_systemdsystemunitdir = get_option('systemdsystemunitdir')
28 + if systemd_systemdsystemunitdir == '' and session_tracking == 'libsystemd-login'
29 + systemd_dep = dependency('systemd', not_found_message: 'systemd required but not found, please provide a valid systemd user unit dir or disable it')
30 + # FIXME: systemd.pc file does not use variables with relative paths, so `define_variable` cannot be used
31 + systemd_systemdsystemunitdir = systemd_dep.get_pkgconfig_variable('systemdsystemunitdir')
34 + systemd_sysusers_dir = systemd_dep.get_pkgconfig_variable('sysusers_dir', default: '/usr/lib/sysusers.d')
36 logind_dep = dependency('libelogind', not_found_message: 'libelogind support requested but libelogind library not found')
38 @@ -210,16 +220,6 @@ if enable_logind
39 config_h.set10('HAVE_' + func.to_upper(), cc.has_function(func, dependencies: logind_dep))
40 func = 'sd_pidfd_get_session'
41 config_h.set10('HAVE_' + func.to_upper(), cc.has_function(func, dependencies: logind_dep))
43 - # systemd unit / service files
44 - systemd_systemdsystemunitdir = get_option('systemdsystemunitdir')
45 - if systemd_systemdsystemunitdir == '' and session_tracking == 'libsystemd-login'
46 - systemd_dep = dependency('systemd', not_found_message: 'systemd required but not found, please provide a valid systemd user unit dir or disable it')
47 - # FIXME: systemd.pc file does not use variables with relative paths, so `define_variable` cannot be used
48 - systemd_systemdsystemunitdir = systemd_dep.get_pkgconfig_variable('systemdsystemunitdir')
51 - systemd_sysusers_dir = systemd_dep.get_pkgconfig_variable('sysusers_dir', default: '/usr/lib/sysusers.d')
53 config_h.set('HAVE_LIBSYSTEMD', enable_logind)
55 @@ -404,7 +404,7 @@ output += ' introspection: ' + enable_introspection.to_string(
56 output += ' Distribution/OS: ' + os_type + '\n'
57 output += ' Authentication framework: ' + auth_fw + '\n'
58 output += ' Session tracking: ' + session_tracking + '\n'
60 +if session_tracking == 'logind'
61 output += ' systemdsystemunitdir: ' + systemd_systemdsystemunitdir + '\n'
63 output += ' polkitd user: ' + polkitd_user + ' \n'