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