mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-17 04:15:44 +00:00
meson: configure systemd service files only if systemd is found
This commit is contained in:
parent
c9b1fcf572
commit
003acb4d5f
|
@ -51,32 +51,33 @@ service = executable(
|
||||||
install: true,
|
install: true,
|
||||||
)
|
)
|
||||||
|
|
||||||
service_install_path = join_paths(get_option('prefix'), 'bin', 'monado-service')
|
if systemd.found() and not get_option('systemd').disabled()
|
||||||
systemd_user_services_dir = systemd.get_pkgconfig_variable('systemduserunitdir', define_variable : [ 'prefix', get_option('prefix')])
|
service_install_path = join_paths(get_option('prefix'), 'bin', 'monado-service')
|
||||||
if get_option('systemd-user-unit-dir') != ''
|
systemd_user_services_dir = systemd.get_pkgconfig_variable('systemduserunitdir', define_variable : [ 'prefix', get_option('prefix')])
|
||||||
systemd_user_services_dir = get_option('systemd-user-unit-dir')
|
if get_option('systemd-user-unit-dir') != ''
|
||||||
|
systemd_user_services_dir = get_option('systemd-user-unit-dir')
|
||||||
|
endif
|
||||||
|
|
||||||
|
service_conf_data = configuration_data()
|
||||||
|
service_conf_data.set('UNIT_NAME', 'monado')
|
||||||
|
service_conf_data.set('conflicts', 'monado-dev')
|
||||||
|
service_conf_data.set('exit_on_disconnect', 'off')
|
||||||
|
service_conf_data.set('extra_desc', '')
|
||||||
|
service_conf_data.set('service_path', service_install_path)
|
||||||
|
configure_file(
|
||||||
|
input: 'monado.in.service',
|
||||||
|
output: 'monado.service',
|
||||||
|
configuration: service_conf_data,
|
||||||
|
install_dir: systemd_user_services_dir
|
||||||
|
)
|
||||||
|
|
||||||
|
socket_conf_data = configuration_data()
|
||||||
|
socket_conf_data.set('conflicts', 'monado-dev')
|
||||||
|
socket_conf_data.set('extra_desc', '')
|
||||||
|
configure_file(
|
||||||
|
input: 'monado.in.socket',
|
||||||
|
output: 'monado.socket',
|
||||||
|
configuration: socket_conf_data,
|
||||||
|
install_dir: systemd_user_services_dir
|
||||||
|
)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
service_conf_data = configuration_data()
|
|
||||||
service_conf_data.set('UNIT_NAME', 'monado')
|
|
||||||
service_conf_data.set('conflicts', 'monado-dev')
|
|
||||||
service_conf_data.set('exit_on_disconnect', 'off')
|
|
||||||
service_conf_data.set('extra_desc', '')
|
|
||||||
service_conf_data.set('service_path', service_install_path)
|
|
||||||
configure_file(
|
|
||||||
input: 'monado.in.service',
|
|
||||||
output: 'monado.service',
|
|
||||||
configuration: service_conf_data,
|
|
||||||
install_dir: systemd_user_services_dir
|
|
||||||
)
|
|
||||||
|
|
||||||
socket_conf_data = configuration_data()
|
|
||||||
socket_conf_data.set('conflicts', 'monado-dev')
|
|
||||||
socket_conf_data.set('extra_desc', '')
|
|
||||||
configure_file(
|
|
||||||
input: 'monado.in.socket',
|
|
||||||
output: 'monado.socket',
|
|
||||||
configuration: socket_conf_data,
|
|
||||||
install_dir: systemd_user_services_dir
|
|
||||||
)
|
|
||||||
|
|
Loading…
Reference in a new issue