Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-video/pipewire/
Date: Thu, 28 Apr 2022 16:06:24
Message-Id: 1651161966.4d1c8e24c2316a1dc2cc289049702887784cf487.sam@gentoo
1 commit: 4d1c8e24c2316a1dc2cc289049702887784cf487
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Thu Apr 28 16:06:06 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Thu Apr 28 16:06:06 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4d1c8e24
7
8 media-video/pipewire: add 0.3.51
9
10 Signed-off-by: Sam James <sam <AT> gentoo.org>
11
12 media-video/pipewire/Manifest | 1 +
13 media-video/pipewire/pipewire-0.3.51.ebuild | 355 ++++++++++++++++++++++++++++
14 2 files changed, 356 insertions(+)
15
16 diff --git a/media-video/pipewire/Manifest b/media-video/pipewire/Manifest
17 index b4c347b1fd6a..528468dc49d8 100644
18 --- a/media-video/pipewire/Manifest
19 +++ b/media-video/pipewire/Manifest
20 @@ -2,3 +2,4 @@ DIST pipewire-0.3.30.tar.gz 1540950 BLAKE2B 69b35743e3ad9a8caf68d9bb16cf395203ef
21 DIST pipewire-0.3.36.tar.gz 1708209 BLAKE2B 20fce0d7f88347fe594491d4fae7b6a8edee67ff7749f1a40b807a5d5094d792e61e3efd05dca2221f781c263e34ff0a50ad3c162231911d4b1d87704df6c775 SHA512 f0fc68ea005018b420a4f65a24dc9c85eb6263c24e66852a7ce2b03f966990d62487b388c7d73ff5adfc10c80c439b1200ae876e41d78f91db190036a1799a14
22 DIST pipewire-0.3.49.tar.gz 1769037 BLAKE2B 2567bc98933bfbb295358886e8f97db2af2f0a6ee3c2586c1718e39f7eedaed8528a4663753ba56d3295e42576da015ce9278f22aff9bbd9ca43d883bff5a2f6 SHA512 36398872f7d7b31193d7a8885bbdfb415a122bd779874107a0642202dfd8408f39fddf769bfbae4533c2cc99fe9ef67903d50cc721e936aa4802229f1c46d809
23 DIST pipewire-0.3.50.tar.gz 1773182 BLAKE2B d286b73553471795ea8ed60c82e12c955f1835a7a3a8d45baeda6b1e20a795221230b50c21619af4ef5b2b4962d2783de00b1ab2b22b091220970c334de8b9dc SHA512 e29a626258ab28d74e35e310037fac374fe009fb56e0fa41cef7abb1ec6abb26f828cff1b17500f92f1dd4c95c1e0e98f6af497d315dd463f81c2649d1e8ee23
24 +DIST pipewire-0.3.51.tar.gz 1789070 BLAKE2B 8538eb9f2178efa26365f30b324b707826e580caa1fd9c09b62c561c140c14186e0d2b04808fa78eb5642ddccf1a347def19934ecd654be06b215a693075b6fc SHA512 a762fd260b4b14ad9ef142be11ab1c22268da6726e2179559ffb254f0ce7daf7a502779e33c64313a9c6a9fc1bd15150b76be04ec81aa27c35dbb4333cecdb4a
25
26 diff --git a/media-video/pipewire/pipewire-0.3.51.ebuild b/media-video/pipewire/pipewire-0.3.51.ebuild
27 new file mode 100644
28 index 000000000000..6a066b48013e
29 --- /dev/null
30 +++ b/media-video/pipewire/pipewire-0.3.51.ebuild
31 @@ -0,0 +1,355 @@
32 +# Copyright 1999-2022 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=8
36 +
37 +PYTHON_COMPAT=( python3_{8..10} )
38 +
39 +inherit flag-o-matic meson-multilib optfeature prefix python-any-r1 systemd udev
40 +
41 +if [[ ${PV} == 9999 ]]; then
42 + EGIT_REPO_URI="https://gitlab.freedesktop.org/${PN}/${PN}.git"
43 + inherit git-r3
44 +else
45 + if [[ ${PV} == *_p* ]] ; then
46 + MY_COMMIT=""
47 + SRC_URI="https://gitlab.freedesktop.org/pipewire/pipewire/-/archive/${MY_COMMIT}/pipewire-${MY_COMMIT}.tar.bz2 -> ${P}.tar.bz2"
48 + S="${WORKDIR}"/${PN}-${MY_COMMIT}
49 + else
50 + SRC_URI="https://gitlab.freedesktop.org/${PN}/${PN}/-/archive/${PV}/${P}.tar.gz"
51 + fi
52 +
53 + KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~sparc ~x86"
54 +fi
55 +
56 +DESCRIPTION="Multimedia processing graphs"
57 +HOMEPAGE="https://pipewire.org/"
58 +
59 +LICENSE="MIT LGPL-2.1+ GPL-2"
60 +# ABI was broken in 0.3.42 for https://gitlab.freedesktop.org/pipewire/wireplumber/-/issues/49
61 +SLOT="0/0.4"
62 +IUSE="bluetooth doc echo-cancel extra gstreamer jack-client jack-sdk lv2 pipewire-alsa ssl system-service systemd test v4l X zeroconf"
63 +
64 +# Once replacing system JACK libraries is possible, it's likely that
65 +# jack-client IUSE will need blocking to avoid users accidentally
66 +# configuring their systems to send PW sink output to the emulated
67 +# JACK's sink - doing so is likely to yield no audio, cause a CPU
68 +# cycles consuming loop (and may even cause GUI crashes)!
69 +
70 +REQUIRED_USE="
71 + jack-sdk? ( !jack-client )
72 + system-service? ( systemd )
73 +"
74 +
75 +RESTRICT="!test? ( test )"
76 +
77 +BDEPEND="
78 + >=dev-util/meson-0.59
79 + virtual/pkgconfig
80 + ${PYTHON_DEPS}
81 + $(python_gen_any_dep 'dev-python/docutils[${PYTHON_USEDEP}]')
82 + doc? (
83 + app-doc/doxygen
84 + media-gfx/graphviz
85 + )
86 +"
87 +RDEPEND="
88 + acct-group/audio
89 + media-libs/alsa-lib
90 + sys-apps/dbus[${MULTILIB_USEDEP}]
91 + sys-libs/readline:=
92 + sys-libs/ncurses:=[unicode(+)]
93 + virtual/libintl[${MULTILIB_USEDEP}]
94 + virtual/libudev[${MULTILIB_USEDEP}]
95 + bluetooth? (
96 + media-libs/fdk-aac
97 + media-libs/libldac
98 + media-libs/libfreeaptx
99 + media-libs/sbc
100 + >=net-wireless/bluez-4.101:=
101 + virtual/libusb:1
102 + )
103 + echo-cancel? ( media-libs/webrtc-audio-processing:0 )
104 + extra? (
105 + >=media-libs/libsndfile-1.0.20
106 + )
107 + gstreamer? (
108 + >=dev-libs/glib-2.32.0:2
109 + >=media-libs/gstreamer-1.10.0:1.0
110 + media-libs/gst-plugins-base:1.0
111 + )
112 + jack-client? ( >=media-sound/jack2-1.9.10:2[dbus] )
113 + jack-sdk? (
114 + !media-sound/jack-audio-connection-kit
115 + !media-sound/jack2
116 + )
117 + lv2? ( media-libs/lilv )
118 + pipewire-alsa? (
119 + >=media-libs/alsa-lib-1.1.7[${MULTILIB_USEDEP}]
120 + !media-plugins/alsa-plugins[${MULTILIB_USEDEP},pulseaudio]
121 + )
122 + !pipewire-alsa? ( media-plugins/alsa-plugins[${MULTILIB_USEDEP},pulseaudio] )
123 + ssl? ( dev-libs/openssl:= )
124 + systemd? ( sys-apps/systemd )
125 + system-service? (
126 + acct-user/pipewire
127 + acct-group/pipewire
128 + )
129 + v4l? ( media-libs/libv4l )
130 + X? (
131 + media-libs/libcanberra
132 + x11-libs/libX11
133 + x11-libs/libXfixes
134 + )
135 + zeroconf? ( net-dns/avahi )
136 +"
137 +
138 +DEPEND="${RDEPEND}"
139 +
140 +# TODO: Consider use cases where pipewire is not used for driving audio
141 +# Doing so with WirePlumber currently involves editing Lua scripts
142 +PDEPEND=">=media-video/wireplumber-0.4.8-r3"
143 +
144 +# Present RDEPEND that are currently always disabled due to the PW
145 +# code using them being required to be disabled by Gentoo guidelines
146 +# (i.e. developer binaries not meant for users) and unready code
147 +# media-video/ffmpeg:=
148 +# media-libs/libsdl2
149 +# >=media-libs/vulkan-loader-1.1.69
150 +#
151 +# Ditto for DEPEND
152 +# >=dev-util/vulkan-headers-1.1.69
153 +
154 +DOCS=( {README,INSTALL}.md NEWS )
155 +
156 +PATCHES=(
157 + "${FILESDIR}"/${PN}-0.3.25-enable-failed-mlock-warning.patch
158 +)
159 +
160 +# limitsdfile related code taken from =sys-auth/realtime-base-0.1
161 +# with changes as necessary.
162 +limitsdfile=40-${PN}.conf
163 +
164 +python_check_deps() {
165 + has_version -b "dev-python/docutils[${PYTHON_USEDEP}]"
166 +}
167 +
168 +src_prepare() {
169 + default
170 +
171 + einfo "Generating ${limitsdfile}"
172 + cat > ${limitsdfile} <<- EOF || die
173 + # Start of ${limitsdfile} from ${P}
174 +
175 + @audio - memlock 256
176 +
177 + $(use system-service && {
178 + echo @pipewire - rtprio 95
179 + echo @pipewire - priority -19
180 + echo @pipewire - memlock 4194304
181 + })
182 +
183 + # End of ${limitsdfile} from ${P}
184 + EOF
185 +}
186 +
187 +multilib_src_configure() {
188 + # https://bugs.gentoo.org/838301
189 + filter-flags -fno-semantic-interposition
190 +
191 + local emesonargs=(
192 + -Ddocdir="${EPREFIX}"/usr/share/doc/${PF}
193 +
194 + $(meson_native_use_feature zeroconf avahi)
195 + $(meson_native_use_feature doc docs)
196 + $(meson_native_enabled examples) # TODO: Figure out if this is still important now that media-session gone
197 + $(meson_native_enabled man)
198 + $(meson_feature test tests)
199 + -Dinstalled_tests=disabled # Matches upstream; Gentoo never installs tests
200 + $(meson_native_use_feature gstreamer)
201 + $(meson_native_use_feature gstreamer gstreamer-device-provider)
202 + $(meson_native_use_feature systemd)
203 +
204 + $(meson_native_use_feature system-service systemd-system-service)
205 + -Dsystemd-system-unit-dir="$(systemd_get_systemunitdir)"
206 + -Dsystemd-user-unit-dir="$(systemd_get_userunitdir)"
207 +
208 + $(meson_native_use_feature systemd systemd-user-service)
209 + $(meson_feature pipewire-alsa) # Allows integrating ALSA apps into PW graph
210 + -Dspa-plugins=enabled
211 + -Dalsa=enabled # Allows using kernel ALSA for sound I/O (NOTE: media-session is gone so IUSE=alsa/spa_alsa/alsa-backend might be possible)
212 + -Daudiomixer=enabled # Matches upstream
213 + -Daudioconvert=enabled # Matches upstream
214 + $(meson_native_use_feature bluetooth bluez5)
215 + $(meson_native_use_feature bluetooth bluez5-backend-hsp-native)
216 + $(meson_native_use_feature bluetooth bluez5-backend-hfp-native)
217 + $(meson_native_use_feature bluetooth bluez5-backend-ofono)
218 + $(meson_native_use_feature bluetooth bluez5-backend-hsphfpd)
219 + $(meson_native_use_feature bluetooth bluez5-codec-aac)
220 + $(meson_native_use_feature bluetooth bluez5-codec-aptx)
221 + $(meson_native_use_feature bluetooth bluez5-codec-ldac)
222 + $(meson_native_use_feature bluetooth libusb) # At least for now only used by bluez5 native (quirk detection of adapters)
223 + $(meson_native_use_feature echo-cancel echo-cancel-webrtc) #807889
224 + -Dcontrol=enabled # Matches upstream
225 + -Daudiotestsrc=enabled # Matches upstream
226 + -Dffmpeg=disabled # Disabled by upstream and no major developments to spa/plugins/ffmpeg/ since May 2020
227 + -Dpipewire-jack=enabled # Allows integrating JACK apps into PW graph
228 + $(meson_native_use_feature jack-client jack) # Allows PW to act as a JACK client
229 + $(meson_use jack-sdk jack-devel)
230 + $(usex jack-sdk "-Dlibjack-path=${EPREFIX}/usr/$(get_libdir)" '')
231 + -Dsupport=enabled # Miscellaneous/common plugins, such as null sink
232 + -Devl=disabled # Matches upstream
233 + -Dtest=disabled # fakesink and fakesource plugins
234 + $(meson_native_use_feature lv2)
235 + $(meson_native_use_feature v4l v4l2)
236 + -Dlibcamera=disabled # libcamera is not in Portage tree
237 + $(meson_native_use_feature ssl raop)
238 + -Dvideoconvert=enabled # Matches upstream
239 + -Dvideotestsrc=enabled # Matches upstream
240 + -Dvolume=enabled # Matches upstream
241 + -Dvulkan=disabled # Uses pre-compiled Vulkan compute shader to provide a CGI video source (dev thing; disabled by upstream)
242 + $(meson_native_use_feature extra pw-cat)
243 + -Dudev=enabled
244 + -Dudevrulesdir="${EPREFIX}$(get_udevdir)/rules.d"
245 + -Dsdl2=disabled # Controls SDL2 dependent code (currently only examples when -Dinstalled_tests=enabled which we never install)
246 + $(meson_native_use_feature extra sndfile) # Enables libsndfile dependent code (currently only pw-cat)
247 + -Dsession-managers="[]" # All available session managers are now their own projects, so there's nothing to build
248 +
249 + # Just for bell sounds in X11 right now.
250 + $(meson_native_use_feature X x11)
251 + $(meson_native_use_feature X x11-xfixes)
252 + $(meson_native_use_feature X libcanberra)
253 + )
254 +
255 + meson_src_configure
256 +}
257 +
258 +multilib_src_install() {
259 + # Our custom DOCS do not exist in multilib source directory
260 + DOCS= meson_src_install
261 +}
262 +
263 +multilib_src_install_all() {
264 + einstalldocs
265 +
266 + insinto /etc/security/limits.d
267 + doins ${limitsdfile}
268 +
269 + if use pipewire-alsa; then
270 + dodir /etc/alsa/conf.d
271 + # These will break if someone has /etc that is a symbolic link to a subfolder! See #724222
272 + # And the current dosym8 -r implementation is likely affected by the same issue, too.
273 + dosym ../../../usr/share/alsa/alsa.conf.d/50-pipewire.conf /etc/alsa/conf.d/50-pipewire.conf
274 + dosym ../../../usr/share/alsa/alsa.conf.d/99-pipewire-default.conf /etc/alsa/conf.d/99-pipewire-default.conf
275 + fi
276 +
277 + if ! use systemd; then
278 + insinto /etc/xdg/autostart
279 + newins "${FILESDIR}"/pipewire.desktop-r1 pipewire.desktop
280 +
281 + exeinto /usr/bin
282 + newexe "${FILESDIR}"/gentoo-pipewire-launcher.in gentoo-pipewire-launcher
283 + eprefixify "${ED}"/usr/bin/gentoo-pipewire-launcher
284 + fi
285 +}
286 +
287 +pkg_postinst() {
288 + elog "It is recommended to raise RLIMIT_MEMLOCK to 256 for users"
289 + elog "using PipeWire. Do it either manually or add yourself"
290 + elog "to the 'audio' group:"
291 + elog
292 + elog " usermod -aG audio <youruser>"
293 + elog
294 +
295 + if ! use jack-sdk; then
296 + elog "JACK emulation is incomplete and not all programs will work. PipeWire's"
297 + elog "alternative libraries have been installed to a non-default location."
298 + elog "To use them, put pw-jack <application> before every JACK application."
299 + elog "When using pw-jack, do not run jackd/jackdbus. However, a virtual/jack"
300 + elog "provider is still needed to compile the JACK applications themselves."
301 + elog
302 + fi
303 +
304 + if use systemd; then
305 + elog "When switching from PulseAudio, you may need to disable PulseAudio:"
306 + elog
307 + elog " systemctl --user disable pulseaudio.service pulseaudio.socket"
308 + elog
309 + elog "To use PipeWire, the user units must be manually enabled"
310 + elog "by running this command as each user you use for desktop activities:"
311 + elog
312 + elog " systemctl --user enable pipewire.socket pipewire-pulse.socket"
313 + elog
314 + elog "A reboot is recommended to avoid interferences from still running"
315 + elog "PulseAudio daemon."
316 + elog
317 + elog "Both new users and those upgrading need to enable WirePlumber"
318 + elog "for relevant users:"
319 + elog
320 + elog " systemctl --user disable pipewire-media-session.service"
321 + elog " systemctl --user --force enable wireplumber.service"
322 + elog
323 + elog "Root user may replace --user with --global to change system default"
324 + elog "configuration for all of the above commands."
325 + else
326 + ewarn "PipeWire daemon startup has been moved to a launcher script!"
327 + ewarn "Make sure that ${EROOT}/etc/pipewire/pipewire.conf either does not exist or no"
328 + ewarn "longer is set to start a session manager or PulseAudio compatibility daemon (all"
329 + ewarn "lines similar to '{ path = /usr/bin/pipewire*' should be commented out)"
330 + ewarn
331 + ewarn "Those manually starting /usr/bin/pipewire via .xinitrc or similar _must_ from"
332 + ewarn "now on start ${EROOT}/usr/bin/gentoo-pipewire-launcher instead! It is highly"
333 + ewarn "advised that a D-Bus user session is set up before starting the script."
334 + ewarn
335 + if has_version 'media-sound/pulseaudio[daemon]' || has_version 'media-sound/pulseaudio-daemon'; then
336 + elog "This ebuild auto-enables PulseAudio replacement. Because of that, users"
337 + elog "are recommended to edit: ${EROOT}/etc/pulse/client.conf and disable"
338 + elog "autospawning of the original daemon by setting:"
339 + elog
340 + elog " autospawn = no"
341 + elog
342 + elog "Please note that the semicolon (;) must _NOT_ be at the beginning of the line!"
343 + elog
344 + elog "Alternatively, if replacing PulseAudio daemon is not desired, edit"
345 + elog "${EROOT}/usr/bin/gentoo-pipewire-launcher by commenting out the relevant"
346 + elog "command:"
347 + elog
348 + elog "#${EROOT}/usr/bin/pipewire -c pipewire-pulse.conf &"
349 + elog
350 + fi
351 + elog "NOTE:"
352 + elog "Starting with PipeWire-0.3.30, this package is no longer installing its config"
353 + elog "into ${EROOT}/etc/pipewire by default. In case you need to change"
354 + elog "its config, please start by copying default config from ${EROOT}/usr/share/pipewire"
355 + elog "and just override the sections you want to change."
356 + fi
357 + elog
358 +
359 + elog "For latest tips and tricks, troubleshooting information and documentation"
360 + elog "in general, please refer to https://wiki.gentoo.org/wiki/PipeWire"
361 + elog
362 +
363 + optfeature_header "The following can be installed for optional runtime features:"
364 + optfeature "restricted realtime capabilities via D-Bus" sys-auth/rtkit
365 +
366 + if has_version 'net-misc/ofono' ; then
367 + ewarn "Native backend has become default. Please disable oFono via:"
368 + if systemd_is_booted ; then
369 + ewarn "systemctl disable ofono"
370 + else
371 + ewarn "rc-update delete ofono"
372 + fi
373 + ewarn
374 + fi
375 +
376 + if use system-service; then
377 + ewarn
378 + ewarn "WARNING: you have enabled the system-service USE flag, which installs"
379 + ewarn "the system-wide systemd units that enable PipeWire to run as a system"
380 + ewarn "service. This is more than likely NOT what you want. You are strongly"
381 + ewarn "advised not to enable this mode and instead stick with systemd user"
382 + ewarn "units. The default configuration files will likely not work out of"
383 + ewarn "box, and you are on your own with configuration."
384 + ewarn
385 + fi
386 +}