Browse Source

Add option to set systemd sysuser dir

Kira Bruneau 2 years ago
parent
commit
aee9703872
3 changed files with 12 additions and 5 deletions
  1. 1 1
      data/meson.build
  2. 10 4
      meson.build
  3. 1 0
      meson_options.txt

+ 1 - 1
data/meson.build

@@ -24,7 +24,7 @@ if sd_bus_provider == 'systemd'
     # Install the sysusers.d file
     install_data(
         files('gamemode.conf'),
-        install_dir: path_systemd_sysusers_dir,
+        install_dir: path_systemd_group_dir,
     )
 endif
 

+ 10 - 4
meson.build

@@ -104,15 +104,18 @@ libdl = cc.find_library('dl', required: false)
 
 # Determine the location for the systemd unit
 if sd_bus_provider == 'systemd'
-    # If the path isn't explicitly set, ask systemd for the systemd user unit directory
     path_systemd_unit_dir = get_option('with-systemd-user-unit-dir')
     if path_systemd_unit_dir == ''
-        message('Asking pkg-config for systemd\'s directories')
+        message('Asking pkg-config for systemd\'s \'systemduserunitdir\' directory')
         pkgconfig_systemd = dependency('systemd')
         path_systemd_unit_dir = pkgconfig_systemd.get_pkgconfig_variable('systemduserunitdir')
     endif
-    pkgconfig_systemd = dependency('systemd')
-    path_systemd_sysusers_dir = pkgconfig_systemd.get_pkgconfig_variable('sysusersdir')
+    path_systemd_group_dir = get_option('with-systemd-group-dir')
+    if path_systemd_group_dir == ''
+        message('Asking pkg-config for systemd\'s \'sysusersdir\' directory')
+        pkgconfig_systemd = dependency('systemd')
+        path_systemd_group_dir = pkgconfig_systemd.get_pkgconfig_variable('sysusersdir')
+    endif
 endif
 
 with_limits_conf = get_option('with-pam-group')
@@ -203,6 +206,9 @@ if sd_bus_provider == 'systemd'
 report += [
     '    systemd user unit directory:            @0@'.format(path_systemd_unit_dir),
 ]
+report += [
+    '    systemd group directory:                @0@'.format(path_systemd_group_dir),
+]
 endif
 report += [
     '    D-BUS service directory:                @0@'.format(path_dbus_service_dir),

+ 1 - 0
meson_options.txt

@@ -6,6 +6,7 @@ option('with-sd-bus-provider', type: 'combo', choices: ['systemd', 'elogind', 'n
 
 # systemd specific
 option('with-systemd-user-unit-dir', type: 'string', description: 'Explicitly set the systemd user unit directory')
+option('with-systemd-group-dir', type: 'string', description: 'Explicitly set the systemd group directory')
 
 # Not using systemd
 option('with-dbus-service-dir', type: 'string', description: 'Explicitly set the D-BUS session directory')