pipewire/src/daemon/systemd/system/meson.build

27 lines
1.1 KiB
Meson
Raw Normal View History

meson.build: rework `systemd` related options One issues is that the `systemd-{system,user}-service` feature options do not anything without the `systemd` option. This makes it more complicated to arrive at the desired build configuration since there are 3^3 = 27 possible ways to set each of them, but if `systemd=disabled`, then the other two are just ignored. Secondly, the `systemd` option also influences whether or not libsystemd will be used or not. This is not strictly necessary, since the "systemd" and "libsystemd" pkg-config files might be split, and one might wish to disable any kind of service file generation, but use libsystemd. Solve the first issues by using the `systemd-{system,user}-service` options when looking up the "systemd" dependency for generating service files. This means that the corresponding option is in full control, no secondary options are necessary. This means that the "systemd" dependency is looked up potentially twice, but that should not be a significant issue since meson caches dependecy lookups. And solve the second issue by renaming the now unused `systemd` option to `libsystemd` and using it solely to control whether or not libsystemd will be used. Furthermore, the default value of `systemd-user-service` is set to "auto" to prevent the dependency lookup from failing on non-systemd systemd out of the box. And the journal tests in "test-support" are extended to return "skip" if `sd_journal_open()` returns `ENOSYS`, which is needed because "elogind" ships the systemd pkg-config files and headers.
2025-05-10 17:43:28 +02:00
systemd = dependency('systemd', required : get_option('systemd-system-service'))
if 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
install_data(sources : ['pipewire.socket', 'pipewire-manager.socket', 'pipewire-pulse.socket' ],
install_dir : systemd_system_services_dir)
systemd_config = configuration_data()
systemd_config.set('PW_BINARY', pipewire_bindir / 'pipewire')
systemd_config.set('PW_PULSE_BINARY', pipewire_bindir / 'pipewire-pulse')
configure_file(input : 'pipewire.service.in',
output : 'pipewire.service',
configuration : systemd_config,
install_dir : systemd_system_services_dir)
configure_file(input : 'pipewire-pulse.service.in',
output : 'pipewire-pulse.service',
configuration : systemd_config,
install_dir : systemd_system_services_dir)