projects/aports·blob master · refs

78 lines · 2.9 KiB

1Patch-Source: <https://gitlab.freedesktop.org/pipewire/pipewire/-/merge_requests/2717>
2---
3From d98e46636ef615801bcb25dee3ec1aa4a8e7344d Mon Sep 17 00:00:00 2001
4From: Achill Gilgenast <[email protected]>
5Date: Tue, 3 Feb 2026 22:49:16 +0100
6Subject: [PATCH] systemd: Allow installation of systemd services without
7 libsystemd
8
9Allows installation of systemd services without libsystemd installed.
10Useful 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
13It has no change in existing behavior, but installs services if the unit
14directories are explicitly set.
15
16Signed-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
22diff --git a/src/daemon/systemd/system/meson.build b/src/daemon/systemd/system/meson.build
23index 02efc7a41042..329e165318c4 100644
24--- a/src/daemon/systemd/system/meson.build
25+++ b/src/daemon/systemd/system/meson.build
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
49diff --git a/src/daemon/systemd/user/meson.build b/src/daemon/systemd/user/meson.build
50index 1b65d5f7aacf..fcf8c39129da 100644
51--- a/src/daemon/systemd/user/meson.build
52+++ b/src/daemon/systemd/user/meson.build
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--
772.53.0
78