Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-video/pipewire/files/, media-video/pipewire/
Date: Sat, 24 Apr 2021 21:16:03
Message-Id: 1619298954.f788f389419678d2f2399eeb65fd2eedd7956196.whissi@gentoo
1 commit: f788f389419678d2f2399eeb65fd2eedd7956196
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Sat Apr 24 21:13:26 2021 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Sat Apr 24 21:15:54 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f788f389
7
8 media-video/pipewire: bump to v0.3.26
9
10 Closes: https://bugs.gentoo.org/775386
11 Package-Manager: Portage-3.0.18, Repoman-3.0.3
12 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
13
14 media-video/pipewire/Manifest | 1 +
15 media-video/pipewire/files/pipewire-launcher.sh | 6 +
16 media-video/pipewire/files/pipewire.desktop | 12 ++
17 media-video/pipewire/pipewire-0.3.26.ebuild | 243 ++++++++++++++++++++++++
18 4 files changed, 262 insertions(+)
19
20 diff --git a/media-video/pipewire/Manifest b/media-video/pipewire/Manifest
21 index 0fc9725e04f..4b42b099c84 100644
22 --- a/media-video/pipewire/Manifest
23 +++ b/media-video/pipewire/Manifest
24 @@ -1,2 +1,3 @@
25 DIST pipewire-0.3.22.tar.gz 1263844 BLAKE2B 3fb90c0b1c17ed108e8c390873f5c4527e1ff9241d1c5964ad5b7c01fbfefda901ef1228f178cf3c9899e6e8e75969a470f8fba63473ff203cba612c6c0553ca SHA512 a6587e0afd5c90be1733ecf62c6fc68e735ab3b84f2cbbf844bbe1be93e7a23dee07b041ed6b273cab6ab207d2388ae6f2027d0380928555a0155a7cc9ca4a7e
26 DIST pipewire-0.3.25.tar.gz 1351257 BLAKE2B 3c4d6d98e3255df8baf50eb548bcf77b5c027a50f6acedd83cd63481ed5b642c174589f34314f150b07116cea8a3458c3f8b770df4081585d7f75cc8dde4decd SHA512 0f84be21bfcd70f25900c53a8ce399c29ce2d4d10f8b56e5103603cf0c80673aab0b16492e55b42985283adf46343cdca01626225db85a2263f06c309f68f2d7
27 +DIST pipewire-0.3.26.tar.gz 1447673 BLAKE2B 67feb1288fcdc9ac5578b97ab2567b46a7431921291584bc9db2c2e60db074c3a61c3af9859d3b2f9044cfba6c15e9bfde9edc001b753f8fc47965eb55d751c8 SHA512 d771956a42801a6e07fac48a175363eb4107a9fba13d649ff5c2cdc40044c84a61bf56050783507f6dd8efae8c59a2be07ec67433827335ae60f8116c4a4e178
28
29 diff --git a/media-video/pipewire/files/pipewire-launcher.sh b/media-video/pipewire/files/pipewire-launcher.sh
30 new file mode 100644
31 index 00000000000..ecff3e7e708
32 --- /dev/null
33 +++ b/media-video/pipewire/files/pipewire-launcher.sh
34 @@ -0,0 +1,6 @@
35 +#!/bin/sh
36 +
37 +# We need to kill any existing pipewire instance to restore sound
38 +pkill -u "${USER}" -x pipewire 1>/dev/null 2>&1
39 +
40 +exec /usr/bin/pipewire
41
42 diff --git a/media-video/pipewire/files/pipewire.desktop b/media-video/pipewire/files/pipewire.desktop
43 new file mode 100644
44 index 00000000000..d3786e74f82
45 --- /dev/null
46 +++ b/media-video/pipewire/files/pipewire.desktop
47 @@ -0,0 +1,12 @@
48 +[Desktop Entry]
49 +Version=1.0
50 +Name[de]=PipeWire Mediensystem
51 +Name=PipeWire Media System
52 +Comment[de]=Das PipeWire Mediensystem starten
53 +Comment=Start the PipeWire Media System
54 +Exec=/usr/libexec/pipewire-launcher
55 +Terminal=false
56 +Type=Application
57 +X-GNOME-HiddenUnderSystemd=true
58 +X-KDE-HiddenUnderSystemd=true
59 +X-systemd-skip=true
60
61 diff --git a/media-video/pipewire/pipewire-0.3.26.ebuild b/media-video/pipewire/pipewire-0.3.26.ebuild
62 new file mode 100644
63 index 00000000000..a90b445a81d
64 --- /dev/null
65 +++ b/media-video/pipewire/pipewire-0.3.26.ebuild
66 @@ -0,0 +1,243 @@
67 +# Copyright 1999-2021 Gentoo Authors
68 +# Distributed under the terms of the GNU General Public License v2
69 +
70 +EAPI=7
71 +
72 +inherit meson optfeature udev
73 +
74 +if [[ ${PV} == 9999 ]]; then
75 + EGIT_REPO_URI="https://gitlab.freedesktop.org/${PN}/${PN}.git"
76 +# EGIT_BRANCH="master"
77 + inherit git-r3
78 +else
79 + SRC_URI="https://gitlab.freedesktop.org/${PN}/${PN}/-/archive/${PV}/${P}.tar.gz"
80 + KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86"
81 +fi
82 +
83 +DESCRIPTION="Multimedia processing graphs"
84 +HOMEPAGE="https://pipewire.org/"
85 +
86 +LICENSE="LGPL-2.1+"
87 +SLOT="0/0.3"
88 +IUSE="aac aptx bluetooth doc extra gstreamer jack-client ldac pipewire-alsa systemd test v4l"
89 +
90 +# Once replacing system JACK libraries is possible, it's likely that
91 +# jack-client IUSE will need blocking to avoid users accidentally
92 +# configuring their systems to send PW sink output to the emulated
93 +# JACK's sink - doing so is likely to yield no audio, cause a CPU
94 +# cycles consuming loop (and may even cause GUI crashes)!
95 +
96 +REQUIRED_USE="
97 + aac? ( bluetooth )
98 + aptx? ( bluetooth )
99 + ldac? ( bluetooth )
100 +"
101 +
102 +BDEPEND="
103 + app-doc/xmltoman
104 + doc? (
105 + app-doc/doxygen
106 + media-gfx/graphviz
107 + )
108 +"
109 +RDEPEND="
110 + media-libs/alsa-lib
111 + sys-apps/dbus
112 + sys-libs/ncurses[unicode]
113 + virtual/libudev
114 + bluetooth? (
115 + aac? ( media-libs/fdk-aac )
116 + aptx? ( media-libs/libopenaptx )
117 + ldac? ( media-libs/libldac )
118 + media-libs/sbc
119 + >=net-wireless/bluez-4.101:=
120 + )
121 + extra? (
122 + >=media-libs/libsndfile-1.0.20
123 + )
124 + gstreamer? (
125 + >=dev-libs/glib-2.32.0:2
126 + >=media-libs/gstreamer-1.10.0:1.0
127 + media-libs/gst-plugins-base:1.0
128 + )
129 + jack-client? ( >=media-sound/jack2-1.9.10:2[dbus] )
130 + pipewire-alsa? (
131 + >=media-libs/alsa-lib-1.1.7
132 + || (
133 + media-plugins/alsa-plugins[-pulseaudio]
134 + !media-plugins/alsa-plugins
135 + )
136 + )
137 + !pipewire-alsa? ( media-plugins/alsa-plugins[pulseaudio] )
138 + systemd? ( sys-apps/systemd )
139 + v4l? ( media-libs/libv4l )
140 +"
141 +
142 +DEPEND="${RDEPEND}"
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 +RESTRICT="!test? ( test )"
157 +
158 +PATCHES=(
159 + "${FILESDIR}"/${PN}-0.3.25-enable-failed-mlock-warning.patch
160 +)
161 +
162 +# limitsdfile related code taken from =sys-auth/realtime-base-0.1
163 +# with changes as necessary.
164 +limitsdfile=40-${PN}.conf
165 +
166 +src_prepare() {
167 + default
168 +
169 + if ! use systemd; then
170 + # This can be applied non-conditionally but would make for a
171 + # significantly worse user experience on systemd then.
172 + eapply "${FILESDIR}"/${PN}-0.3.25-non-systemd-integration.patch
173 + fi
174 +}
175 +
176 +src_configure() {
177 + local emesonargs=(
178 + -Ddocdir="${EPREFIX}"/usr/share/doc/${PF}
179 + $(meson_feature doc docs)
180 + -Dexamples=enabled # Disabling this implicitly disables -Dmedia-session (not good)
181 + -Dmedia-session=enabled
182 + -Dman=enabled
183 + $(meson_feature test tests)
184 + -Dinstalled_tests=disabled # Matches upstream; Gentoo never installs tests
185 + $(meson_feature gstreamer)
186 + $(meson_feature gstreamer gstreamer-device-provider)
187 + $(meson_feature systemd) # Also covers logind integration
188 + -Dsystemd-system-service=disabled # Matches upstream
189 + $(meson_feature systemd systemd-user-service)
190 + $(meson_feature pipewire-alsa) # Allows integrating ALSA apps into PW graph
191 + -Dpipewire-jack=enabled # Allows integrating JACK apps into PW graph
192 + #-Dlibjack-path="" # Where to install libjack.so et al (if an absolute path is used, remember to prefix it with ${EROOT} or similar!); setting this will also break pw-jack's multilib support (but presumably that's okay as the intended use would be to replace system's libraries making the loader irrelevant)
193 + -Dspa-plugins=enabled
194 + -Dalsa=enabled # Allows using kernel ALSA for sound I/O (-Dmedia-session depends on this)
195 + -Daudiomixer=enabled # Matches upstream
196 + -Daudioconvert=enabled # Matches upstream
197 + $(meson_feature bluetooth bluez5)
198 + $(meson_feature bluetooth bluez5-backend-hsp-native)
199 + $(meson_feature bluetooth bluez5-backend-hfp-native)
200 + $(meson_feature bluetooth bluez5-backend-ofono)
201 + $(meson_feature bluetooth bluez5-backend-hsphfpd)
202 + $(meson_feature aac bluez5-codec-aac)
203 + $(meson_feature aptx bluez5-codec-aptx)
204 + $(meson_feature ldac bluez5-codec-ldac)
205 + -Dcontrol=enabled # Matches upstream
206 + -Daudiotestsrc=enabled # Matches upstream
207 + -Dffmpeg=disabled # Disabled by upstream and no major developments to spa/plugins/ffmpeg/ since May 2020
208 + $(meson_feature jack-client jack) # Allows PW to act as a JACK client
209 + -Dsupport=enabled # Miscellaneous/common plugins, such as null sink
210 + -Devl=disabled # Matches upstream
211 + -Dtest=disabled # fakesink and fakesource plugins
212 + $(meson_feature v4l v4l2)
213 + -Dlibcamera=disabled # libcamera is not in Portage tree
214 + -Dvideoconvert=enabled # Matches upstream
215 + -Dvideotestsrc=enabled # Matches upstream
216 + -Dvolume=enabled # Matches upstream
217 + -Dvulkan=disabled # Uses pre-compiled Vulkan compute shader to provide a CGI video source (dev thing; disabled by upstream)
218 + $(meson_feature extra pw-cat)
219 + -Dudev=enabled
220 + -Dudevrulesdir="$(get_udevdir)/rules.d"
221 + -Dsdl2=disabled # Controls SDL2 dependent code (currently only examples when -Dinstalled_tests=enabled which we never install)
222 + $(meson_feature extra sndfile) # Enables libsndfile dependent code (currently only pw-cat)
223 + )
224 + meson_src_configure
225 +}
226 +
227 +src_compile() {
228 + meson_src_compile
229 +
230 + einfo "Generating ${limitsdfile}"
231 + cat > ${limitsdfile} <<- EOF || die
232 + # Start of ${limitsdfile} from ${P}
233 +
234 + 1000:60000 - memlock 256
235 +
236 + # End of ${limitsdfile} from ${P}
237 + EOF
238 +}
239 +
240 +src_install() {
241 + meson_src_install
242 +
243 + insinto /etc/security/limits.d
244 + doins ${limitsdfile}
245 +
246 + if use pipewire-alsa; then
247 + dodir /etc/alsa/conf.d
248 + # These will break if someone has /etc that is a symbol link to a subfolder! See #724222
249 + # And the current dosym8 -r implementation is likely affected by the same issue, too.
250 + dosym ../../../usr/share/alsa/alsa.conf.d/50-pipewire.conf /etc/alsa/conf.d/50-pipewire.conf
251 + dosym ../../../usr/share/alsa/alsa.conf.d/99-pipewire-default.conf /etc/alsa/conf.d/99-pipewire-default.conf
252 + fi
253 +
254 + if ! use systemd; then
255 + insinto /etc/xdg/autostart
256 + newins "${FILESDIR}"/pipewire.desktop pipewire.desktop
257 +
258 + exeinto /usr/libexec
259 + newexe "${FILESDIR}"/pipewire-launcher.sh pipewire-launcher
260 + fi
261 +}
262 +
263 +pkg_postinst() {
264 + if ! use pipewire-alsa; then
265 + elog "Contrary to what some online resources may suggest, avoid setting"
266 + elog "PULSE_LATENCY_MSEC environment variable since it may break ALSA clients."
267 + elog
268 + fi
269 +
270 + elog "JACK emulation is incomplete and not all programs will work. PipeWire's"
271 + elog "alternative libraries have been installed to a non-default location."
272 + elog "To use them, put pw-jack <application> before every JACK application."
273 + elog "When using pw-jack, do not run jackd/jackdbus. However, a virtual/jack"
274 + elog "provider is still needed to compile the JACK applications themselves."
275 + elog
276 +
277 + if use systemd; then
278 + elog "Per Gentoo policy installed systemd units must be manually enabled:"
279 + elog "systemctl --user disable pulseaudio.service pulseaudio.socket"
280 + elog "systemctl --user enable pipewire.socket pipewire-pulse.socket"
281 + elog "Rebooting is strongly recommended to avoid surprises from"
282 + elog "remnant PulseAudio daemon auto-spawning and surviving logouts."
283 + elog
284 + ewarn "Both new users and those upgrading need to enable pipewire-media-session:"
285 + ewarn "systemctl --user enable pipewire-media-session.service"
286 + else
287 + elog "This ebuild auto-enables PulseAudio replacement. Because of that users"
288 + elog "are recommended to edit: ${EROOT}/etc/pulse/client.conf and disable "
289 + elog "autospawn'ing of the original daemon by setting:"
290 + elog "autospawn = no"
291 + elog "Please note that the semicolon (;) must _NOT_ be at the beginning of the line!"
292 + elog
293 + elog "Alternatively, if replacing PulseAudio daemon is not desired, edit"
294 + elog "${EROOT}/etc/pipewire/pipewire.conf"
295 + elog "by commenting out the relevant command near the end of the file:"
296 + elog "#\"/usr/bin/pipewire\" = { args = \"-c pipewire-pulse.conf\" }"
297 + elog
298 + elog "It is still necessary to manually enable PipeWire startup. Setup specific"
299 + elog "instructions can be found at: https://wiki.gentoo.org/wiki/PipeWire"
300 + fi
301 +
302 + optfeature_header "The following can be installed for optional runtime features:"
303 + optfeature "restricted realtime capabilities vai D-Bus" sys-auth/rtkit
304 + # Once hsphfpd lands in tree, both it and ofono will need to be checked for presence here!
305 + if use bluetooth; then
306 + optfeature "better BT headset support (daemon startup required)" net-misc/ofono
307 + #optfeature "an oFono alternative (not packaged)" foo-bar/hsphfpd
308 + fi
309 +}