diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2021-06-21 17:32:00 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2021-06-21 17:32:00 +0100 |
commit | 61f10f985e19dfe20a4d9552902625edd5b6eabb (patch) | |
tree | 50db31971b38c4e0358253ef5005058a46fc773e /media-sound/pulseaudio | |
parent | 34dea8e38f88007799629d0a56b12dec480b1d21 (diff) |
gentoo resync : 21.06.2021
Diffstat (limited to 'media-sound/pulseaudio')
7 files changed, 532 insertions, 2 deletions
diff --git a/media-sound/pulseaudio/Manifest b/media-sound/pulseaudio/Manifest index 843d9d81bc15..3a81c729430d 100644 --- a/media-sound/pulseaudio/Manifest +++ b/media-sound/pulseaudio/Manifest @@ -1,8 +1,13 @@ AUX pulseaudio-11.1-disable-flat-volumes.patch 1992 BLAKE2B 1ffbaf129d57abc7c02f430bdd59a76384456d7ef020e9765bc0541327279dcf7d005d87fe989fd0c89b2767564f99af87ece8c374e1d67c5d1cae1695f0819c SHA512 603f60ef38aeba83038fe5dc9e5f6a82e42d10a7f057f158b489dd04857c3bc8203b728d9df6736314ee3002648390cd564fdce347f2e6791e901a47041dd1fc +AUX pulseaudio-13.0-clang.patch 765 BLAKE2B a5759d9b92a6b1c95adc70a1d8f3952046de987a00f7994719acc4e6357b3d81d3abb587d811e38cc70c9fed16504080222f3b61167b67c76273fe5147bb569c SHA512 59bcfaa2a13453536eb1c5b0fbbf457ae798047ce5287a8035980bee832ee0cedf4c997d36ef52e87bfd1fb1c3b7e611906f54cd116038b17d678995c2c1f017 +AUX pulseaudio-14.99.2-require-GIO-for-RTP-GStreamer.patch 1660 BLAKE2B 4a71414a1b93585d1fa9727372779872963177c0148a38a85474cd636d665efc926934ff2b581037b31f82ad051c538c4fedbd32698d975ca29432d32d0fcdfa SHA512 b41fac13fe67d5c6e315e89e7c9b2b4ba7f8e4036f75960b4e67b853930743b0af1c8602e7cfb95fc15fb4ee83cbc5d6141e48f597d5e2cb2789bc8d9a8eb992 +AUX pulseaudio-14.99.2-require-bluez-dependency.patch 3799 BLAKE2B 31f17051b214a449bf957e60a3816f709441a90bf084a9f00e35f5532e038d1199ab319b3d4975b4dc6a2d0182ebbd745824560951fe878f8537fe85e658ef22 SHA512 911d99bcc565d1869e4a13fa53965e346e634e7f3c155169dd2ee57b006cee63e31e3a3127d3ed157c37350a150606f8816cd0f66a01a98f7f34d3c70d0b1980 AUX pulseaudio.conf.d 151 BLAKE2B 99b185b9353259f37f3396c6f2bb56b80cac0159c9c5d06af4b298ad71d9c577dd6b3f0d9097fc95184b14193d0d55252987465ebd93bd0005849a68ce9b428d SHA512 f97ed431e371e43d297b099952bf1e897b243a822183524b8e3ea17e888c08590bb3793e195bc22e3254eae7f2e1fa00204a752638746c4dde825a423f08c24b AUX pulseaudio.init.d-5 2227 BLAKE2B 263c589ab81a70d5159c0ee81773a456b8acaefc3b7254455b9ff19128c2fc69f176368976d835503554eb60a80a8f4b53797cf46ba11b55c82bc742bf03551f SHA512 d0e1519fc97208c2d42c7d9d8f2e7d4658e741e8063102713da361748b6deaeae475619a65b3d3d1893c107a4511e17d4245264b5430190087f1823899c0f64b AUX pulseaudio.service 227 BLAKE2B f58fa701152e84f4d52426f6f76b5a01a1a315d09e5fb8e9e57860b44dc63b78b3f1c1629380b4345c53b003c677f729b3959419e8488e37607c56d6a700626a SHA512 567663b231fe7c2682b08b1059cdad1fcb3c4cb01c1b24aed9afb6fb767b30f250b78bbbed48aadfb06c6d1a4963a6db24877d79a1d36c4be2a128b479c086d6 AUX pulseaudio.tmpfiles 36 BLAKE2B 4fe7c88fb35f561b0eb756146db17e37201126b5d7f906c88cdc778c6191f17c799f1db072f09d5a384485830e4d33266c224955bad22081255544642399b2f6 SHA512 f040850d81030ef04e1aa368d333a1ae1b7238adef5772280fc344c3068262d5ab8c9f3edb92db9c443f9d7d21abb27583ea1efc51ed733bbfa43e2edc68dde1 DIST pulseaudio-13.0.tar.xz 1901768 BLAKE2B 651a80f54525f196bcb036d893fedd4d9f34e10459918281397a45f498c31bff0d0c836f4e64aab5ac2612ffd5a0cab1a41ea710bbee5fd34dfc9ea1236deea9 SHA512 d445b8ccd43029a0ca0e456fc9291a79d3434d6496ead7eb329ab348d5249235e8bde6cf2be68765d8f761452dbe1486fb10c739e40b1e67ed75787bbd24ac0c -EBUILD pulseaudio-13.0-r1.ebuild 11386 BLAKE2B 31453bb6059a4efdd9d0c618534ee478407ffebda0cbad0d2b2e6d20735f5c24cac46fa92411c1a22a6d3261b798a3510e6cf426c456ca9c2b8c46a753b8653b SHA512 7be9fdc6e354bef9d039a43192a2626fea1887fc3067d973c2328237e288f2fc103ca7c8f914d495827401ec6f9f2b8bb69ee9306626f083b906c0118b949823 -MISC metadata.xml 3308 BLAKE2B 29baf3692d386ab71e112f1870649a38061b1c1bff7d6338d48e1486d56c5e937a7653650cc387db4242cfa3b6954ad072852db7373276fbdfcd4fc441380ea8 SHA512 a004e0e0e82e5c4b2e1953ea754bb47bf4b43bb60e422e5685131b3f3192eee6086a0582eb17879193877b66499e8cad22496fa5003ea4f3b617a320940eda31 +DIST pulseaudio-14.99.2.tar.xz 1518460 BLAKE2B 66150756ca64aa3b0c8f689131e294ea67b48ae682ef7446bb4934a29a4e90d5944025b0a4701b623f53f07d7bfb790d64185e6d5ba0ec1012eaa0a3e9e2f9ba SHA512 fe8c1e5fe74d78d7f7155be2ea65a90909547841a717921ad526c05e4c4dbe4e810c3bb6d1fbae705a109c70cef627b87a2b16d948bb6d714f72f5e22e4a6b5f +EBUILD pulseaudio-13.0-r1.ebuild 11418 BLAKE2B 9a656044d67e37951ce61533a7b10a6830256aca510ef86b6893af4227565d76c4402894b68bf41456aff9de9fc9b33505aa90044f59a55be639645df1cbe4bc SHA512 fd88106961566905f2826630f6044816569414d0276a4a61582b39b96bbad22f5ccb73f51e8bf0a02b2de5dcf297e62c081abd69ecbee80f28591d3c0a19307b +EBUILD pulseaudio-14.99.2_pre.ebuild 10624 BLAKE2B de473abecf5620f3c13b26489f95ef4c528e79b82f0106a7acb626c635b0b440c1c89c37ab35a2d05141d4a0917e22992c19352ec29d4def67bb8b6b3d60bf73 SHA512 21f1920f13cc9367f00e3dad3b43bdbf76566e5ac4ff0c5bcb8f4c7cfd2854b550088461953053de908c5bad47c6a78abfce095134ea91cedafe886f0942da3b +MISC metadata.xml 3542 BLAKE2B 219478a02cb996393839789ad8b79196754bb52a2168f243e88bb7c3ec8e6bfbfce96de9cb26cd93fef84a63c1397854e4b3028d5fc55e30f09d67b86769044b SHA512 9509fc630c2bf7fb9a089163198d326ac1d16e48bd22113b21a27e98ad68ed0da042fd6bacbf2dfaff7706cf64d39270c6a2a564418fb498872f2d1ae67fc3fc diff --git a/media-sound/pulseaudio/files/pulseaudio-13.0-clang.patch b/media-sound/pulseaudio/files/pulseaudio-13.0-clang.patch new file mode 100644 index 000000000000..d7b81de0313e --- /dev/null +++ b/media-sound/pulseaudio/files/pulseaudio-13.0-clang.patch @@ -0,0 +1,25 @@ +From e4450d8b586103ec1414e2d6245ff34a9096d97a Mon Sep 17 00:00:00 2001 +From: Peter Levine <plevine457@gmail.com> +Date: Thu, 26 Sep 2019 07:24:40 +0000 +Subject: [PATCH] atomic: Explicitly cast void* to unsigned long + +--- + src/pulsecore/atomic.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/pulsecore/atomic.h b/src/pulsecore/atomic.h +index a82ca83c5..e5c140109 100644 +--- a/src/pulsecore/atomic.h ++++ b/src/pulsecore/atomic.h +@@ -117,7 +117,7 @@ static inline void* pa_atomic_ptr_load(const pa_atomic_ptr_t *a) { + } + + static inline void pa_atomic_ptr_store(pa_atomic_ptr_t *a, void* p) { +- __atomic_store_n(&a->value, p, __ATOMIC_SEQ_CST); ++ __atomic_store_n(&a->value, (unsigned long) p, __ATOMIC_SEQ_CST); + } + + #else +-- +GitLab + diff --git a/media-sound/pulseaudio/files/pulseaudio-14.99.2-require-GIO-for-RTP-GStreamer.patch b/media-sound/pulseaudio/files/pulseaudio-14.99.2-require-GIO-for-RTP-GStreamer.patch new file mode 100644 index 000000000000..a6554178da60 --- /dev/null +++ b/media-sound/pulseaudio/files/pulseaudio-14.99.2-require-GIO-for-RTP-GStreamer.patch @@ -0,0 +1,51 @@ +From 58052e0e04ee1b5fdb1027ebc19717e7766825ec Mon Sep 17 00:00:00 2001 +From: "Igor V. Kovalenko" <igor.v.kovalenko@gmail.com> +Date: Mon, 21 Jun 2021 02:32:41 +0300 +Subject: [PATCH] build-sys: meson: require GIO dependency for RTP-GStreamer + +Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/584> +--- + meson.build | 6 ++++-- + src/modules/meson.build | 2 +- + 2 files changed, 5 insertions(+), 3 deletions(-) + +diff --git a/meson.build b/meson.build +index fdd8bf655..61660b981 100644 +--- a/meson.build ++++ b/meson.build +@@ -614,8 +614,9 @@ if dbus_dep.found() + cdata.set('HAVE_DBUS', 1) + endif + +-gio_dep = dependency('gio-2.0', version : '>= 2.26.0', required : get_option('gsettings')) +-if gio_dep.found() ++gio_dep = dependency('gio-2.0', version : '>= 2.26.0') ++if get_option('gsettings').enabled() ++ assert(gio_dep.found(), 'GSettings support needs glib I/O library (GIO)') + cdata.set('HAVE_GSETTINGS', 1) + endif + +@@ -760,6 +761,7 @@ gstrtp_dep = dependency('gstreamer-rtp-1.0', required : get_option('gstreamer')) + + have_gstreamer = false + if gst_dep.found() and gstapp_dep.found() and gstrtp_dep.found() ++ assert(gio_dep.found(), 'GStreamer-based RTP needs glib I/O library (GIO)') + have_gstreamer = true + endif + +diff --git a/src/modules/meson.build b/src/modules/meson.build +index 9c498a4e1..e7db573b6 100644 +--- a/src/modules/meson.build ++++ b/src/modules/meson.build +@@ -161,7 +161,7 @@ if dbus_dep.found() and fftw_dep.found() + ] + endif + +-if gio_dep.found() ++if get_option('gsettings').enabled() and gio_dep.found() + subdir('gsettings') + all_modules += [ + [ 'module-gsettings', +-- +GitLab + diff --git a/media-sound/pulseaudio/files/pulseaudio-14.99.2-require-bluez-dependency.patch b/media-sound/pulseaudio/files/pulseaudio-14.99.2-require-bluez-dependency.patch new file mode 100644 index 000000000000..5983a05ea4a9 --- /dev/null +++ b/media-sound/pulseaudio/files/pulseaudio-14.99.2-require-bluez-dependency.patch @@ -0,0 +1,89 @@ +From c817dfb5a438055c98449a4a2f34eb4ec341ccde Mon Sep 17 00:00:00 2001 +From: "Igor V. Kovalenko" <igor.v.kovalenko@gmail.com> +Date: Fri, 18 Jun 2021 20:48:12 +0300 +Subject: [PATCH] build-sys: meson: Require bluez dependency if bluez5 feature + is enabled + +Build breaks if bluez5 and bluez5-native-headset are both enabled +but bluez headers are not available. + +Fix this by changing `bluez5` to Meson feature requiring `bluez` dependency. + +Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/583> +--- + meson.build | 10 ++++++---- + meson_options.txt | 2 +- + src/modules/bluetooth/meson.build | 2 +- + src/modules/meson.build | 2 +- + 4 files changed, 9 insertions(+), 7 deletions(-) + +diff --git a/meson.build b/meson.build +index 61660b981..92ceef706 100644 +--- a/meson.build ++++ b/meson.build +@@ -706,7 +706,9 @@ endif + + sbc_dep = dependency('sbc', version : '>= 1.0', required : false) + +-if get_option('bluez5') ++bluez_dep = dependency('bluez', required : get_option('bluez5')) ++ ++if bluez_dep.found() + assert(dbus_dep.found(), 'BlueZ requires D-Bus support') + assert(sbc_dep.found(), 'BlueZ requires SBC support') + cdata.set('HAVE_SBC', 1) +@@ -914,9 +916,9 @@ summary = [ + 'Enable Async DNS: @0@'.format(asyncns_dep.found()), + 'Enable LIRC: @0@'.format(lirc_dep.found()), + 'Enable D-Bus: @0@'.format(dbus_dep.found()), +- ' Enable BlueZ 5: @0@'.format(get_option('bluez5')), +- ' Enable native headsets: @0@'.format(get_option('bluez5-native-headset')), +- ' Enable ofono headsets: @0@'.format(get_option('bluez5-ofono-headset')), ++ ' Enable BlueZ 5: @0@'.format(cdata.has('HAVE_BLUEZ_5')), ++ ' Enable native headsets: @0@'.format(cdata.has('HAVE_BLUEZ_5_NATIVE_HEADSET')), ++ ' Enable ofono headsets: @0@'.format(cdata.has('HAVE_BLUEZ_5_OFONO_HEADSET')), + ' Enable GStreamer based codecs: @0@'.format(have_bluez5_gstreamer), + 'Enable udev: @0@'.format(udev_dep.found()), + ' Enable HAL->udev compat: @0@'.format(get_option('hal-compat')), +diff --git a/meson_options.txt b/meson_options.txt +index cdb3c6787..bb41a42a7 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -85,7 +85,7 @@ option('avahi', + type : 'feature', value : 'auto', + description : 'Optional Avahi support') + option('bluez5', +- type : 'boolean', value : 'true', ++ type : 'feature', value : 'auto', + description : 'Optional BlueZ 5 support') + option('bluez5-gstreamer', + type : 'feature', value: 'auto', +diff --git a/src/modules/bluetooth/meson.build b/src/modules/bluetooth/meson.build +index 99263bb5a..ca77ee6aa 100644 +--- a/src/modules/bluetooth/meson.build ++++ b/src/modules/bluetooth/meson.build +@@ -35,7 +35,7 @@ libbluez5_util = shared_library('bluez5-util', + c_args : [pa_c_args, server_c_args], + link_args : [nodelete_link_args], + include_directories : [configinc, topinc], +- dependencies : [libpulse_dep, libpulsecommon_dep, libpulsecore_dep, dbus_dep, sbc_dep, libintl_dep, bluez5_gst_dep, bluez5_gstapp_dep], ++ dependencies : [libpulse_dep, libpulsecommon_dep, libpulsecore_dep, bluez_dep, dbus_dep, sbc_dep, libintl_dep, bluez5_gst_dep, bluez5_gstapp_dep], + install : true, + install_rpath : privlibdir, + install_dir : modlibexecdir, +diff --git a/src/modules/meson.build b/src/modules/meson.build +index e7db573b6..be72c3b9b 100644 +--- a/src/modules/meson.build ++++ b/src/modules/meson.build +@@ -118,7 +118,7 @@ if avahi_dep.found() + ] + endif + +-if get_option('bluez5') ++if cdata.has('HAVE_BLUEZ_5') + subdir('bluetooth') + all_modules += [ + [ 'module-bluetooth-discover', 'bluetooth/module-bluetooth-discover.c' ], +-- +GitLab + diff --git a/media-sound/pulseaudio/metadata.xml b/media-sound/pulseaudio/metadata.xml index 38993dac40af..d6b7247df40a 100644 --- a/media-sound/pulseaudio/metadata.xml +++ b/media-sound/pulseaudio/metadata.xml @@ -17,7 +17,11 @@ PulseAudio plugin enabled. This ensures that clients supporting ALSA only will use PulseAudio. </flag> + <flag name="daemon">Build the pulseaudio binary (not-needed for pipewire-pulse)</flag> <flag name="elogind">Use <pkg>sys-auth/elogind</pkg> for giving each session a PA client</flag> + <flag name="forget-missing"> + Enables clearing of unavailable devices from database files which is recommended for GNOME. + </flag> <flag name="gconf"> Ensure <pkg>gnome-base/gconf</pkg> is present for pulseaudio GConf to GSettings module automatic migration (keeping the user configuration) diff --git a/media-sound/pulseaudio/pulseaudio-13.0-r1.ebuild b/media-sound/pulseaudio/pulseaudio-13.0-r1.ebuild index 0b4d1139a5b8..0b9a7d18570d 100644 --- a/media-sound/pulseaudio/pulseaudio-13.0-r1.ebuild +++ b/media-sound/pulseaudio/pulseaudio-13.0-r1.ebuild @@ -121,6 +121,7 @@ BDEPEND=" PATCHES=( "${FILESDIR}"/pulseaudio-11.1-disable-flat-volumes.patch # bug 627894 + "${FILESDIR}"/${P}-clang.patch ) pkg_pretend() { diff --git a/media-sound/pulseaudio/pulseaudio-14.99.2_pre.ebuild b/media-sound/pulseaudio/pulseaudio-14.99.2_pre.ebuild new file mode 100644 index 000000000000..5e4d232b4c41 --- /dev/null +++ b/media-sound/pulseaudio/pulseaudio-14.99.2_pre.ebuild @@ -0,0 +1,355 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="7" + +MY_PV="${PV/_pre*}" +MY_P="${PN}-${MY_PV}" + +inherit bash-completion-r1 gnome2-utils meson-multilib optfeature systemd udev + +DESCRIPTION="A networked sound server with an advanced plugin system" +HOMEPAGE="https://www.freedesktop.org/wiki/Software/PulseAudio/" + +if [[ ${PV} = 9999 ]]; then + inherit git-r3 + EGIT_BRANCH="master" + EGIT_REPO_URI="https://gitlab.freedesktop.org/${PN}/${PN}" +else + SRC_URI="https://freedesktop.org/software/${PN}/releases/${MY_P}.tar.xz" + #KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux" +fi + +# 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" + +# +alsa-plugin as discussed in bug #519530 +# TODO: Deal with bluez5-gstreamer +# TODO: Find out why webrtc-aec is + prefixed - there's already the always available speexdsp-aec +# NOTE: The current ebuild sets +X almost certainly just for the pulseaudio.desktop file +IUSE="+alsa +alsa-plugin +asyncns bluetooth dbus +daemon doc elogind equalizer forget-missing +gdbm +gstreamer +glib gtk ipv6 jack lirc native-headset ofono-headset +orc oss selinux sox ssl systemd +system-wide tcpd test +udev +webrtc-aec +X zeroconf" + +RESTRICT="!test? ( test )" + +# See "*** BLUEZ support not found (requires D-Bus)" in configure.ac +# Basically all IUSE are either ${MULTILIB_USEDEP} for client libs or they belong under !daemon () +# We duplicate alsa-plugin, {native,ofono}-headset under daemon to let users deal with them at once +REQUIRED_USE=" + alsa-plugin? ( alsa ) + bluetooth? ( dbus ) + daemon? ( ?? ( elogind systemd ) ) + !daemon? ( + !alsa + !alsa-plugin + !bluetooth + !equalizer + !gdbm + !gtk + !jack + !lirc + !native-headset + !ofono-headset + !orc + !oss + !sox + !ssl + !system-wide + !udev + !webrtc-aec + !zeroconf + ) + equalizer? ( dbus ) + native-headset? ( bluetooth ) + ofono-headset? ( bluetooth ) + udev? ( || ( alsa oss ) ) + zeroconf? ( dbus ) +" + +BDEPEND=" + sys-devel/gettext + sys-devel/m4 + virtual/libiconv + virtual/libintl + virtual/pkgconfig + doc? ( app-doc/doxygen ) + orc? ( >=dev-lang/orc-0.4.15 ) + system-wide? ( dev-util/unifdef ) +" + +# NOTE: +# - libpcre needed in some cases, bug #472228 +# - media-libs/speexdsp is providing echo canceller implementation +COMMON_DEPEND=" + >=media-libs/libsndfile-1.0.20[${MULTILIB_USEDEP}] + >=media-libs/speexdsp-1.2[${MULTILIB_USEDEP}] + virtual/libc + alsa? ( >=media-libs/alsa-lib-1.0.24 ) + asyncns? ( >=net-libs/libasyncns-0.1[${MULTILIB_USEDEP}] ) + bluetooth? ( + >=net-wireless/bluez-5 + media-libs/sbc + ) + daemon? ( + dev-libs/libltdl + sys-kernel/linux-headers + ) + dbus? ( >=sys-apps/dbus-1.4.12[${MULTILIB_USEDEP}] ) + elogind? ( sys-auth/elogind ) + equalizer? ( + sci-libs/fftw:3.0 + ) + gdbm? ( sys-libs/gdbm:= ) + glib? ( >=dev-libs/glib-2.28.0:2[${MULTILIB_USEDEP}] ) + gstreamer? ( + media-libs/gst-plugins-base + >=media-libs/gstreamer-1.14 + ) + gtk? ( x11-libs/gtk+:3 ) + jack? ( virtual/jack ) + lirc? ( app-misc/lirc ) + ofono-headset? ( >=net-misc/ofono-1.13 ) + orc? ( >=dev-lang/orc-0.4.15 ) + selinux? ( sec-policy/selinux-pulseaudio ) + sox? ( >=media-libs/soxr-0.1.1 ) + ssl? ( dev-libs/openssl:= ) + systemd? ( sys-apps/systemd:=[${MULTILIB_USEDEP}] ) + tcpd? ( sys-apps/tcp-wrappers[${MULTILIB_USEDEP}] ) + udev? ( >=virtual/udev-143[hwdb(+)] ) + webrtc-aec? ( >=media-libs/webrtc-audio-processing-0.2 ) + X? ( + >=x11-libs/libxcb-1.6[${MULTILIB_USEDEP}] + daemon? ( + x11-libs/libICE + x11-libs/libSM + >=x11-libs/libX11-1.4.0 + >=x11-libs/libXtst-1.0.99.2 + ) + ) + zeroconf? ( >=net-dns/avahi-0.6.12[dbus] ) +" + +DEPEND=" + ${COMMON_DEPEND} + dev-libs/libatomic_ops + dev-libs/libpcre:* + test? ( >=dev-libs/check-0.9.10 ) + X? ( x11-base/xorg-proto ) +" + +# alsa-utils dep is for the alsasound init.d script (see bug 155707); TODO: read it +# NOTE: Only system-wide needs acct-group/audio unless elogind/systemd is not used +RDEPEND=" + ${COMMON_DEPEND} + system-wide? ( + alsa? ( media-sound/alsa-utils ) + acct-user/pulse + acct-group/audio + acct-group/pulse-access + ) +" + +# This is a PDEPEND to avoid a circular dep +PDEPEND=" + alsa? ( alsa-plugin? ( >=media-plugins/alsa-plugins-1.0.27-r1[pulseaudio,${MULTILIB_USEDEP}] ) ) +" + +DOCS=( NEWS README ) + +S="${WORKDIR}/${MY_P}" + +PATCHES=( + "${FILESDIR}"/${MY_P}-require-GIO-for-RTP-GStreamer.patch + "${FILESDIR}"/${MY_P}-require-bluez-dependency.patch +) + +src_prepare() { + default + + gnome2_environment_reset +} + +multilib_src_configure() { + local emesonargs=( + -Dadrian-aec=false # Not packaged? + --localstatedir="${EPREFIX}"/var + -Dmodlibexecdir="${EPREFIX}/usr/$(get_libdir)/${PN}/modules" # Was $(get_libdir)/${P} + -Dsystemduserunitdir=$(systemd_get_userunitdir) + -Dudevrulesdir="${EPREFIX}$(get_udevdir)/rules.d" + -Dbashcompletiondir="$(get_bashcompdir)" # Alternatively DEPEND on app-shells/bash-completion for pkg-config to provide the value + $(meson_native_use_feature alsa) + $(meson_native_use_feature bluetooth bluez5) + $(meson_native_use_bool daemon) + $(meson_native_use_bool doc doxygen) + $(meson_native_use_bool native-headset bluez5-native-headset) + $(meson_native_use_bool ofono-headset bluez5-ofono-headset) + $(meson_native_use_feature glib gsettings) # Supposedly correct? + $(meson_native_use_feature gstreamer) + $(meson_native_use_feature gtk) + $(meson_native_use_feature jack) + -Dsamplerate=disabled # Matches upstream + $(meson_native_use_feature lirc) + $(meson_native_use_feature orc) + $(meson_native_use_feature oss oss-output) + $(meson_native_use_feature ssl openssl) + # tests involve random modules, so just do them for the native # TODO: tests should run always + $(meson_native_use_bool test tests) + $(meson_native_use_feature udev) + $(meson_native_use_feature webrtc-aec) + $(meson_native_use_feature zeroconf avahi) + $(meson_native_use_feature equalizer fftw) + $(meson_native_use_feature sox soxr) + -Ddatabase=$(multilib_native_usex gdbm gdbm simple) # tdb is also an option but no one cares about it + $(meson_use forget-missing stream-restore-clear-old-devices) + $(meson_feature glib) # WARNING: toggling this likely changes ABI + $(meson_feature asyncns) + #$(meson_use cpu_flags_arm_neon neon-opt) + $(meson_native_use_feature tcpd tcpwrap) + $(meson_feature dbus) + $(meson_feature elogind) + $(meson_feature X x11) + $(meson_feature systemd) + $(meson_use ipv6) + ) + + if multilib_is_native_abi; then + # Make padsp work for non-native ABI, supposedly only possible with glibc; + # this is used by /usr/bin/padsp that comes from native build, thus we need + # this argument for native build + if use elibc_glibc; then + emesonargs+=( -Dpulsedsp-location="${EPREFIX}"'/usr/\\$$LIB/pulseaudio' ) + fi + else + if ! use elibc_glibc; then + # Non-glibc multilib is probably non-existent but just in case: + ewarn "padsp wrapper for OSS emulation will only work with native ABI applications!" + fi + fi + + meson_src_configure +} + +multilib_src_compile() { + meson_src_compile + + if multilib_is_native_abi; then + if use doc; then + einfo "Generating documentation ..." + meson_src_compile doxygen + fi + fi +} + +multilib_src_install() { + # The files referenced in the DOCS array do not exist in the multilib source directory, + # therefore clear the variable when calling the function that will access it. + DOCS= meson_src_install + + if multilib_is_native_abi; then + if use doc; then + einfo "Installing documentation ..." + docinto html + dodoc -r doxygen/html/. + fi + fi +} + +multilib_src_install_all() { + einstalldocs + + 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 \ + || die + + doinitd "${T}"/pulseaudio + + systemd_dounit "${FILESDIR}"/${PN}.service + + # We need /var/run/pulse, bug 442852 + systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfiles ${PN}.conf + else + # Prevent warnings when system-wide is not used, bug 447694 + if use dbus && use daemon; then + rm "${ED}"/etc/dbus-1/system.d/pulseaudio-system.conf || die + fi + fi + + if use zeroconf; then + sed -i \ + -e '/module-zeroconf-publish/s:^#::' \ + "${ED}/etc/pulse/default.pa" \ + || die + fi + + find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die +} + +pkg_postinst() { + gnome2_schemas_update + + if use system-wide; then + elog "You have enabled the 'system-wide' USE flag for pulseaudio." + elog "This mode should only be used on headless servers, embedded systems," + elog "or thin clients. It will usually require manual configuration, and is" + elog "incompatible with many expected pulseaudio features." + elog "On normal desktop systems, system-wide mode is STRONGLY DISCOURAGED." + elog "" + elog "For more information, see" + elog " https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/WhatIsWrongWithSystemWide/" + elog " https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/SystemWide/" + elog " https://wiki.gentoo.org/wiki/PulseAudio#Headless_server" + elog "" + fi + + if use equalizer; then + elog "You will need to load some extra modules to make qpaeq work." + elog "You can do that by adding the following two lines in" + elog "/etc/pulse/default.pa and restarting pulseaudio:" + elog "load-module module-equalizer-sink" + elog "load-module module-dbus-protocol" + elog "" + fi + + if use native-headset && use ofono-headset; then + elog "You have enabled both native and ofono headset profiles. The runtime decision" + elog "which to use is done via the 'headset' argument of module-bluetooth-discover." + elog "" + fi + + if use systemd && use daemon; then + elog "It's recommended to start pulseaudio via its systemd user units:" + elog "" + elog " systemctl --user enable pulseaudio.service pulseaudio.socket" + elog "" + elog "The change from autospawn to user units will take effect after restarting." + elog "" + fi + + optfeature_header "PulseAudio can be enhanced by installing the following:" + use equalizer && optfeature "using the qpaeq script" dev-python/PyQt5[dbus,widgets] + use dbus && optfeature "restricted realtime capabilities via D-Bus" sys-auth/rtkit +} + +pkg_postrm() { + gnome2_schemas_update +} |