| 1 | Patch-Source: <https://gitlab.freedesktop.org/pipewire/pipewire/-/merge_requests/2717>
|
| 2 | ---
|
| 3 | From d98e46636ef615801bcb25dee3ec1aa4a8e7344d Mon Sep 17 00:00:00 2001
|
| 4 | From: Achill Gilgenast <[email protected]>
|
| 5 | Date: Tue, 3 Feb 2026 22:49:16 +0100
|
| 6 | Subject: [PATCH] systemd: Allow installation of systemd services without
|
| 7 | libsystemd
|
| 8 |
|
| 9 | Allows installation of systemd services without libsystemd installed.
|
| 10 | Useful for Alpine Linux where systemd services are allowed to be subpackaged
|
| 11 | (e.g. for postmarketOS) but hasn't systemd in it's repos.
|
| 12 |
|
| 13 | It has no change in existing behavior, but installs services if the unit
|
| 14 | directories are explicitly set.
|
| 15 |
|
| 16 | Signed-off-by: Achill Gilgenast <[email protected]>
|
| 17 | ---
|
| 18 | src/daemon/systemd/system/meson.build | 13 +++++++++----
|
| 19 | src/daemon/systemd/user/meson.build | 13 +++++++++----
|
| 20 | 2 files changed, 18 insertions(+), 8 deletions(-)
|
| 21 |
|
| 22 | diff --git a/src/daemon/systemd/system/meson.build b/src/daemon/systemd/system/meson.build
|
| 23 | index 02efc7a41042..329e165318c4 100644
|
| 24 | |
| 25 | |
| 26 | @@ -1,13 +1,18 @@
|
| 27 | -systemd = dependency('systemd', required : get_option('systemd-system-service'))
|
| 28 | -if not systemd.found()
|
| 29 | - subdir_done()
|
| 30 | +systemd_system_services_dir = ''
|
| 31 | +
|
| 32 | +systemd = dependency('systemd', required : false)
|
| 33 | +if systemd.found()
|
| 34 | + systemd_system_services_dir = systemd.get_variable('systemdsystemunitdir', pkgconfig_define : [ 'rootprefix', prefix])
|
| 35 | endif
|
| 36 |
|
| 37 | -systemd_system_services_dir = systemd.get_variable('systemdsystemunitdir', pkgconfig_define : [ 'rootprefix', prefix])
|
| 38 | if get_option('systemd-system-unit-dir') != ''
|
| 39 | systemd_system_services_dir = get_option('systemd-system-unit-dir')
|
| 40 | endif
|
| 41 |
|
| 42 | +if systemd_system_services_dir == ''
|
| 43 | + subdir_done()
|
| 44 | +endif
|
| 45 | +
|
| 46 | install_data(sources : ['pipewire.socket', 'pipewire-manager.socket', 'pipewire-pulse.socket' ],
|
| 47 | install_dir : systemd_system_services_dir)
|
| 48 |
|
| 49 | diff --git a/src/daemon/systemd/user/meson.build b/src/daemon/systemd/user/meson.build
|
| 50 | index 1b65d5f7aacf..fcf8c39129da 100644
|
| 51 | |
| 52 | |
| 53 | @@ -1,13 +1,18 @@
|
| 54 | -systemd = dependency('systemd', required : get_option('systemd-user-service'))
|
| 55 | -if not systemd.found()
|
| 56 | - subdir_done()
|
| 57 | +systemd_user_services_dir = ''
|
| 58 | +
|
| 59 | +systemd = dependency('systemd', required : false)
|
| 60 | +if systemd.found()
|
| 61 | + systemd_user_services_dir = systemd.get_variable('systemduserunitdir', pkgconfig_define : [ 'prefix', prefix])
|
| 62 | endif
|
| 63 |
|
| 64 | -systemd_user_services_dir = systemd.get_variable('systemduserunitdir', pkgconfig_define : [ 'prefix', prefix])
|
| 65 | if get_option('systemd-user-unit-dir') != ''
|
| 66 | systemd_user_services_dir = get_option('systemd-user-unit-dir')
|
| 67 | endif
|
| 68 |
|
| 69 | +if systemd_user_services_dir == ''
|
| 70 | + subdir_done()
|
| 71 | +endif
|
| 72 | +
|
| 73 | install_data(
|
| 74 | sources : ['pipewire.socket', 'pipewire-pulse.socket'],
|
| 75 | install_dir : systemd_user_services_dir)
|
| 76 | --
|
| 77 | 2.53.0
|
| 78 |
|