diff --git a/src/daemon/systemd/system/meson.build b/src/daemon/systemd/system/meson.build index 02efc7a41..40aa7b324 100644 --- a/src/daemon/systemd/system/meson.build +++ b/src/daemon/systemd/system/meson.build @@ -1,13 +1,22 @@ -systemd = dependency('systemd', required : get_option('systemd-system-service')) -if not systemd.found() +systemd_system_services_dir = '' + +systemd = dependency('systemd', required : false) +if systemd.found() + systemd_system_services_dir = systemd.get_variable('systemdsystemunitdir', pkgconfig_define : [ 'rootprefix', prefix]) +endif + +if get_option('systemd-system-service').disabled() or (get_option('systemd-system-service').auto() and not systemd.found()) subdir_done() endif -systemd_system_services_dir = systemd.get_variable('systemdsystemunitdir', pkgconfig_define : [ 'rootprefix', prefix]) if get_option('systemd-system-unit-dir') != '' systemd_system_services_dir = get_option('systemd-system-unit-dir') endif +if systemd_system_services_dir == '' + subdir_done() +endif + install_data(sources : ['pipewire.socket', 'pipewire-manager.socket', 'pipewire-pulse.socket' ], install_dir : systemd_system_services_dir) diff --git a/src/daemon/systemd/user/meson.build b/src/daemon/systemd/user/meson.build index 1b65d5f7a..733651402 100644 --- a/src/daemon/systemd/user/meson.build +++ b/src/daemon/systemd/user/meson.build @@ -1,13 +1,22 @@ -systemd = dependency('systemd', required : get_option('systemd-user-service')) -if not systemd.found() +systemd_user_services_dir = '' + +systemd = dependency('systemd', required : false) +if systemd.found() + systemd_user_services_dir = systemd.get_variable('systemduserunitdir', pkgconfig_define : [ 'prefix', prefix]) +endif + +if get_option('systemd-user-service').disabled() or (get_option('systemd-user-service').auto() and not systemd.found()) subdir_done() endif -systemd_user_services_dir = systemd.get_variable('systemduserunitdir', pkgconfig_define : [ 'prefix', prefix]) if get_option('systemd-user-unit-dir') != '' systemd_user_services_dir = get_option('systemd-user-unit-dir') endif +if systemd_user_services_dir == '' + subdir_done() +endif + install_data( sources : ['pipewire.socket', 'pipewire-pulse.socket'], install_dir : systemd_user_services_dir)