commit:     ba2b951973e0f5ab1e1647b8ac969d9e147cb6ae
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Sat May  8 13:13:51 2021 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Sat May  8 18:27:43 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ba2b9519

media-video/pipewire: add support to replace JACK

Thanks to Niklāvs for the initial work!

Thanks-to: Niklāvs Koļesņikovs <89q1r14hd <AT> relay.firefox.com>
Package-Manager: Portage-3.0.18, Repoman-3.0.3
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 media-video/pipewire/metadata.xml         |  1 +
 media-video/pipewire/pipewire-9999.ebuild | 25 ++++++++++++++++---------
 2 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/media-video/pipewire/metadata.xml 
b/media-video/pipewire/metadata.xml
index 954805d1590..d199e8a9255 100644
--- a/media-video/pipewire/metadata.xml
+++ b/media-video/pipewire/metadata.xml
@@ -25,6 +25,7 @@
                <flag name="ffmpeg">Builds an unsupported SPA (file a Gentoo 
bug if you need this)</flag>
                <flag name="jack">Enable SPA JACK plugin and emulation to be 
able to run JACK applications on top of PipeWire</flag>
                <flag name="jack-client">Install a plugin for running PipeWire 
as a JACK client</flag>
+               <flag name="jack-sdk">Use PipeWire as JACK replacement</flag>
                <flag name="ldac">LDAC over Bluetooth (primarily Sony 
headphones)</flag>
                <flag name="pipewire-alsa">Replace PulseAudio's ALSA plugin 
with PipeWire's plugin</flag>
                <flag name="vulkan">Uses Vulkan compute shaders to provide a 
CGI video source</flag>

diff --git a/media-video/pipewire/pipewire-9999.ebuild 
b/media-video/pipewire/pipewire-9999.ebuild
index a90b445a81d..879b3968542 100644
--- a/media-video/pipewire/pipewire-9999.ebuild
+++ b/media-video/pipewire/pipewire-9999.ebuild
@@ -19,7 +19,7 @@ HOMEPAGE="https://pipewire.org/";
 
 LICENSE="LGPL-2.1+"
 SLOT="0/0.3"
-IUSE="aac aptx bluetooth doc extra gstreamer jack-client ldac pipewire-alsa 
systemd test v4l"
+IUSE="aac aptx bluetooth doc extra gstreamer jack-client jack-sdk ldac 
pipewire-alsa systemd test v4l"
 
 # Once replacing system JACK libraries is possible, it's likely that
 # jack-client IUSE will need blocking to avoid users accidentally
@@ -30,6 +30,7 @@ IUSE="aac aptx bluetooth doc extra gstreamer jack-client ldac 
pipewire-alsa syst
 REQUIRED_USE="
        aac? ( bluetooth )
        aptx? ( bluetooth )
+       jack-sdk? ( !jack-client )
        ldac? ( bluetooth )
 "
 
@@ -61,6 +62,10 @@ RDEPEND="
                media-libs/gst-plugins-base:1.0
        )
        jack-client? ( >=media-sound/jack2-1.9.10:2[dbus] )
+       jack-sdk? (
+               !media-sound/jack-audio-connection-kit
+               !media-sound/jack2
+       )
        pipewire-alsa? (
                >=media-libs/alsa-lib-1.1.7
                || (
@@ -122,8 +127,6 @@ src_configure() {
                -Dsystemd-system-service=disabled # Matches upstream
                $(meson_feature systemd systemd-user-service)
                $(meson_feature pipewire-alsa) # Allows integrating ALSA apps 
into PW graph
-               -Dpipewire-jack=enabled # Allows integrating JACK apps into PW 
graph
-               #-Dlibjack-path="" # Where to install libjack.so et al (if an 
absolute path is used, remember to prefix it with ${EROOT} or similar!); 
setting this will also break pw-jack's multilib support (but presumably that's 
okay as the intended use would be to replace system's libraries making the 
loader irrelevant)
                -Dspa-plugins=enabled
                -Dalsa=enabled # Allows using kernel ALSA for sound I/O 
(-Dmedia-session depends on this)
                -Daudiomixer=enabled # Matches upstream
@@ -139,7 +142,9 @@ src_configure() {
                -Dcontrol=enabled # Matches upstream
                -Daudiotestsrc=enabled # Matches upstream
                -Dffmpeg=disabled # Disabled by upstream and no major 
developments to spa/plugins/ffmpeg/ since May 2020
+               -Dpipewire-jack=enabled # Allows integrating JACK apps into PW 
graph
                $(meson_feature jack-client jack) # Allows PW to act as a JACK 
client
+               $(usex jack-sdk "-Dlibjack-path=${EPREFIX}/usr/$(get_libdir)" 
'')
                -Dsupport=enabled # Miscellaneous/common plugins, such as null 
sink
                -Devl=disabled # Matches upstream
                -Dtest=disabled # fakesink and fakesource plugins
@@ -201,12 +206,14 @@ pkg_postinst() {
                elog
        fi
 
-       elog "JACK emulation is incomplete and not all programs will work. 
PipeWire's"
-       elog "alternative libraries have been installed to a non-default 
location."
-       elog "To use them, put pw-jack <application> before every JACK 
application."
-       elog "When using pw-jack, do not run jackd/jackdbus. However, a 
virtual/jack"
-       elog "provider is still needed to compile the JACK applications 
themselves."
-       elog
+       if ! use jack-sdk; then
+               elog "JACK emulation is incomplete and not all programs will 
work. PipeWire's"
+               elog "alternative libraries have been installed to a 
non-default location."
+               elog "To use them, put pw-jack <application> before every JACK 
application."
+               elog "When using pw-jack, do not run jackd/jackdbus. However, a 
virtual/jack"
+               elog "provider is still needed to compile the JACK applications 
themselves."
+               elog
+       fi
 
        if use systemd; then
                elog "Per Gentoo policy installed systemd units must be 
manually enabled:"

Reply via email to