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-sound/pulseaudio/
Date: Sun, 20 Jun 2021 22:08:27
Message-Id: 1624226893.6c66f69d5e76fc323e084652a1f317a8a9eafa63.whissi@gentoo
1 commit: 6c66f69d5e76fc323e084652a1f317a8a9eafa63
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jun 20 22:07:52 2021 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Sun Jun 20 22:08:13 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6c66f69d
7
8 media-sound/pulseaudio: add initial PA 14.x ebuild
9
10 Thanks-to: Niklāvs Koļesņikovs
11 Thanks-to: Igor V. Kovalenko
12 Thanks-to: Joakim Tjernlund
13 Closes: https://github.com/gentoo/gentoo/pull/20388
14 Package-Manager: Portage-3.0.20, Repoman-3.0.3
15 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
16
17 media-sound/pulseaudio/Manifest | 1 +
18 media-sound/pulseaudio/metadata.xml | 4 +
19 media-sound/pulseaudio/pulseaudio-14.2_pre.ebuild | 354 ++++++++++++++++++++++
20 3 files changed, 359 insertions(+)
21
22 diff --git a/media-sound/pulseaudio/Manifest b/media-sound/pulseaudio/Manifest
23 index 8c2628da203..24bbfed06ca 100644
24 --- a/media-sound/pulseaudio/Manifest
25 +++ b/media-sound/pulseaudio/Manifest
26 @@ -1 +1,2 @@
27 DIST pulseaudio-13.0.tar.xz 1901768 BLAKE2B 651a80f54525f196bcb036d893fedd4d9f34e10459918281397a45f498c31bff0d0c836f4e64aab5ac2612ffd5a0cab1a41ea710bbee5fd34dfc9ea1236deea9 SHA512 d445b8ccd43029a0ca0e456fc9291a79d3434d6496ead7eb329ab348d5249235e8bde6cf2be68765d8f761452dbe1486fb10c739e40b1e67ed75787bbd24ac0c
28 +DIST pulseaudio-14.2.tar.xz 1951300 BLAKE2B 874a90da4188e5d7384792196996f8d68f691edfdfa630dce04a0f13e31b3273a6d1c5d46d56f851ebd15daf54a3fe4ddd14733b87f877b6ef5e2c982adf997b SHA512 196338cbb26c542301b6d0579070dfbcc42e76dc17405f3e216af70519bec2003089b80c573a32d5f96bdab078631ca09ce89998ab7a0a8ffa26955a9bcb3c4a
29
30 diff --git a/media-sound/pulseaudio/metadata.xml b/media-sound/pulseaudio/metadata.xml
31 index 38993dac40a..d6b7247df40 100644
32 --- a/media-sound/pulseaudio/metadata.xml
33 +++ b/media-sound/pulseaudio/metadata.xml
34 @@ -17,7 +17,11 @@
35 PulseAudio plugin enabled. This ensures that clients supporting
36 ALSA only will use PulseAudio.
37 </flag>
38 + <flag name="daemon">Build the pulseaudio binary (not-needed for pipewire-pulse)</flag>
39 <flag name="elogind">Use <pkg>sys-auth/elogind</pkg> for giving each session a PA client</flag>
40 + <flag name="forget-missing">
41 + Enables clearing of unavailable devices from database files which is recommended for GNOME.
42 + </flag>
43 <flag name="gconf">
44 Ensure <pkg>gnome-base/gconf</pkg> is present for pulseaudio GConf
45 to GSettings module automatic migration (keeping the user configuration)
46
47 diff --git a/media-sound/pulseaudio/pulseaudio-14.2_pre.ebuild b/media-sound/pulseaudio/pulseaudio-14.2_pre.ebuild
48 new file mode 100644
49 index 00000000000..032227d4dc9
50 --- /dev/null
51 +++ b/media-sound/pulseaudio/pulseaudio-14.2_pre.ebuild
52 @@ -0,0 +1,354 @@
53 +# Copyright 1999-2021 Gentoo Authors
54 +# Distributed under the terms of the GNU General Public License v2
55 +
56 +EAPI="7"
57 +
58 +MY_PV="${PV/_pre*}"
59 +MY_P="${PN}-${MY_PV}"
60 +
61 +inherit bash-completion-r1 gnome2-utils meson-multilib optfeature systemd udev
62 +
63 +DESCRIPTION="A networked sound server with an advanced plugin system"
64 +HOMEPAGE="https://www.freedesktop.org/wiki/Software/PulseAudio/"
65 +
66 +if [[ ${PV} = 9999 ]]; then
67 + inherit git-r3
68 + EGIT_BRANCH="master"
69 + EGIT_REPO_URI="https://gitlab.freedesktop.org/${PN}/${PN}"
70 +else
71 + SRC_URI="https://freedesktop.org/software/${PN}/releases/${MY_P}.tar.xz"
72 + #KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux"
73 +fi
74 +
75 +# libpulse-simple and libpulse link to libpulse-core; this is daemon's
76 +# library and can link to gdbm and other GPL-only libraries. In this
77 +# cases, we have a fully GPL-2 package. Leaving the rest of the
78 +# GPL-forcing USE flags for those who use them.
79 +LICENSE="!gdbm? ( LGPL-2.1 ) gdbm? ( GPL-2 )"
80 +
81 +SLOT="0"
82 +
83 +# +alsa-plugin as discussed in bug #519530
84 +# TODO: Deal with bluez5-gstreamer
85 +# TODO: Find out why webrtc-aec is + prefixed - there's already the always available speexdsp-aec
86 +# NOTE: The current ebuild sets +X almost certainly just for the pulseaudio.desktop file
87 +IUSE="+alsa +alsa-plugin +asyncns bluetooth dbus +daemon doc elogind equalizer forget-missing +gdbm
88 +gstreamer +glib gtk ipv6 jack lirc native-headset ofono-headset +orc oss selinux sox ssl systemd
89 +system-wide tcpd test +udev +webrtc-aec +X zeroconf"
90 +
91 +RESTRICT="!test? ( test )"
92 +
93 +# See "*** BLUEZ support not found (requires D-Bus)" in configure.ac
94 +# Basically all IUSE are either ${MULTILIB_USEDEP} for client libs or they belong under !daemon ()
95 +# We duplicate alsa-plugin, {native,ofono}-headset under daemon to let users deal with them at once
96 +REQUIRED_USE="
97 + alsa-plugin? ( alsa )
98 + bluetooth? ( dbus )
99 + daemon? ( ?? ( elogind systemd ) )
100 + !daemon? (
101 + !alsa
102 + !alsa-plugin
103 + !bluetooth
104 + !equalizer
105 + !gdbm
106 + !gtk
107 + !jack
108 + !lirc
109 + !native-headset
110 + !ofono-headset
111 + !orc
112 + !oss
113 + !sox
114 + !ssl
115 + !system-wide
116 + !udev
117 + !webrtc-aec
118 + !zeroconf
119 + )
120 + equalizer? ( dbus )
121 + native-headset? ( bluetooth )
122 + ofono-headset? ( bluetooth )
123 + udev? ( || ( alsa oss ) )
124 + zeroconf? ( dbus )
125 +"
126 +
127 +# NOTE:
128 +# - dev-libs/libpcre header will be used if found but no linking is done
129 +# on non-Windows
130 +# - meson is currently always checking for doxygen,
131 +# see https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1226
132 +BDEPEND="
133 + app-doc/doxygen
134 + dev-libs/libpcre
135 + sys-devel/gettext
136 + sys-devel/m4
137 + virtual/libiconv
138 + virtual/libintl
139 + virtual/pkgconfig
140 + orc? ( >=dev-lang/orc-0.4.15 )
141 + system-wide? ( dev-util/unifdef )
142 + test? ( >=dev-libs/check-0.9.10 )
143 +"
144 +
145 +# NOTE:
146 +# - libpcre needed in some cases, bug #472228
147 +# - media-libs/speexdsp is providing echo canceller implementation
148 +COMMON_DEPEND="
149 + >=media-libs/libsndfile-1.0.20[${MULTILIB_USEDEP}]
150 + >=media-libs/speexdsp-1.2[${MULTILIB_USEDEP}]
151 + virtual/libc
152 + alsa? ( >=media-libs/alsa-lib-1.0.24 )
153 + asyncns? ( >=net-libs/libasyncns-0.1[${MULTILIB_USEDEP}] )
154 + bluetooth? (
155 + >=net-wireless/bluez-5
156 + media-libs/sbc
157 + )
158 + daemon? (
159 + dev-libs/libltdl
160 + sys-kernel/linux-headers
161 + )
162 + dbus? ( >=sys-apps/dbus-1.4.12[${MULTILIB_USEDEP}] )
163 + elogind? ( sys-auth/elogind )
164 + equalizer? (
165 + sci-libs/fftw:3.0
166 + )
167 + gdbm? ( sys-libs/gdbm:= )
168 + glib? ( >=dev-libs/glib-2.28.0:2[${MULTILIB_USEDEP}] )
169 + gstreamer? (
170 + media-libs/gst-plugins-base
171 + >=media-libs/gstreamer-1.14
172 + )
173 + gtk? ( x11-libs/gtk+:3 )
174 + jack? ( virtual/jack )
175 + lirc? ( app-misc/lirc )
176 + ofono-headset? ( >=net-misc/ofono-1.13 )
177 + orc? ( >=dev-lang/orc-0.4.15 )
178 + selinux? ( sec-policy/selinux-pulseaudio )
179 + sox? ( >=media-libs/soxr-0.1.1 )
180 + ssl? ( dev-libs/openssl:= )
181 + systemd? ( sys-apps/systemd:=[${MULTILIB_USEDEP}] )
182 + tcpd? ( sys-apps/tcp-wrappers[${MULTILIB_USEDEP}] )
183 + udev? ( >=virtual/udev-143[hwdb(+)] )
184 + webrtc-aec? ( >=media-libs/webrtc-audio-processing-0.2 )
185 + X? (
186 + >=x11-libs/libxcb-1.6[${MULTILIB_USEDEP}]
187 + daemon? (
188 + x11-libs/libICE
189 + x11-libs/libSM
190 + >=x11-libs/libX11-1.4.0
191 + >=x11-libs/libXtst-1.0.99.2
192 + )
193 + )
194 + zeroconf? ( >=net-dns/avahi-0.6.12[dbus] )
195 +"
196 +
197 +DEPEND="
198 + ${COMMON_DEPEND}
199 + dev-libs/libatomic_ops
200 + X? ( x11-base/xorg-proto )
201 +"
202 +
203 +# alsa-utils dep is for the alsasound init.d script (see bug 155707); TODO: read it
204 +# NOTE: Only system-wide needs acct-group/audio unless elogind/systemd is not used
205 +RDEPEND="
206 + ${COMMON_DEPEND}
207 + system-wide? (
208 + alsa? ( media-sound/alsa-utils )
209 + acct-user/pulse
210 + acct-group/audio
211 + acct-group/pulse-access
212 + )
213 +"
214 +
215 +# This is a PDEPEND to avoid a circular dep
216 +PDEPEND="
217 + alsa? ( alsa-plugin? ( >=media-plugins/alsa-plugins-1.0.27-r1[pulseaudio,${MULTILIB_USEDEP}] ) )
218 +"
219 +
220 +DOCS=( NEWS README )
221 +
222 +S="${WORKDIR}/${MY_P}"
223 +
224 +src_prepare() {
225 + default
226 +
227 + gnome2_environment_reset
228 +}
229 +
230 +multilib_src_configure() {
231 + local emesonargs=(
232 + -Dadrian-aec=false # Not packaged?
233 + --localstatedir="${EPREFIX}"/var
234 + -Dmodlibexecdir="${EPREFIX}/usr/$(get_libdir)/${PN}/modules" # Was $(get_libdir)/${P}
235 + -Dsystemduserunitdir=$(systemd_get_userunitdir)
236 + -Dudevrulesdir="$(get_udevdir)"/rules.d
237 + -Dbashcompletiondir="$(get_bashcompdir)" # Alternatively DEPEND on app-shells/bash-completion for pkg-config to provide the value
238 + $(meson_native_use_feature alsa)
239 + $(meson_native_use_bool bluetooth bluez5)
240 + $(meson_native_use_bool daemon)
241 + $(meson_native_use_bool native-headset bluez5-native-headset)
242 + $(meson_native_use_bool ofono-headset bluez5-ofono-headset)
243 + $(meson_native_use_feature glib gsettings) # Supposedly correct?
244 + $(meson_native_use_feature gstreamer)
245 + $(meson_native_use_feature gtk)
246 + $(meson_native_use_feature jack)
247 + -Dsamplerate=disabled # Matches upstream
248 + $(meson_native_use_feature lirc)
249 + $(meson_native_use_feature orc)
250 + $(meson_native_use_feature oss oss-output)
251 + $(meson_native_use_feature ssl openssl)
252 + # tests involve random modules, so just do them for the native # TODO: tests should run always
253 + $(meson_native_use_bool test tests)
254 + $(meson_native_use_feature udev)
255 + $(meson_native_use_feature webrtc-aec)
256 + $(meson_native_use_feature zeroconf avahi)
257 + $(meson_native_use_feature equalizer fftw)
258 + $(meson_native_use_feature sox soxr)
259 + -Ddatabase=$(multilib_native_usex gdbm gdbm simple) # tdb is also an option but no one cares about it
260 + $(meson_use forget-missing stream-restore-clear-old-devices)
261 + $(meson_feature glib) # WARNING: toggling this likely changes ABI
262 + $(meson_feature asyncns)
263 + #$(meson_use cpu_flags_arm_neon neon-opt)
264 + $(meson_feature tcpd tcpwrap) # TODO: system-wide specific?
265 + $(meson_feature dbus)
266 + $(meson_feature elogind)
267 + $(meson_feature X x11)
268 + $(meson_feature systemd)
269 + $(meson_use ipv6)
270 + )
271 +
272 + if multilib_is_native_abi; then
273 + # Make padsp work for non-native ABI, supposedly only possible with glibc;
274 + # this is used by /usr/bin/padsp that comes from native build, thus we need
275 + # this argument for native build
276 + if use elibc_glibc; then
277 + emesonargs+=( -Dpulsedsp-location="${EPREFIX}"'/usr/\\$$LIB/pulseaudio' )
278 + fi
279 + else
280 + if ! use elibc_glibc; then
281 + # Non-glibc multilib is probably non-existent but just in case:
282 + ewarn "padsp wrapper for OSS emulation will only work with native ABI applications!"
283 + fi
284 + fi
285 +
286 + meson_src_configure
287 +}
288 +
289 +multilib_src_compile() {
290 + meson_src_compile
291 +
292 + if multilib_is_native_abi; then
293 + if use doc; then
294 + einfo "Generating documentation ..."
295 + meson_src_compile doxygen
296 + fi
297 + fi
298 +}
299 +
300 +multilib_src_install() {
301 + # The files referenced in the DOCS array do not exist in the multilib source directory,
302 + # therefore clear the variable when calling the function that will access it.
303 + DOCS= meson_src_install
304 +
305 + if multilib_is_native_abi; then
306 + if use doc; then
307 + einfo "Installing documentation ..."
308 + docinto html
309 + dodoc -r doxygen/html/.
310 + fi
311 + fi
312 +}
313 +
314 +multilib_src_install_all() {
315 + einstalldocs
316 +
317 + if use system-wide; then
318 + newconfd "${FILESDIR}"/pulseaudio.conf.d pulseaudio
319 +
320 + use_define() {
321 + local define=${2:-$(echo ${1} | tr '[:lower:]' '[:upper:]')}
322 +
323 + use "${1}" && echo "-D${define}" || echo "-U${define}"
324 + }
325 +
326 + unifdef \
327 + $(use_define zeroconf AVAHI) \
328 + $(use_define alsa) \
329 + $(use_define bluetooth) \
330 + $(use_define udev) \
331 + "${FILESDIR}"/pulseaudio.init.d-5 \
332 + > "${T}"/pulseaudio \
333 + || die
334 +
335 + doinitd "${T}"/pulseaudio
336 +
337 + systemd_dounit "${FILESDIR}"/${PN}.service
338 +
339 + # We need /var/run/pulse, bug 442852
340 + systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}.conf
341 + else
342 + # Prevent warnings when system-wide is not used, bug 447694
343 + if use dbus && use daemon; then
344 + rm "${ED}"/etc/dbus-1/system.d/pulseaudio-system.conf || die
345 + fi
346 + fi
347 +
348 + if use zeroconf; then
349 + sed -i \
350 + -e '/module-zeroconf-publish/s:^#::' \
351 + "${ED}/etc/pulse/default.pa" \
352 + || die
353 + fi
354 +
355 + find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
356 +}
357 +
358 +pkg_postinst() {
359 + gnome2_schemas_update
360 +
361 + if use system-wide; then
362 + elog "You have enabled the 'system-wide' USE flag for pulseaudio."
363 + elog "This mode should only be used on headless servers, embedded systems,"
364 + elog "or thin clients. It will usually require manual configuration, and is"
365 + elog "incompatible with many expected pulseaudio features."
366 + elog "On normal desktop systems, system-wide mode is STRONGLY DISCOURAGED."
367 + elog ""
368 + elog "For more information, see"
369 + elog " https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/WhatIsWrongWithSystemWide/"
370 + elog " https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/SystemWide/"
371 + elog " https://wiki.gentoo.org/wiki/PulseAudio#Headless_server"
372 + elog ""
373 + fi
374 +
375 + if use equalizer; then
376 + elog "You will need to load some extra modules to make qpaeq work."
377 + elog "You can do that by adding the following two lines in"
378 + elog "/etc/pulse/default.pa and restarting pulseaudio:"
379 + elog "load-module module-equalizer-sink"
380 + elog "load-module module-dbus-protocol"
381 + elog ""
382 + fi
383 +
384 + if use native-headset && use ofono-headset; then
385 + elog "You have enabled both native and ofono headset profiles. The runtime decision"
386 + elog "which to use is done via the 'headset' argument of module-bluetooth-discover."
387 + elog ""
388 + fi
389 +
390 + if use systemd && use daemon; then
391 + elog "It's recommended to start pulseaudio via its systemd user units:"
392 + elog ""
393 + elog " systemctl --user enable pulseaudio.service pulseaudio.socket"
394 + elog ""
395 + elog "The change from autospawn to user units will take effect after restarting."
396 + elog ""
397 + fi
398 +
399 + optfeature_header "PulseAudio can be enhanced by installing the following:"
400 + use equalizer && optfeature "using the qpaeq script" dev-python/PyQt5[dbus,widgets]
401 + use dbus && optfeature "restricted realtime capabilities via D-Bus" sys-auth/rtkit
402 +}
403 +
404 +pkg_postrm() {
405 + gnome2_schemas_update
406 +}