1 |
commit: e4e2707733bb6b2c35242e351587e1e95883934c |
2 |
Author: Jason A. Donenfeld <zx2c4 <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Feb 5 23:55:11 2022 +0000 |
4 |
Commit: Jason A. Donenfeld <zx2c4 <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Feb 5 23:57:30 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e4e27077 |
7 |
|
8 |
media-video/pipewire: add masked USE=system-service |
9 |
|
10 |
Closes: https://github.com/gentoo/gentoo/pull/23972 |
11 |
Package-Manager: Portage-3.0.30, Repoman-3.0.3 |
12 |
Signed-off-by: Jason A. Donenfeld <zx2c4 <AT> gentoo.org> |
13 |
|
14 |
media-video/pipewire/metadata.xml | 1 + |
15 |
media-video/pipewire/pipewire-0.3.45.ebuild | 30 ++++++++++++++++++++++++++--- |
16 |
media-video/pipewire/pipewire-9999.ebuild | 30 ++++++++++++++++++++++++++--- |
17 |
profiles/base/package.use.mask | 5 +++++ |
18 |
4 files changed, 60 insertions(+), 6 deletions(-) |
19 |
|
20 |
diff --git a/media-video/pipewire/metadata.xml b/media-video/pipewire/metadata.xml |
21 |
index a61d898b80e4..f88730b7d3ba 100644 |
22 |
--- a/media-video/pipewire/metadata.xml |
23 |
+++ b/media-video/pipewire/metadata.xml |
24 |
@@ -30,6 +30,7 @@ |
25 |
<flag name="lv2">Allow loading LV2 plugins via <pkg>media-libs/lv2</pkg></flag> |
26 |
<flag name="pipewire-alsa">Replace PulseAudio's ALSA plugin with PipeWire's plugin</flag> |
27 |
<flag name="ssl">Enable raop-sink support (needs <pkg>dev-libs/openssl</pkg>)</flag> |
28 |
+ <flag name="system-service">Install systemd unit files for running as a system service. Not recommended.</flag> |
29 |
<flag name="X">Enable audible bell for X11</flag> |
30 |
</use> |
31 |
</pkgmetadata> |
32 |
|
33 |
diff --git a/media-video/pipewire/pipewire-0.3.45.ebuild b/media-video/pipewire/pipewire-0.3.45.ebuild |
34 |
index 033d3614a241..a6d8db4e1bda 100644 |
35 |
--- a/media-video/pipewire/pipewire-0.3.45.ebuild |
36 |
+++ b/media-video/pipewire/pipewire-0.3.45.ebuild |
37 |
@@ -21,7 +21,7 @@ HOMEPAGE="https://pipewire.org/" |
38 |
LICENSE="MIT LGPL-2.1+ GPL-2" |
39 |
# ABI was broken in 0.3.42 for https://gitlab.freedesktop.org/pipewire/wireplumber/-/issues/49 |
40 |
SLOT="0/0.4" |
41 |
-IUSE="bluetooth doc echo-cancel extra gstreamer jack-client jack-sdk lv2 pipewire-alsa ssl systemd test v4l X zeroconf" |
42 |
+IUSE="bluetooth doc echo-cancel extra gstreamer jack-client jack-sdk lv2 pipewire-alsa ssl system-service systemd test v4l X zeroconf" |
43 |
|
44 |
# Once replacing system JACK libraries is possible, it's likely that |
45 |
# jack-client IUSE will need blocking to avoid users accidentally |
46 |
@@ -29,7 +29,10 @@ IUSE="bluetooth doc echo-cancel extra gstreamer jack-client jack-sdk lv2 pipewir |
47 |
# JACK's sink - doing so is likely to yield no audio, cause a CPU |
48 |
# cycles consuming loop (and may even cause GUI crashes)! |
49 |
|
50 |
-REQUIRED_USE="jack-sdk? ( !jack-client )" |
51 |
+REQUIRED_USE=" |
52 |
+ jack-sdk? ( !jack-client ) |
53 |
+ system-service? ( systemd ) |
54 |
+" |
55 |
|
56 |
RESTRICT="!test? ( test )" |
57 |
|
58 |
@@ -81,6 +84,10 @@ RDEPEND=" |
59 |
!pipewire-alsa? ( media-plugins/alsa-plugins[${MULTILIB_USEDEP},pulseaudio] ) |
60 |
ssl? ( dev-libs/openssl:= ) |
61 |
systemd? ( sys-apps/systemd ) |
62 |
+ system-service? ( |
63 |
+ acct-user/pipewire |
64 |
+ acct-group/pipewire |
65 |
+ ) |
66 |
v4l? ( media-libs/libv4l ) |
67 |
X? ( |
68 |
media-libs/libcanberra |
69 |
@@ -128,6 +135,12 @@ src_prepare() { |
70 |
|
71 |
@audio - memlock 256 |
72 |
|
73 |
+ $(use system-service && { |
74 |
+ echo @pipewire - rtprio 95 |
75 |
+ echo @pipewire - priority -19 |
76 |
+ echo @pipewire - memlock 4194304 |
77 |
+ }) |
78 |
+ |
79 |
# End of ${limitsdfile} from ${P} |
80 |
EOF |
81 |
} |
82 |
@@ -146,7 +159,7 @@ multilib_src_configure() { |
83 |
$(meson_native_use_feature gstreamer gstreamer-device-provider) |
84 |
$(meson_native_use_feature systemd) |
85 |
|
86 |
- -Dsystemd-system-service=disabled # Matches upstream |
87 |
+ $(meson_native_use_feature system-service systemd-system-service) |
88 |
-Dsystemd-system-unit-dir="$(systemd_get_systemunitdir)" |
89 |
-Dsystemd-user-unit-dir="$(systemd_get_userunitdir)" |
90 |
|
91 |
@@ -316,4 +329,15 @@ pkg_postinst() { |
92 |
fi |
93 |
ewarn |
94 |
fi |
95 |
+ |
96 |
+ if use system-service; then |
97 |
+ ewarn |
98 |
+ ewarn "WARNING: you have enabled the system-service USE flag, which installs" |
99 |
+ ewarn "the system-wide systemd units that enable PipeWire to run as a system" |
100 |
+ ewarn "service. This is more than likely NOT what you want. You are strongly" |
101 |
+ ewarn "advised not to enable this mode and instead stick with systemd user" |
102 |
+ ewarn "units. The default configuration files will likely not work out of" |
103 |
+ ewarn "box, and you are on your own with configuration." |
104 |
+ ewarn |
105 |
+ fi |
106 |
} |
107 |
|
108 |
diff --git a/media-video/pipewire/pipewire-9999.ebuild b/media-video/pipewire/pipewire-9999.ebuild |
109 |
index 033d3614a241..a6d8db4e1bda 100644 |
110 |
--- a/media-video/pipewire/pipewire-9999.ebuild |
111 |
+++ b/media-video/pipewire/pipewire-9999.ebuild |
112 |
@@ -21,7 +21,7 @@ HOMEPAGE="https://pipewire.org/" |
113 |
LICENSE="MIT LGPL-2.1+ GPL-2" |
114 |
# ABI was broken in 0.3.42 for https://gitlab.freedesktop.org/pipewire/wireplumber/-/issues/49 |
115 |
SLOT="0/0.4" |
116 |
-IUSE="bluetooth doc echo-cancel extra gstreamer jack-client jack-sdk lv2 pipewire-alsa ssl systemd test v4l X zeroconf" |
117 |
+IUSE="bluetooth doc echo-cancel extra gstreamer jack-client jack-sdk lv2 pipewire-alsa ssl system-service systemd test v4l X zeroconf" |
118 |
|
119 |
# Once replacing system JACK libraries is possible, it's likely that |
120 |
# jack-client IUSE will need blocking to avoid users accidentally |
121 |
@@ -29,7 +29,10 @@ IUSE="bluetooth doc echo-cancel extra gstreamer jack-client jack-sdk lv2 pipewir |
122 |
# JACK's sink - doing so is likely to yield no audio, cause a CPU |
123 |
# cycles consuming loop (and may even cause GUI crashes)! |
124 |
|
125 |
-REQUIRED_USE="jack-sdk? ( !jack-client )" |
126 |
+REQUIRED_USE=" |
127 |
+ jack-sdk? ( !jack-client ) |
128 |
+ system-service? ( systemd ) |
129 |
+" |
130 |
|
131 |
RESTRICT="!test? ( test )" |
132 |
|
133 |
@@ -81,6 +84,10 @@ RDEPEND=" |
134 |
!pipewire-alsa? ( media-plugins/alsa-plugins[${MULTILIB_USEDEP},pulseaudio] ) |
135 |
ssl? ( dev-libs/openssl:= ) |
136 |
systemd? ( sys-apps/systemd ) |
137 |
+ system-service? ( |
138 |
+ acct-user/pipewire |
139 |
+ acct-group/pipewire |
140 |
+ ) |
141 |
v4l? ( media-libs/libv4l ) |
142 |
X? ( |
143 |
media-libs/libcanberra |
144 |
@@ -128,6 +135,12 @@ src_prepare() { |
145 |
|
146 |
@audio - memlock 256 |
147 |
|
148 |
+ $(use system-service && { |
149 |
+ echo @pipewire - rtprio 95 |
150 |
+ echo @pipewire - priority -19 |
151 |
+ echo @pipewire - memlock 4194304 |
152 |
+ }) |
153 |
+ |
154 |
# End of ${limitsdfile} from ${P} |
155 |
EOF |
156 |
} |
157 |
@@ -146,7 +159,7 @@ multilib_src_configure() { |
158 |
$(meson_native_use_feature gstreamer gstreamer-device-provider) |
159 |
$(meson_native_use_feature systemd) |
160 |
|
161 |
- -Dsystemd-system-service=disabled # Matches upstream |
162 |
+ $(meson_native_use_feature system-service systemd-system-service) |
163 |
-Dsystemd-system-unit-dir="$(systemd_get_systemunitdir)" |
164 |
-Dsystemd-user-unit-dir="$(systemd_get_userunitdir)" |
165 |
|
166 |
@@ -316,4 +329,15 @@ pkg_postinst() { |
167 |
fi |
168 |
ewarn |
169 |
fi |
170 |
+ |
171 |
+ if use system-service; then |
172 |
+ ewarn |
173 |
+ ewarn "WARNING: you have enabled the system-service USE flag, which installs" |
174 |
+ ewarn "the system-wide systemd units that enable PipeWire to run as a system" |
175 |
+ ewarn "service. This is more than likely NOT what you want. You are strongly" |
176 |
+ ewarn "advised not to enable this mode and instead stick with systemd user" |
177 |
+ ewarn "units. The default configuration files will likely not work out of" |
178 |
+ ewarn "box, and you are on your own with configuration." |
179 |
+ ewarn |
180 |
+ fi |
181 |
} |
182 |
|
183 |
diff --git a/profiles/base/package.use.mask b/profiles/base/package.use.mask |
184 |
index 67d7c4ca7ca1..ce62e749c618 100644 |
185 |
--- a/profiles/base/package.use.mask |
186 |
+++ b/profiles/base/package.use.mask |
187 |
@@ -6,6 +6,11 @@ |
188 |
# This file is only for generic masks. For arch-specific masks (i.e. |
189 |
# mask everywhere, unmask on arch/*) use arch/base. |
190 |
|
191 |
+# Jason A. Donenfeld <zx2c4@g.o> (2022-02-04) |
192 |
+# We're still ironing out some kinks and writing documentation for |
193 |
+# this feature, so keep masked for now. |
194 |
+media-video/pipewire system-service |
195 |
+ |
196 |
# Sam James <sam@g.o> (2021-01-24) |
197 |
# USE=custom-cflags is _particularly_ dangerous on sys-libs/glibc and |
198 |
# can result in not just build-time failures for glibc itself, but |