Fix severely distorted sound on changing volume of stream in certain ways in pulseaud...
authorMart Raudsepp <leio@gentoo.org>
Thu, 8 Jan 2015 14:05:56 +0000 (14:05 +0000)
committerMart Raudsepp <leio@gentoo.org>
Thu, 8 Jan 2015 14:05:56 +0000 (14:05 +0000)
Package-Manager: portage-2.2.15/cvs/Linux x86_64

media-sound/pulseaudio/ChangeLog
media-sound/pulseaudio/Manifest
media-sound/pulseaudio/files/svolume-fix_param_loading_undefined_beh.patch [new file with mode: 0644]
media-sound/pulseaudio/pulseaudio-5.0-r7.ebuild [new file with mode: 0644]

index afee02294f9c741201e5aaf364e8b53d34d8633c..1f06343970f989778815a3790aecbb6abeb44973 100644 (file)
@@ -1,6 +1,13 @@
 # ChangeLog for media-sound/pulseaudio
 # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-sound/pulseaudio/ChangeLog,v 1.365 2015/01/05 17:56:32 zerochaos Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-sound/pulseaudio/ChangeLog,v 1.366 2015/01/08 14:05:50 leio Exp $
+
+*pulseaudio-5.0-r7 (08 Jan 2015)
+
+  08 Jan 2015; Mart Raudsepp <leio@gentoo.org> +pulseaudio-5.0-r7.ebuild,
+  +files/svolume-fix_param_loading_undefined_beh.patch:
+  Fix severely distorted sound on changing volume of stream in certain ways in
+  pulseaudio with orc-0.4.23, bug 534144
 
 *pulseaudio-5.99.2 (05 Jan 2015)
 
index df9221973bcbbce2cb5049cee592262186e588ae..39014066a6443f704124bfc28045d68d6857357d 100644 (file)
@@ -7,11 +7,13 @@ AUX pulseaudio.conf.d 275 SHA256 c03661e8cc902d27ff6b52f291207f2b008957571b942ab
 AUX pulseaudio.init.d-5 2352 SHA256 60e4571a8af0437bd99cfd858fde1e6223544a60e591febf25e55e4a2918ff59 SHA512 c510ddc71509435946a4f5a29ee2deb124fddec1a078433651bee99fd71424a0673c6b67015c2b737878e0e6e1da0b0ee4935e419a00cbfe74d6f8c8dc91f243 WHIRLPOOL 9fd81ab29c74b5bfc75aa15d73490881d59c4a280dd6214baf714080e74cb8cdd263d70ec220ea30c08da7890345f5bee6e0d68d2b04c8f5711051fe2b330cbc
 AUX pulseaudio.service 227 SHA256 62cd3b7e83845a27f437790cf293970f85ff02816da599a53cd5f3bf13da3788 SHA512 567663b231fe7c2682b08b1059cdad1fcb3c4cb01c1b24aed9afb6fb767b30f250b78bbbed48aadfb06c6d1a4963a6db24877d79a1d36c4be2a128b479c086d6 WHIRLPOOL bb548efc14d88b372abaafae557fe23681ce93d1b010fe7761458c5f7793a96886aa368df4cbec5a4fde078f9e8d940020e3ad2a36248ff6c8ab3b70f412d634
 AUX pulseaudio.tmpfiles 36 SHA256 d836951fb800308256288506b6bd82919d377399e1292dc10905a7aa12dac0e9 SHA512 f040850d81030ef04e1aa368d333a1ae1b7238adef5772280fc344c3068262d5ab8c9f3edb92db9c443f9d7d21abb27583ea1efc51ed733bbfa43e2edc68dde1 WHIRLPOOL b293b7372b7f63ddea63e6985d1f66a2010d8778ea3ae00501e58f15bfba3ed19b794111c073ee3bd5c8cf98d33f3c8db95220acf57f97477523f4cfa7121553
+AUX svolume-fix_param_loading_undefined_beh.patch 981 SHA256 844d3a095d26277548d250eda2aecd031270e7bef9c4fb1abd2ae989028225ee SHA512 a4ce28879bc1f6806597511bbe3b9c40d706933f5668dc42dfcea44de489d778d2a167ba01b926d0a6e3d8e280de54b8addea16f654c7c60c945329a9d448368 WHIRLPOOL 13698d1ac8110291fd70edf3eb7fd9c9b43c933f1a62530d644ff09722cbd6b09cb157f67fe6149ad1302f6d7a6b59c8c763cd419bf542688ec18e105e7a7a33
 DIST pulseaudio-5.0.tar.xz 1455428 SHA256 99c13a8b1249ddbd724f195579df79484e9af6418cecf6a15f003a7f36caf939 SHA512 f3d64bd6e03a732fd812da466b6658004600b4f3d0b9760403b7e113b6d654d54387658bf3704f45f28ab700245433e23fe517e4579130886fc58647eb97be2b WHIRLPOOL c85829c78ded3bbef234e455bfd3778f2daf50de9d7627508dbf131d0c398e35ab3ae41a4b5136f0c0da09249bc9a600ad85d848ba4e1faba74875af0a787036
 DIST pulseaudio-5.99.2.tar.xz 1454516 SHA256 877fbc19c5928ade11c948814d0d444673c39a8ec5571d331642f3327d2c86fe SHA512 55e63f55fc2671c1ff70baef958c45d4b00b6017cd7dd0760c3c7ba10df9a5c7d005fe5acfccbc81a93df2305034a549368001e5518ca1586a96201e3db7a874 WHIRLPOOL 4900affe2c05858e2a7b9d3b3ebe89058f4625fa2089038015996df10ee8b08d8a98eb30ba932dac3f43e08117516e15dc717005c3db270905e15cad601fae1a
 EBUILD pulseaudio-5.0-r4.ebuild 10280 SHA256 ecfcb8e41987a89721eece1b90535d8b69e6051fc526b8017ed93cde28986588 SHA512 53bbcda4b9885cbdb4c3d2c3077052e519ceb64fe4ad74678eef75ddedd5590f4ea7b33efbd58bd8a35b29ab084fce596d8672188abf1b5b915ec007ee33cae0 WHIRLPOOL 7bb2a3898ee6b6775c51a207ff13102524f76ea38a49e68b30b647b8423eb456e841bf4e61fbe8a4bcb48a6cdbdd594253ccb1702989ac1ac460648e7f47e14d
 EBUILD pulseaudio-5.0-r5.ebuild 10463 SHA256 b74d44a38bcc42c73012138ced50c84f916d03068c439b6998940ea290372840 SHA512 5347fb31876ed4c72ef6596583f42e94a960eb97638f90921c51f75defbebf460b8c27b7b64d5beebf89c7cd0b3938f48746ad0ff5a6e572c5d419084000eada WHIRLPOOL cc5490557c23954787d44b0949794bcac9417cd7c39691db44fef865a28d4f6cc2dc1246f78f0ec12361f51a86d4f68b943a9c33242839e06fa96fbee7fef116
 EBUILD pulseaudio-5.0-r6.ebuild 10533 SHA256 392e4d555bee4b05fc7765d40474ae78b819dadc23c750ce5ecee808c1aa8620 SHA512 2f8d69b05cbe6b6878373e08e2f1bdc027b2a877e9586cdd540725c37d318b5c2a8c3be72328b216f1c59be40a6295cc1a9a996479d959bfdd2300f8dbbc934b WHIRLPOOL 3838b97f83025672b9ec8c139d59d1f22d283015efc5789d41e2f480d89756a5b97ef2ba0cc5d5d0dcd9a1d5a0cbfbe5a842241c27447c91ad5681f18b719c14
+EBUILD pulseaudio-5.0-r7.ebuild 10859 SHA256 e4f63718e8497160459e963d7e8a0595c550edfccbc31da4b253066a108aca68 SHA512 bfaea139268029d684bba07b71e2f3181190aa299dda93240eccb4aecb6f8b00378066c0bcbf612367cbb0939b4ddf71d8a62b18dc934d0a83743d24076eec6a WHIRLPOOL 60dfa28d30cfe9a5719ccebc08c29847d3b5ea0cae986901d4908f1d59defc4a22d6296e6adb30a894536bc9284e3f48d3ed6cd3b9a226ba2e13d9ad366f81b3
 EBUILD pulseaudio-5.99.2.ebuild 10661 SHA256 1a15600c6dd0c03f532f29f0b878e5c951cac2e9dd7e101279fb891aaedc9d6b SHA512 0d001dcdb5596ffd2492998d402bcace2cf97cf96299c9c03741e585c645b5be3d50c9b89e92793ea45bb426f875b802f50d583d513e50afc1876a14ac056d8f WHIRLPOOL 4f0cdad989af992ffafadcd6b078adafe670e01fcaa8e1dcecf5fe937ac8dafe78e8fc72e296111cf3b2d0ba61ed7bad0735528d931f71c0152c0d345ae8e937
-MISC ChangeLog 69331 SHA256 2a46041061e1a4989ece3a605b2a9a81bfd92f51ee2b82ab3286b8e7cc0dffcb SHA512 fdf55f12a7c8b3077874c1c0cad6de13df772cdf3ccd425172622f7d3b0b5e0b7ee0bb32dd42d8ec3997c21902762aaabd7eb6df7642fc10c1f707f664dec012 WHIRLPOOL 8381175222007c8aff482b99d6a9680c6c8c8b3d16ed2eae4b9a8b86d242a8a53f920169f0058ab26777b93047c8b6255453d2419576f59ee811de0a092b016c
+MISC ChangeLog 69611 SHA256 d2547605b732c463bf0f85b1c1d8088b3c432f937e2543d40e9c0779fb2a7b0f SHA512 ba8ea258f8ec6a430b0537a872fb584a88bc8302831d0cbecd7809b7cde541d88b1d8ef1314e16761cf91a664630b978106c7b82debf8c13767dfe35bcad6b14 WHIRLPOOL 51b8e7a60d28b94488496ceed5970bee4e572a90bc695764637e3446ac733a58527111caca1de1eb774567efb8b0579418c5cb35e0e7a488a07dcd72f0bd26c0
 MISC metadata.xml 3051 SHA256 3362e5b815ff2cd38317100361b154c08db41f99fa973e067db82aae57feb2a3 SHA512 4fecf278339b700ff8ff519ba6d345da0fd809404f2ad46b96178784bd07fe2ba733670abf033e036ec816a6c6c026d1f003d6996531329d69d4bd4db94a1403 WHIRLPOOL 66e96152c60b1e734c7539bee39e950d1adcab885c4fe131c95695bc166a34f9651e0e627dd5418c59ce56116c0634468b074fffd4aff5ab30237239ce21b291
diff --git a/media-sound/pulseaudio/files/svolume-fix_param_loading_undefined_beh.patch b/media-sound/pulseaudio/files/svolume-fix_param_loading_undefined_beh.patch
new file mode 100644 (file)
index 0000000..4e22f5e
--- /dev/null
@@ -0,0 +1,37 @@
+From: Wim Taymans
+Date: Wed,  7 Jan 2015 11:20:01 +0100
+Subject: [PATCH] svolume.orc: avoid parameter loading undefined behaviour
+
+In some cases, depending on the instruction that performs the load, orc
+ignores the size of the parameter when loading it for the first time.
+Explicitly load the parameter into a temp to make sure it is loaded
+correctly, like we do for the 2ch case.
+
+See https://bugzilla.gnome.org/show_bug.cgi?id=742271
+---
+ src/pulsecore/svolume.orc | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/src/pulsecore/svolume.orc b/src/pulsecore/svolume.orc
+index 0edbefb..f869893 100644
+--- a/src/pulsecore/svolume.orc
++++ b/src/pulsecore/svolume.orc
+@@ -45,13 +45,15 @@
+ 
+ .function pa_volume_s16ne_orc_1ch
+ .dest 2 samples int16_t
+-.param 4 v int32_t
++.param 4 vols int32_t
++.temp 4 v
+ .temp 2 vh
+ .temp 4 s
+ .temp 4 mh
+ .temp 4 ml
+ .temp 4 signc
+ 
++loadpl v, vols
+ convuwl s, samples
+ x2 cmpgtsw signc, 0, s
+ x2 andw signc, signc, v
+-- 
+1.9.3
diff --git a/media-sound/pulseaudio/pulseaudio-5.0-r7.ebuild b/media-sound/pulseaudio/pulseaudio-5.0-r7.ebuild
new file mode 100644 (file)
index 0000000..8819543
--- /dev/null
@@ -0,0 +1,364 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-sound/pulseaudio/pulseaudio-5.0-r7.ebuild,v 1.1 2015/01/08 14:05:50 leio Exp $
+
+EAPI="5"
+inherit autotools bash-completion-r1 eutils flag-o-matic linux-info readme.gentoo systemd user versionator udev multilib-minimal
+
+DESCRIPTION="A networked sound server with an advanced plugin system"
+HOMEPAGE="http://www.pulseaudio.org/"
+SRC_URI="http://freedesktop.org/software/pulseaudio/releases/${P}.tar.xz"
+
+# libpulse-simple and libpulse link to libpulse-core; this is daemon's
+# library and can link to gdbm and other GPL-only libraries. In this
+# cases, we have a fully GPL-2 package. Leaving the rest of the
+# GPL-forcing USE flags for those who use them.
+LICENSE="!gdbm? ( LGPL-2.1 ) gdbm? ( GPL-2 )"
+
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+
+# +alsa-plugin as discussed in bug #519530
+IUSE="+alsa +alsa-plugin +asyncns bluetooth +caps dbus doc equalizer +gdbm +glib
+gnome gtk ipv6 jack libsamplerate lirc neon +orc oss qt4 realtime ssl systemd
+system-wide tcpd test +udev +webrtc-aec +X xen zeroconf"
+
+# See "*** BLUEZ support not found (requires D-Bus)" in configure.ac
+REQUIRED_USE="bluetooth? ( dbus )"
+
+# libpcre needed in some cases, bug #472228
+RDEPEND="
+       || (
+               elibc_glibc? ( virtual/libc )
+               elibc_uclibc? ( virtual/libc )
+               dev-libs/libpcre
+       )
+       >=media-libs/libsndfile-1.0.20[${MULTILIB_USEDEP}]
+       X? (
+               >=x11-libs/libX11-1.4.0[${MULTILIB_USEDEP}]
+               >=x11-libs/libxcb-1.6[${MULTILIB_USEDEP}]
+               x11-libs/libSM[${MULTILIB_USEDEP}]
+               x11-libs/libICE[${MULTILIB_USEDEP}]
+               x11-libs/libXtst[${MULTILIB_USEDEP}]
+       )
+       caps? ( >=sys-libs/libcap-2.22-r2[${MULTILIB_USEDEP}] )
+       libsamplerate? ( >=media-libs/libsamplerate-0.1.1-r1 )
+       alsa? ( >=media-libs/alsa-lib-1.0.19 )
+       glib? ( >=dev-libs/glib-2.4.0[${MULTILIB_USEDEP}] )
+       zeroconf? ( >=net-dns/avahi-0.6.12[dbus] )
+       jack? ( >=media-sound/jack-audio-connection-kit-0.117 )
+       tcpd? ( sys-apps/tcp-wrappers[${MULTILIB_USEDEP}] )
+       lirc? ( app-misc/lirc )
+       dbus? ( >=sys-apps/dbus-1.0.0[${MULTILIB_USEDEP}] )
+       gtk? ( x11-libs/gtk+:3 )
+       gnome? ( >=gnome-base/gconf-2.4.0 )
+       bluetooth? (
+               net-wireless/bluez:=
+               >=sys-apps/dbus-1.0.0
+               media-libs/sbc
+       )
+       asyncns? ( net-libs/libasyncns[${MULTILIB_USEDEP}] )
+       udev? ( >=virtual/udev-143[hwdb(+)] )
+       realtime? ( sys-auth/rtkit )
+       equalizer? ( sci-libs/fftw:3.0 )
+       orc? ( >=dev-lang/orc-0.4.9 )
+       ssl? ( dev-libs/openssl )
+       >=media-libs/speex-1.2_rc1
+       gdbm? ( sys-libs/gdbm )
+       webrtc-aec? ( media-libs/webrtc-audio-processing )
+       xen? ( app-emulation/xen-tools )
+       systemd? ( sys-apps/systemd:0=[${MULTILIB_USEDEP}] )
+       dev-libs/json-c[${MULTILIB_USEDEP}]
+       abi_x86_32? ( !<=app-emulation/emul-linux-x86-soundlibs-20131008-r1
+               !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)] )
+       dev-libs/libltdl:0
+"
+# it's a valid RDEPEND, libltdl.so is used for native abi
+
+DEPEND="${RDEPEND}
+       sys-devel/m4
+       doc? ( app-doc/doxygen )
+       test? ( dev-libs/check )
+       X? (
+               x11-proto/xproto[${MULTILIB_USEDEP}]
+               >=x11-libs/libXtst-1.0.99.2[${MULTILIB_USEDEP}]
+       )
+       dev-libs/libatomic_ops
+       virtual/pkgconfig
+       system-wide? ( || ( dev-util/unifdef sys-freebsd/freebsd-ubin ) )
+       dev-util/intltool
+       >=sys-devel/gettext-0.18.1
+"
+# This is a PDEPEND to avoid a circular dep
+PDEPEND="alsa? ( alsa-plugin? (
+       >=media-plugins/alsa-plugins-1.0.27-r1[pulseaudio]
+) )"
+
+# alsa-utils dep is for the alsasound init.d script (see bug #155707)
+# bluez dep is for the bluetooth init.d script
+# PyQt4 dep is for the qpaeq script
+RDEPEND="${RDEPEND}
+       equalizer? ( qt4? ( dev-python/PyQt4[dbus] ) )
+       system-wide? (
+               alsa? ( media-sound/alsa-utils )
+               bluetooth? ( net-wireless/bluez:= )
+       )
+"
+
+pkg_pretend() {
+       CONFIG_CHECK="~HIGH_RES_TIMERS"
+       WARNING_HIGH_RES_TIMERS="CONFIG_HIGH_RES_TIMERS:\tis not set (required for enabling timer-based scheduling in pulseaudio)\n"
+       check_extra_config
+
+       if linux_config_exists; then
+               local snd_hda_prealloc_size=$(linux_chkconfig_string SND_HDA_PREALLOC_SIZE)
+               if [ -n "${snd_hda_prealloc_size}" ] && [ "${snd_hda_prealloc_size}" -lt 2048 ]; then
+                       ewarn "A preallocated buffer-size of 2048 (kB) or higher is recommended for the HD-audio driver!"
+                       ewarn "CONFIG_SND_HDA_PREALLOC_SIZE=${snd_hda_prealloc_size}"
+               fi
+       fi
+}
+
+pkg_setup() {
+       linux-info_pkg_setup
+
+       enewgroup audio 18 # Just make sure it exists
+
+       if use system-wide; then
+               enewgroup pulse-access
+               enewgroup pulse
+               enewuser pulse -1 -1 /var/run/pulse pulse,audio
+       fi
+}
+
+src_prepare() {
+       # Skip test that cannot work with sandbox, bug #501846
+       sed -i -e '/lock-autospawn-test/d' src/Makefile.am || die
+
+       # Fix CVE-2014-3970, bug #512516 (from 'master')
+       epatch "${FILESDIR}/${P}-crash-udp.patch"
+
+       # module-switch-on-port-available: Don't switch profiles on uninitialized cards (from 'master')
+       epatch "${FILESDIR}/${P}-module-switch.patch"
+
+       # Fix module-zeroconf-publish crashes, bug #504612 (from 'master')
+       epatch "${FILESDIR}"/${P}-zeroconf-crash-{1,2,3}.patch
+
+       # svolume.orc: avoid parameter loading undefined behaviour
+       # orc-0.4.23 triggers a bug on certain volume changes with PA, leading to distorted sounds
+       # http://lists.freedesktop.org/archives/pulseaudio-discuss/2015-January/022905.html
+       # Gentoo bug 534144
+       epatch "${FILESDIR}"/svolume-fix_param_loading_undefined_beh.patch
+
+       epatch_user
+       eautoreconf
+}
+
+multilib_src_configure() {
+       local myconf=()
+
+       if use gdbm; then
+               myconf+=( --with-database=gdbm )
+       #elif use tdb; then
+       #       myconf+=( --with-database=tdb )
+       else
+               myconf+=( --with-database=simple )
+       fi
+
+       if use bluetooth; then
+               if has_version '<net-wireless/bluez-5'; then
+                       myconf+=( --disable-bluez5 --enable-bluez4 )
+               else
+                        myconf+=( --enable-bluez5 --disable-bluez4 )
+               fi
+       else
+               myconf+=( --disable-bluez5 --disable-bluez4 )
+       fi
+
+       myconf+=(
+               --enable-largefile
+               $(use_enable glib glib2)
+               --disable-solaris
+               $(use_enable asyncns)
+               $(use_enable oss oss-output)
+               $(use_enable alsa)
+               $(use_enable lirc)
+               $(use_enable neon neon-opt)
+               $(use_enable tcpd tcpwrap)
+               $(use_enable jack)
+               $(use_enable zeroconf avahi)
+               $(use_enable dbus)
+               $(use_enable gnome gconf)
+               $(use_enable gtk gtk3)
+               $(use_enable libsamplerate samplerate)
+               $(use_enable orc)
+               $(use_enable X x11)
+               $(use_enable test default-build-tests)
+               $(use_enable udev)
+               $(use_enable systemd)
+               $(use_enable systemd systemd-journal)
+               $(use_enable ipv6)
+               $(use_enable ssl openssl)
+               $(use_enable webrtc-aec)
+               $(use_enable xen)
+               $(use_with caps)
+               $(use_with equalizer fftw)
+               --disable-adrian-aec
+               --disable-esound
+               --localstatedir="${EPREFIX}"/var
+               --with-udev-rules-dir="${EPREFIX}/$(get_udevdir)"/rules.d
+       )
+
+       if ! multilib_is_native_abi; then
+               # disable all the modules and stuff
+               myconf+=(
+                       --disable-oss-output
+                       --disable-alsa
+                       --disable-lirc
+                       --disable-jack
+                       --disable-avahi
+                       --disable-gconf
+                       --disable-gtk3
+                       --disable-samplerate
+                       --disable-bluez4
+                       --disable-bluez5
+                       --disable-udev
+                       --disable-systemd
+                       --disable-openssl
+                       --disable-orc
+                       --disable-webrtc-aec
+                       --disable-xen
+                       --without-fftw
+
+                       # tests involve random modules, so just do them for the native
+                       --disable-default-build-tests
+
+                       # hack around unnecessary checks
+                       # (results don't matter, we're not building anything using it)
+                       ac_cv_lib_ltdl_lt_dladvise_init=yes
+                       --with-database=simple
+                       LIBSPEEX_CFLAGS=' '
+                       LIBSPEEX_LIBS=' '
+               )
+       fi
+
+       ECONF_SOURCE=${S} \
+       econf "${myconf[@]}"
+}
+
+multilib_src_compile() {
+       if multilib_is_native_abi; then
+               emake
+       else
+               local targets=( libpulse.la libpulse-simple.la )
+               use glib && targets+=( libpulse-mainloop-glib.la )
+               emake -C src libpulse{,dsp,-simple,-mainloop-glib}.la
+       fi
+}
+
+src_compile() {
+       multilib-minimal_src_compile
+
+       if use doc; then
+               pushd doxygen
+               doxygen doxygen.conf
+               popd
+       fi
+}
+
+multilib_src_test() {
+       # We avoid running the toplevel check target because that will run
+       # po/'s tests too, and they are broken. Officially, it should work
+       # with intltool 0.41, but that doesn't look like a stable release.
+       if multilib_is_native_abi; then
+               emake -C src check
+       fi
+}
+
+multilib_src_install() {
+       if multilib_is_native_abi; then
+               emake -j1 DESTDIR="${D}" bashcompletiondir="$(get_bashcompdir)" install
+       else
+               local targets=( libpulse.la libpulse-simple.la )
+               use glib && targets+=( libpulse-mainloop-glib.la )
+               emake DESTDIR="${D}" install-pkgconfigDATA
+               emake DESTDIR="${D}" -C src \
+                       install-libLTLIBRARIES \
+                       install-padsplibLTLIBRARIES \
+                       lib_LTLIBRARIES="${targets[*]}" \
+                       install-pulseincludeHEADERS
+       fi
+}
+
+multilib_src_install_all() {
+       # Drop the script entirely if X is disabled
+       use X || rm "${ED}"/usr/bin/start-pulseaudio-x11
+
+       if use system-wide; then
+               newconfd "${FILESDIR}/pulseaudio.conf.d" pulseaudio
+
+               use_define() {
+                       local define=${2:-$(echo $1 | tr '[:lower:]' '[:upper:]')}
+
+                       use "$1" && echo "-D$define" || echo "-U$define"
+               }
+
+               unifdef $(use_define zeroconf AVAHI) \
+                       $(use_define alsa) \
+                       $(use_define bluetooth) \
+                       $(use_define udev) \
+                       "${FILESDIR}/pulseaudio.init.d-5" \
+                       > "${T}/pulseaudio"
+
+               doinitd "${T}/pulseaudio"
+
+               systemd_dounit "${FILESDIR}/${PN}.service"
+       fi
+
+       use zeroconf && sed -i -e '/module-zeroconf-publish/s:^#::' "${ED}/etc/pulse/default.pa"
+
+       dodoc NEWS README todo
+
+       if use doc; then
+               pushd doxygen/html
+               dohtml *
+               popd
+       fi
+
+       # Create the state directory
+       use prefix || diropts -o pulse -g pulse -m0755
+
+       # We need /var/run/pulse, bug #442852
+       use system-wide && systemd_newtmpfilesd "${FILESDIR}/${PN}.tmpfiles" "${PN}.conf"
+
+       # Prevent warnings when system-wide is not used, bug #447694
+       use system-wide || rm "${ED}"/etc/dbus-1/system.d/pulseaudio-system.conf
+
+       prune_libtool_files --all
+}
+
+pkg_postinst() {
+       if use system-wide; then
+               elog "PulseAudio in Gentoo can use a system-wide pulseaudio daemon."
+               elog "This support is enabled by starting the pulseaudio init.d ."
+               elog "To be able to access that you need to be in the group pulse-access."
+               elog "If you choose to use this feature, please make sure that you"
+               elog "really want to run PulseAudio this way:"
+               elog "   http://pulseaudio.org/wiki/WhatIsWrongWithSystemMode"
+               elog "For more information about system-wide support, please refer to:"
+               elog "   http://pulseaudio.org/wiki/SystemWideInstance"
+               if use gnome ; then
+                       elog
+                       elog "By enabling gnome USE flag, you enabled gconf support. Please note"
+                       elog "that you might need to remove the gnome USE flag or disable the"
+                       elog "gconf module on /etc/pulse/system.pa to be able to use PulseAudio"
+                       elog "with a system-wide instance."
+               fi
+       fi
+
+       if use equalizer && ! use qt4; then
+               elog "You've enabled the 'equalizer' USE-flag but not the 'qt4' USE-flag."
+               elog "This will build the equalizer module, but the 'qpaeq' tool"
+               elog "which is required to set equalizer levels will not work."
+       fi
+}