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