commit:     2f5b382a9d7a582b55c0ac3ddac16d710265b481
Author:     Igor V. Kovalenko <igor.v.kovalenko <AT> gmail <DOT> com>
AuthorDate: Thu May 12 20:53:06 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jun 10 06:57:38 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2f5b382a

media-sound/pulseaudio-daemon: Untangle USE flags gstreamer, aptx and ldac

Require USE bluetooth for codecs selected via USE ldac or aptx, and pull
required gstreamer packages as build dependency but keep respective gstreamer
plugins runtime dependency.

Handle USE gstreamer to enable GStreamer-based RTP implementation only, and
suggest media-plugins/gst-plugins-opus for RTP OPUS payload.

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 media-sound/pulseaudio-daemon/metadata.xml         |  3 +-
 .../pulseaudio-daemon-16.0.ebuild                  | 38 +++++++++++++++-------
 2 files changed, 28 insertions(+), 13 deletions(-)

diff --git a/media-sound/pulseaudio-daemon/metadata.xml 
b/media-sound/pulseaudio-daemon/metadata.xml
index b5cfb62ef6b2..07ca89f667d0 100644
--- a/media-sound/pulseaudio-daemon/metadata.xml
+++ b/media-sound/pulseaudio-daemon/metadata.xml
@@ -72,8 +72,7 @@
       Build with oFono HFP backend for bluez 5, requires 
<pkg>net-misc/ofono</pkg>.
     </flag>
     <flag name="gstreamer">
-      Build with support for gstreamer including ability to use bluetooth 
codecs.
-      For bluetooth codecs see USE ldac and aptx.
+      Build GStreamer-based RTP protocol module which supports more advanced 
RTP features like OPUS payload encoding.
     </flag>
     <flag name="aptx">
       aptX (HD) over Bluetooth (many Android compatible headphones), requires 
<pkg>media-plugins/gst-plugins-openaptx</pkg>.

diff --git a/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.0.ebuild 
b/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.0.ebuild
index 17d8424a2b3e..3561766e33ac 100644
--- a/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.0.ebuild
+++ b/media-sound/pulseaudio-daemon/pulseaudio-daemon-16.0.ebuild
@@ -32,7 +32,7 @@ SLOT="0"
 # +alsa-plugin as discussed in bug #519530
 # 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 aptx +asyncns bluetooth dbus elogind equalizer +gdbm 
gstreamer +glib gtk ipv6 jack ldac lirc
+IUSE="+alsa +alsa-plugin aptx +asyncns bluetooth dbus elogind equalizer +gdbm 
+glib gstreamer gtk ipv6 jack ldac lirc
 native-headset ofono-headset +orc oss selinux sox ssl systemd system-wide tcpd 
test +udev valgrind +webrtc-aec +X zeroconf"
 
 RESTRICT="!test? ( test )"
@@ -41,10 +41,12 @@ RESTRICT="!test? ( test )"
 # 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="
+       ?? ( elogind systemd )
        alsa-plugin? ( alsa )
+       aptx? ( bluetooth )
        bluetooth? ( dbus )
-       ?? ( elogind systemd )
        equalizer? ( dbus )
+       ldac? ( bluetooth )
        native-headset? ( bluetooth )
        ofono-headset? ( bluetooth )
        udev? ( || ( alsa oss ) )
@@ -55,6 +57,10 @@ REQUIRED_USE="
 # - libpcre needed in some cases, bug #472228
 # - media-libs/speexdsp is providing echo canceller implementation and used in 
resampler
 # TODO: libatomic_ops is only needed on some architectures and conditions, and 
then at runtime too
+gstreamer_deps="
+       media-libs/gst-plugins-base
+       >=media-libs/gstreamer-1.14
+"
 COMMON_DEPEND="
        >=media-libs/libpulse-${PV}[dbus?,glib?,systemd?,tcpd?,valgrind?,X?]
        dev-libs/libatomic_ops
@@ -65,6 +71,7 @@ COMMON_DEPEND="
                dev-libs/libpcre:3
        )
        alsa? ( >=media-libs/alsa-lib-1.0.24 )
+       aptx? ( ${gstreamer_deps} )
        asyncns? ( >=net-libs/libasyncns-0.1 )
        bluetooth? (
                >=net-wireless/bluez-5
@@ -80,12 +87,10 @@ COMMON_DEPEND="
        )
        gdbm? ( sys-libs/gdbm:= )
        glib? ( >=dev-libs/glib-2.28.0:2 )
-       gstreamer? (
-               media-libs/gst-plugins-base
-               >=media-libs/gstreamer-1.14
-       )
+       gstreamer? ( ${gstreamer_deps} )
        gtk? ( x11-libs/gtk+:3 )
        jack? ( virtual/jack )
+       ldac? ( ${gstreamer_deps} )
        lirc? ( app-misc/lirc )
        ofono-headset? ( >=net-misc/ofono-1.13 )
        orc? ( >=dev-lang/orc-0.4.15 )
@@ -126,12 +131,11 @@ RDEPEND="
                acct-group/pulse-access
        )
        bluetooth? (
-               gstreamer? (
-                       ldac? ( media-plugins/gst-plugins-ldac )
-                       aptx? ( media-plugins/gst-plugins-openaptx )
-               )
+               ldac? ( media-plugins/gst-plugins-ldac )
+               aptx? ( media-plugins/gst-plugins-openaptx )
        )
 "
+unset gstreamer_deps
 
 # This is a PDEPEND to avoid a circular dep
 PDEPEND="
@@ -164,6 +168,11 @@ src_prepare() {
 }
 
 src_configure() {
+       local enable_bluez5_gstreamer="disabled"
+       if use aptx || use ldac ; then
+               enable_bluez5_gstreamer="enabled"
+       fi
+
        local emesonargs=(
                --localstatedir="${EPREFIX}"/var
 
@@ -189,7 +198,7 @@ src_configure() {
                $(meson_feature asyncns)
                $(meson_feature zeroconf avahi)
                $(meson_feature bluetooth bluez5)
-               $(meson_feature gstreamer bluez5-gstreamer)
+               -Dbluez5-gstreamer=${enable_bluez5_gstreamer}
                $(meson_use native-headset bluez5-native-headset)
                $(meson_use ofono-headset bluez5-ofono-headset)
                $(meson_feature dbus)
@@ -318,6 +327,13 @@ pkg_postinst() {
                elog ""
        fi
 
+       if use gstreamer; then
+               elog "GStreamer-based RTP implementation modile enabled."
+               elog "To use OPUS payload install 
media-plugins/gst-plugins-opus"
+               elog "and add enable_opus=1 argument to module-rtp-send"
+               elog ""
+       fi
+
        if use systemd; then
                elog "Pulseaudio autospawn by client library is no longer 
enabled when systemd is available."
                elog "It's recommended to start pulseaudio via its systemd user 
units:"

Reply via email to