Gentoo Archives: gentoo-commits

From: Craig Andrews <candrews@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-sound/pulseaudio/
Date: Thu, 28 Jun 2018 15:12:46
Message-Id: 1530198751.24dfe71df62d2c5ede295f0113ba7e3d46aea723.candrews@gentoo
1 commit: 24dfe71df62d2c5ede295f0113ba7e3d46aea723
2 Author: Craig Andrews <candrews <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jun 26 17:28:44 2018 +0000
4 Commit: Craig Andrews <candrews <AT> gentoo <DOT> org>
5 CommitDate: Thu Jun 28 15:12:31 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=24dfe71d
7
8 media-sound/pulseaudio: pkg_postinst/pkg_postrm gnome2_schemas_update
9
10 Closes: https://bugs.gentoo.org/658710
11 Package-Manager: Portage-2.3.40, Repoman-2.3.9
12
13 media-sound/pulseaudio/pulseaudio-12.0-r2.ebuild | 344 +++++++++++++++++++++++
14 1 file changed, 344 insertions(+)
15
16 diff --git a/media-sound/pulseaudio/pulseaudio-12.0-r2.ebuild b/media-sound/pulseaudio/pulseaudio-12.0-r2.ebuild
17 new file mode 100644
18 index 00000000000..9279212c9ae
19 --- /dev/null
20 +++ b/media-sound/pulseaudio/pulseaudio-12.0-r2.ebuild
21 @@ -0,0 +1,344 @@
22 +# Copyright 1999-2018 Gentoo Foundation
23 +# Distributed under the terms of the GNU General Public License v2
24 +
25 +EAPI=6
26 +inherit autotools bash-completion-r1 flag-o-matic gnome2-utils linux-info systemd user udev multilib-minimal
27 +
28 +DESCRIPTION="A networked sound server with an advanced plugin system"
29 +HOMEPAGE="https://www.freedesktop.org/wiki/Software/PulseAudio/"
30 +SRC_URI="https://freedesktop.org/software/pulseaudio/releases/${P}.tar.xz"
31 +
32 +# libpulse-simple and libpulse link to libpulse-core; this is daemon's
33 +# library and can link to gdbm and other GPL-only libraries. In this
34 +# cases, we have a fully GPL-2 package. Leaving the rest of the
35 +# GPL-forcing USE flags for those who use them.
36 +LICENSE="!gdbm? ( LGPL-2.1 ) gdbm? ( GPL-2 )"
37 +
38 +SLOT="0"
39 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86 ~amd64-fbsd ~amd64-linux ~x86-linux"
40 +
41 +# +alsa-plugin as discussed in bug #519530
42 +IUSE="+alsa +alsa-plugin +asyncns bluetooth +caps dbus doc equalizer gconf +gdbm
43 ++glib gtk ipv6 jack libsamplerate libressl lirc native-headset neon ofono-headset
44 ++orc oss qt5 realtime selinux sox ssl systemd system-wide tcpd test +udev
45 ++webrtc-aec +X zeroconf"
46 +
47 +# See "*** BLUEZ support not found (requires D-Bus)" in configure.ac
48 +REQUIRED_USE="
49 + bluetooth? ( dbus )
50 + equalizer? ( dbus )
51 + ofono-headset? ( bluetooth )
52 + native-headset? ( bluetooth )
53 + udev? ( || ( alsa oss ) )
54 +"
55 +
56 +# libpcre needed in some cases, bug #472228
57 +CDEPEND="
58 + || (
59 + elibc_glibc? ( virtual/libc )
60 + elibc_uclibc? ( virtual/libc )
61 + dev-libs/libpcre
62 + )
63 + >=media-libs/libsndfile-1.0.20[${MULTILIB_USEDEP}]
64 + X? (
65 + >=x11-libs/libX11-1.4.0[${MULTILIB_USEDEP}]
66 + >=x11-libs/libxcb-1.6[${MULTILIB_USEDEP}]
67 + x11-libs/libSM[${MULTILIB_USEDEP}]
68 + x11-libs/libICE[${MULTILIB_USEDEP}]
69 + x11-libs/libXtst[${MULTILIB_USEDEP}]
70 + )
71 + caps? ( >=sys-libs/libcap-2.22-r2[${MULTILIB_USEDEP}] )
72 + libsamplerate? ( >=media-libs/libsamplerate-0.1.1-r1 )
73 + alsa? ( >=media-libs/alsa-lib-1.0.19 )
74 + glib? ( >=dev-libs/glib-2.26.0:2[${MULTILIB_USEDEP}] )
75 + zeroconf? ( >=net-dns/avahi-0.6.12[dbus] )
76 + jack? ( virtual/jack )
77 + tcpd? ( sys-apps/tcp-wrappers[${MULTILIB_USEDEP}] )
78 + lirc? ( app-misc/lirc )
79 + dbus? ( >=sys-apps/dbus-1.0.0[${MULTILIB_USEDEP}] )
80 + gtk? ( x11-libs/gtk+:3 )
81 + bluetooth? (
82 + >=net-wireless/bluez-5
83 + >=sys-apps/dbus-1.0.0
84 + media-libs/sbc
85 + )
86 + asyncns? ( net-libs/libasyncns[${MULTILIB_USEDEP}] )
87 + udev? ( >=virtual/udev-143[hwdb(+)] )
88 + realtime? ( sys-auth/rtkit )
89 + equalizer? ( sci-libs/fftw:3.0 )
90 + ofono-headset? ( >=net-misc/ofono-1.13 )
91 + orc? ( >=dev-lang/orc-0.4.15 )
92 + sox? ( >=media-libs/soxr-0.1.1 )
93 + ssl? (
94 + !libressl? ( dev-libs/openssl:0= )
95 + libressl? ( dev-libs/libressl:= )
96 + )
97 + media-libs/speexdsp
98 + gdbm? ( sys-libs/gdbm:= )
99 + webrtc-aec? ( >=media-libs/webrtc-audio-processing-0.2 )
100 + systemd? ( sys-apps/systemd:0=[${MULTILIB_USEDEP}] )
101 + dev-libs/libltdl:0
102 + selinux? ( sec-policy/selinux-pulseaudio )
103 +"
104 +# it's a valid RDEPEND, libltdl.so is used for native abi
105 +RDEPEND="${CDEPEND}
106 + gconf? ( >=gnome-base/gconf-3.2.6 )
107 +"
108 +
109 +DEPEND="${RDEPEND}
110 + sys-devel/m4
111 + doc? ( app-doc/doxygen )
112 + test? ( >=dev-libs/check-0.9.10 )
113 + X? (
114 + x11-base/xorg-proto
115 + >=x11-libs/libXtst-1.0.99.2[${MULTILIB_USEDEP}]
116 + )
117 + dev-libs/libatomic_ops
118 + virtual/pkgconfig
119 + system-wide? ( || ( dev-util/unifdef sys-freebsd/freebsd-ubin ) )
120 + dev-util/intltool
121 + >=sys-devel/gettext-0.18.1
122 +"
123 +# This is a PDEPEND to avoid a circular dep
124 +PDEPEND="
125 + alsa? ( alsa-plugin? ( >=media-plugins/alsa-plugins-1.0.27-r1[pulseaudio,${MULTILIB_USEDEP}] ) )
126 +"
127 +
128 +# alsa-utils dep is for the alsasound init.d script (see bug #155707)
129 +# bluez dep is for the bluetooth init.d script
130 +# PyQt5 dep is for the qpaeq script
131 +RDEPEND="${RDEPEND}
132 + equalizer? ( qt5? ( dev-python/PyQt5[dbus,widgets] ) )
133 + system-wide? (
134 + alsa? ( media-sound/alsa-utils )
135 + bluetooth? ( >=net-wireless/bluez-5 )
136 + )
137 +"
138 +
139 +PATCHES=(
140 + "${FILESDIR}"/pulseaudio-11.1-disable-flat-volumes.patch # bug 627894
141 +)
142 +
143 +pkg_pretend() {
144 + CONFIG_CHECK="~HIGH_RES_TIMERS"
145 + WARNING_HIGH_RES_TIMERS="CONFIG_HIGH_RES_TIMERS:\tis not set (required for enabling timer-based scheduling in pulseaudio)\n"
146 + check_extra_config
147 +
148 + if linux_config_exists; then
149 + local snd_hda_prealloc_size=$(linux_chkconfig_string SND_HDA_PREALLOC_SIZE)
150 + if [ -n "${snd_hda_prealloc_size}" ] && [ "${snd_hda_prealloc_size}" -lt 2048 ]; then
151 + ewarn "A preallocated buffer-size of 2048 (kB) or higher is recommended for the HD-audio driver!"
152 + ewarn "CONFIG_SND_HDA_PREALLOC_SIZE=${snd_hda_prealloc_size}"
153 + fi
154 + fi
155 +}
156 +
157 +pkg_setup() {
158 + linux-info_pkg_setup
159 + gnome2_environment_reset #543364
160 +
161 + enewgroup audio 18 # Just make sure it exists
162 +
163 + if use system-wide; then
164 + enewgroup pulse-access
165 + enewgroup pulse
166 + enewuser pulse -1 -1 /var/run/pulse pulse,audio
167 + fi
168 +}
169 +
170 +src_prepare() {
171 + default
172 +
173 + # Skip test that cannot work with sandbox, bug #501846
174 + sed -i -e '/lock-autospawn-test/d' src/Makefile.am || die
175 +
176 + eautoreconf
177 +}
178 +
179 +multilib_src_configure() {
180 + local myconf=(
181 + --disable-adrian-aec
182 + --disable-bluez4
183 + --disable-esound
184 + --disable-gconf
185 + --disable-solaris
186 + --enable-largefile
187 + --localstatedir="${EPREFIX}"/var
188 + --with-systemduserunitdir=$(systemd_get_userunitdir)
189 + --with-udev-rules-dir="${EPREFIX}/$(get_udevdir)"/rules.d
190 + $(multilib_native_use_enable alsa)
191 + $(multilib_native_use_enable bluetooth bluez5)
192 + $(multilib_native_use_enable glib gsettings)
193 + $(multilib_native_use_enable gtk gtk3)
194 + $(multilib_native_use_enable jack)
195 + $(multilib_native_use_enable libsamplerate samplerate)
196 + $(multilib_native_use_enable lirc)
197 + $(multilib_native_use_enable orc)
198 + $(multilib_native_use_enable oss oss-output)
199 + $(multilib_native_use_enable ssl openssl)
200 + # tests involve random modules, so just do them for the native
201 + $(multilib_native_use_enable test default-build-tests)
202 + $(multilib_native_use_enable udev)
203 + $(multilib_native_use_enable webrtc-aec)
204 + $(multilib_native_use_enable zeroconf avahi)
205 + $(multilib_native_use_with equalizer fftw)
206 + $(multilib_native_use_with sox soxr)
207 + $(multilib_native_usex gdbm '--with-database=gdbm' '--with-database=simple')
208 + $(use_enable glib glib2)
209 + $(use_enable asyncns)
210 + $(use_enable neon neon-opt)
211 + $(use_enable tcpd tcpwrap)
212 + $(use_enable dbus)
213 + $(use_enable X x11)
214 + $(use_enable systemd systemd-daemon)
215 + $(use_enable systemd systemd-login)
216 + $(use_enable systemd systemd-journal)
217 + $(use_enable ipv6)
218 + $(use_with caps)
219 + )
220 +
221 + if use bluetooth; then
222 + myconf+=(
223 + $(multilib_native_use_enable native-headset bluez5-native-headset)
224 + $(multilib_native_use_enable ofono-headset bluez5-ofono-headset)
225 + )
226 + fi
227 +
228 + if ! multilib_is_native_abi; then
229 + myconf+=(
230 + # hack around unnecessary checks
231 + # (results don't matter, we're not building anything using it)
232 + ac_cv_lib_ltdl_lt_dladvise_init=yes
233 + LIBSPEEX_CFLAGS=' '
234 + LIBSPEEX_LIBS=' '
235 + )
236 + fi
237 +
238 + ECONF_SOURCE=${S} \
239 + econf "${myconf[@]}"
240 +}
241 +
242 +multilib_src_compile() {
243 + if multilib_is_native_abi; then
244 + emake
245 + use doc && emake doxygen
246 + else
247 + local targets=( libpulse.la libpulsedsp.la libpulse-simple.la )
248 + use glib && targets+=( libpulse-mainloop-glib.la )
249 + emake -C src ${targets[*]}
250 + fi
251 +}
252 +
253 +multilib_src_test() {
254 + # We avoid running the toplevel check target because that will run
255 + # po/'s tests too, and they are broken. Officially, it should work
256 + # with intltool 0.41, but that doesn't look like a stable release.
257 + if multilib_is_native_abi; then
258 + emake -C src check
259 + fi
260 +}
261 +
262 +multilib_src_install() {
263 + if multilib_is_native_abi; then
264 + emake -j1 DESTDIR="${D}" bashcompletiondir="$(get_bashcompdir)" install
265 + if use doc ; then
266 + docinto html
267 + dodoc -r doxygen/html/
268 + fi
269 + else
270 + local targets=( libpulse.la libpulse-simple.la )
271 + use glib && targets+=( libpulse-mainloop-glib.la )
272 + emake DESTDIR="${D}" install-pkgconfigDATA
273 + emake DESTDIR="${D}" -C src \
274 + install-libLTLIBRARIES \
275 + install-padsplibLTLIBRARIES \
276 + lib_LTLIBRARIES="${targets[*]}" \
277 + install-pulseincludeHEADERS
278 + fi
279 +}
280 +
281 +multilib_src_install_all() {
282 + if use system-wide; then
283 + newconfd "${FILESDIR}/pulseaudio.conf.d" pulseaudio
284 +
285 + use_define() {
286 + local define=${2:-$(echo $1 | tr '[:lower:]' '[:upper:]')}
287 +
288 + use "$1" && echo "-D$define" || echo "-U$define"
289 + }
290 +
291 + unifdef $(use_define zeroconf AVAHI) \
292 + $(use_define alsa) \
293 + $(use_define bluetooth) \
294 + $(use_define udev) \
295 + "${FILESDIR}/pulseaudio.init.d-5" \
296 + > "${T}/pulseaudio"
297 +
298 + doinitd "${T}/pulseaudio"
299 +
300 + systemd_dounit "${FILESDIR}/${PN}.service"
301 +
302 + # We need /var/run/pulse, bug #442852
303 + systemd_newtmpfilesd "${FILESDIR}/${PN}.tmpfiles" "${PN}.conf"
304 + else
305 + # Prevent warnings when system-wide is not used, bug #447694
306 + if use dbus ; then
307 + rm "${ED%/}"/etc/dbus-1/system.d/pulseaudio-system.conf || die
308 + fi
309 + fi
310 +
311 + if use zeroconf ; then
312 + sed -e '/module-zeroconf-publish/s:^#::' \
313 + -i "${ED%/}/etc/pulse/default.pa" || die
314 + fi
315 +
316 + dodoc NEWS README todo
317 +
318 + # Create the state directory
319 + use prefix || diropts -o pulse -g pulse -m0755
320 +
321 + find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
322 +}
323 +
324 +pkg_postinst() {
325 + gnome2_schemas_update
326 + if use system-wide; then
327 + elog "You have enabled the 'system-wide' USE flag for pulseaudio."
328 + elog "This mode should only be used on headless servers, embedded systems,"
329 + elog "or thin clients. It will usually require manual configuration, and is"
330 + elog "incompatible with many expected pulseaudio features."
331 + elog "On normal desktop systems, system-wide mode is STRONGLY DISCOURAGED."
332 + elog "For more information, see"
333 + elog " https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/WhatIsWrongWithSystemWide/"
334 + elog " https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/SystemWide/"
335 + elog " https://wiki.gentoo.org/wiki/PulseAudio#Headless_server"
336 + fi
337 +
338 + if use equalizer && ! use qt5; then
339 + elog "You've enabled the 'equalizer' USE-flag but not the 'qt5' USE-flag."
340 + elog "This will build the equalizer module, but the 'qpaeq' tool"
341 + elog "which is required to set equalizer levels will not work."
342 + fi
343 +
344 + if use equalizer && use qt5; then
345 + elog "You will need to load some extra modules to make qpaeq work."
346 + elog "You can do that by adding the following two lines in"
347 + elog "/etc/pulse/default.pa and restarting pulseaudio:"
348 + elog "load-module module-equalizer-sink"
349 + elog "load-module module-dbus-protocol"
350 + fi
351 +
352 + if use native-headset && use ofono-headset; then
353 + elog "You have enabled both native and ofono headset profiles. The runtime decision"
354 + elog "which to use is done via the 'headset' argument of module-bluetooth-discover."
355 + fi
356 +
357 + if use libsamplerate; then
358 + elog "The libsamplerate based resamplers are now deprecated, because they offer no"
359 + elog "particular advantage over speex. Upstream suggests disabling them."
360 + fi
361 +}
362 +
363 +pkg_postrm() {
364 + gnome2_schemas_update
365 +}