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: 1656976571.fac4d19f4f5f8f0ff0c9514dd58f24d0ccc55662.sam@gentoo
1 commit: fac4d19f4f5f8f0ff0c9514dd58f24d0ccc55662
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jul 4 23:16:11 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Mon Jul 4 23:16:11 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fac4d19f
7
8 media-video/pipewire: add ewarn for upgrades w/o USE=sound-server; sync live
9
10 Signed-off-by: Sam James <sam <AT> gentoo.org>
11
12 ...ire-0.3.53.ebuild => pipewire-0.3.53-r1.ebuild} | 12 +++++++
13 media-video/pipewire/pipewire-9999.ebuild | 42 ++++++++++++++++++++--
14 2 files changed, 52 insertions(+), 2 deletions(-)
15
16 diff --git a/media-video/pipewire/pipewire-0.3.53.ebuild b/media-video/pipewire/pipewire-0.3.53-r1.ebuild
17 similarity index 97%
18 rename from media-video/pipewire/pipewire-0.3.53.ebuild
19 rename to media-video/pipewire/pipewire-0.3.53-r1.ebuild
20 index e9b41b72f455..f881800c5a79 100644
21 --- a/media-video/pipewire/pipewire-0.3.53.ebuild
22 +++ b/media-video/pipewire/pipewire-0.3.53-r1.ebuild
23 @@ -295,6 +295,18 @@ pkg_postinst() {
24 elog " usermod -aG audio <youruser>"
25 elog
26
27 + local ver
28 + for ver in ${REPLACING_VERSIONS} ; do
29 + if ver_test ${ver} -le 0.3.53-r1 && ! use sound-server ; then
30 + ewarn "USE=sound-server is disabled! If you want PipeWire to provide"
31 + ewarn "your sound, please enable it. See the wiki at"
32 + ewarn "https://wiki.gentoo.org/wiki/PipeWire#Replacing_PulseAudio"
33 + ewarn "for more details."
34 +
35 + break
36 + fi
37 + done
38 +
39 if ! use jack-sdk; then
40 elog "JACK emulation is incomplete and not all programs will work. PipeWire's"
41 elog "alternative libraries have been installed to a non-default location."
42
43 diff --git a/media-video/pipewire/pipewire-9999.ebuild b/media-video/pipewire/pipewire-9999.ebuild
44 index 9ab78449ccc3..f881800c5a79 100644
45 --- a/media-video/pipewire/pipewire-9999.ebuild
46 +++ b/media-video/pipewire/pipewire-9999.ebuild
47 @@ -28,7 +28,8 @@ HOMEPAGE="https://pipewire.org/"
48 LICENSE="MIT LGPL-2.1+ GPL-2"
49 # ABI was broken in 0.3.42 for https://gitlab.freedesktop.org/pipewire/wireplumber/-/issues/49
50 SLOT="0/0.4"
51 -IUSE="bluetooth doc echo-cancel extra gstreamer jack-client jack-sdk lv2 pipewire-alsa ssl system-service systemd test udev v4l X zeroconf"
52 +IUSE="bluetooth doc echo-cancel extra gstreamer jack-client jack-sdk lv2 pipewire-alsa
53 +sound-server ssl system-service systemd test udev v4l X zeroconf"
54
55 # Once replacing system JACK libraries is possible, it's likely that
56 # jack-client IUSE will need blocking to avoid users accidentally
57 @@ -36,9 +37,15 @@ IUSE="bluetooth doc echo-cancel extra gstreamer jack-client jack-sdk lv2 pipewir
58 # JACK's sink - doing so is likely to yield no audio, cause a CPU
59 # cycles consuming loop (and may even cause GUI crashes)!
60
61 +# TODO: There should be "sound-server? ( || ( alsa bluetooth ) )" here, but ALSA is always enabled
62 +# TODO: Pulseaudio alsa plugin performs runtime check that pulseaudio server connection will work
63 +# which provides adequate guarantee that alsa-lib will be able to provide audio services.
64 +# If that works, pulseaudio defaults are loaded into alsa-lib runtime replacing default PCM and CTL.
65 +# When pipewire-alsa will be able to perform similar check, pipewire-alsa can be enabled unconditionally.
66 REQUIRED_USE="
67 jack-sdk? ( !jack-client )
68 system-service? ( systemd )
69 + !sound-server? ( !pipewire-alsa )
70 "
71
72 RESTRICT="!test? ( test )"
73 @@ -87,6 +94,10 @@ RDEPEND="
74 >=media-libs/alsa-lib-1.1.7[${MULTILIB_USEDEP}]
75 )
76 !pipewire-alsa? ( media-plugins/alsa-plugins[${MULTILIB_USEDEP},pulseaudio] )
77 + sound-server? (
78 + !media-sound/pulseaudio[daemon(+)]
79 + !media-sound/pulseaudio-daemon
80 + )
81 ssl? ( dev-libs/openssl:= )
82 systemd? ( sys-apps/systemd )
83 system-service? (
84 @@ -250,12 +261,26 @@ multilib_src_install_all() {
85 dosym ../../../usr/share/alsa/alsa.conf.d/99-pipewire-default-hook.conf /etc/alsa/conf.d/99-pipewire-default-hook.conf
86 fi
87
88 + # Enable required wireplumber alsa and bluez monitors
89 + if use sound-server; then
90 + dodir /etc/wireplumber/main.lua.d
91 + echo "alsa_monitor.enabled = true" > ${D}/etc/wireplumber/main.lua.d/89-gentoo-sound-server-enable-alsa-monitor.lua
92 + dodir /etc/wireplumber/bluetooth.lua.d
93 + echo "bluez_monitor.enabled = true" > ${D}/etc/wireplumber/bluetooth.lua.d/89-gentoo-sound-server-enable-bluez-monitor.lua
94 + fi
95 +
96 if ! use systemd; then
97 insinto /etc/xdg/autostart
98 newins "${FILESDIR}"/pipewire.desktop-r1 pipewire.desktop
99
100 exeinto /usr/bin
101 newexe "${FILESDIR}"/gentoo-pipewire-launcher.in gentoo-pipewire-launcher
102 +
103 + # Disable pipewire-pulse if sound-server is disabled.
104 + if ! use sound-server ; then
105 + sed -i -s '/pipewire -c pipewire-pulse.conf/s/^/#/' "${ED}"/usr/bin/gentoo-pipewire-launcher || die
106 + fi
107 +
108 eprefixify "${ED}"/usr/bin/gentoo-pipewire-launcher
109 fi
110 }
111 @@ -270,6 +295,18 @@ pkg_postinst() {
112 elog " usermod -aG audio <youruser>"
113 elog
114
115 + local ver
116 + for ver in ${REPLACING_VERSIONS} ; do
117 + if ver_test ${ver} -le 0.3.53-r1 && ! use sound-server ; then
118 + ewarn "USE=sound-server is disabled! If you want PipeWire to provide"
119 + ewarn "your sound, please enable it. See the wiki at"
120 + ewarn "https://wiki.gentoo.org/wiki/PipeWire#Replacing_PulseAudio"
121 + ewarn "for more details."
122 +
123 + break
124 + fi
125 + done
126 +
127 if ! use jack-sdk; then
128 elog "JACK emulation is incomplete and not all programs will work. PipeWire's"
129 elog "alternative libraries have been installed to a non-default location."
130 @@ -310,7 +347,8 @@ pkg_postinst() {
131 ewarn "now on start ${EROOT}/usr/bin/gentoo-pipewire-launcher instead! It is highly"
132 ewarn "advised that a D-Bus user session is set up before starting the script."
133 ewarn
134 - if has_version 'media-sound/pulseaudio[daemon]' || has_version 'media-sound/pulseaudio-daemon'; then
135 +
136 + if use sound-server && ( has_version 'media-sound/pulseaudio[daemon]' || has_version 'media-sound/pulseaudio-daemon' ) ; then
137 elog "This ebuild auto-enables PulseAudio replacement. Because of that, users"
138 elog "are recommended to edit pulseaudio client configuration files:"
139 elog "${EROOT}/etc/pulse/client.conf and ${EROOT}/etc/pulse/client.conf.d/enable-autospawn.conf"