Merge pull request #62 from gicmo/dbus_activation

data: make service dbus-activatable
This commit is contained in:
Alex Smith 2018-07-04 09:40:12 +01:00 committed by GitHub
commit a1e07bcdc7
3 changed files with 17 additions and 16 deletions

View File

@ -1,3 +1,4 @@
[D-BUS Service] [D-BUS Service]
Name=com.feralinteractive.GameMode Name=com.feralinteractive.GameMode
Exec=@BINDIR@/gamemoded -d Exec=@BINDIR@/gamemoded -d
SystemdService=gamemoded.service

View File

@ -10,15 +10,16 @@ if with_systemd == true
configuration: data_conf, configuration: data_conf,
install_dir: path_systemd_unit_dir, install_dir: path_systemd_unit_dir,
) )
else endif
# Install the D-BUS service file
configure_file( # Install the D-BUS service file
configure_file(
input: 'com.feralinteractive.GameMode.service.in', input: 'com.feralinteractive.GameMode.service.in',
output: 'com.feralinteractive.GameMode.service', output: 'com.feralinteractive.GameMode.service',
configuration: data_conf, configuration: data_conf,
install_dir: path_dbus_service_dir, install_dir: path_dbus_service_dir,
) )
endif
# Install the Polkit action file in all cases # Install the Polkit action file in all cases
configure_file( configure_file(

View File

@ -53,12 +53,12 @@ if with_systemd == true
pkgconfig_systemd = dependency('systemd') pkgconfig_systemd = dependency('systemd')
path_systemd_unit_dir = pkgconfig_systemd.get_pkgconfig_variable('systemduserunitdir') path_systemd_unit_dir = pkgconfig_systemd.get_pkgconfig_variable('systemduserunitdir')
endif endif
else endif
# Set the dbus path as appropriate.
path_dbus_service_dir = get_option('with-dbus-service-dir') # Set the dbus path as appropriate.
if path_dbus_service_dir == '' path_dbus_service_dir = get_option('with-dbus-service-dir')
if path_dbus_service_dir == ''
path_dbus_service_dir = join_paths(path_datadir, 'dbus-1', 'services') path_dbus_service_dir = join_paths(path_datadir, 'dbus-1', 'services')
endif
endif endif
path_polkit_action_dir = join_paths(path_datadir, 'polkit-1', 'actions') path_polkit_action_dir = join_paths(path_datadir, 'polkit-1', 'actions')
@ -114,11 +114,10 @@ if with_systemd == true
report += [ report += [
' systemd user unit directory: @0@'.format(path_systemd_unit_dir), ' systemd user unit directory: @0@'.format(path_systemd_unit_dir),
] ]
else endif
report += [ report += [
' D-BUS service directory: @0@'.format(path_dbus_service_dir), ' D-BUS service directory: @0@'.format(path_dbus_service_dir),
] ]
endif
report += [ report += [