public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: media-video/pipewire/, media-video/pipewire/files/
Date: Sun, 24 Oct 2021 01:58:00 +0000 (UTC)	[thread overview]
Message-ID: <1635040669.e4a4227c737503f7145ad76dea878f96f25688ca.sam@gentoo> (raw)

commit:     e4a4227c737503f7145ad76dea878f96f25688ca
Author:     Niklāvs Koļesņikovs <89q1r14hd <AT> relay <DOT> firefox <DOT> com>
AuthorDate: Mon Oct 18 20:16:19 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Oct 24 01:57:49 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e4a4227c

media-video/pipewire: adds WirePlumber support for OpenRC

As an added bonus the launcher script now starts all the daemons
itself, which means we no longer need to carry and conditionally
apply a patch, which has proven to require recurrent updates.

The instructions for disabling PulseAudio compatibility are pretty
narly and the approach is best reworked (or given up on entirely),
since those instructions have never been the whole story.

Thanks-to: Sam James <sam <AT> gentoo.org> (reviewing & eprefix hint)
Signed-off-by: Niklāvs Koļesņikovs <89q1r14hd <AT> relay.firefox.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../pipewire/files/gentoo-pipewire-launcher.in     | 26 +++++++++++
 media-video/pipewire/pipewire-9999.ebuild          | 52 ++++++++++++----------
 2 files changed, 55 insertions(+), 23 deletions(-)

diff --git a/media-video/pipewire/files/gentoo-pipewire-launcher.in b/media-video/pipewire/files/gentoo-pipewire-launcher.in
new file mode 100644
index 00000000000..4e66e2fe317
--- /dev/null
+++ b/media-video/pipewire/files/gentoo-pipewire-launcher.in
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+# PipeWire launcher script for XDG compliant desktops on OpenRC.
+#
+# systemd users are very _STRONGLY_ advised to use the much
+# more reliable and predictable user units instead.
+
+# WARNING: This script assumes being run inside XDG compliant session,
+# which means D-Bus session instance is expected to be correctly set up
+# prior to this script starting. If that is not true, things may break!
+
+# Best to reap any existing daemons and only then try to start a new set.
+pkill -u "${USER}" -x pipewire\|wireplumber 1>/dev/null 2>&1
+
+# The core daemon which by itself does probably nothing.
+@GENTOO_PORTAGE_EPREFIX@/usr/bin/pipewire &
+
+# The so called pipewire-pulse daemon used for PulseAudio compatibility.
+# Commenting this out will stop the PA proxying daemon from starting,
+# however ALSA (with pipewire-alsa), JACK (with jack-sdk) and PW API using
+# clients will still have access to audio and may end up clashing with
+# non-PW apps over HW control (most notably, /usr/bin/pulseaudio daemon).
+@GENTOO_PORTAGE_EPREFIX@/usr/bin/pipewire -c pipewire-pulse.conf &
+
+# Finally a session manager is required for PipeWire to do anything.
+exec @GENTOO_PORTAGE_EPREFIX@/usr/bin/wireplumber

diff --git a/media-video/pipewire/pipewire-9999.ebuild b/media-video/pipewire/pipewire-9999.ebuild
index eaa51173cfc..360882c6ea6 100644
--- a/media-video/pipewire/pipewire-9999.ebuild
+++ b/media-video/pipewire/pipewire-9999.ebuild
@@ -5,7 +5,7 @@ EAPI="7"
 
 PYTHON_COMPAT=( python3_{8..10} )
 
-inherit meson-multilib optfeature python-any-r1 systemd udev
+inherit meson-multilib optfeature prefix python-any-r1 systemd udev
 
 if [[ ${PV} == 9999 ]]; then
 	EGIT_REPO_URI="https://gitlab.freedesktop.org/${PN}/${PN}.git"
@@ -113,12 +113,6 @@ python_check_deps() {
 src_prepare() {
 	default
 
-	if ! use systemd; then
-		# This can be applied non-conditionally but would make for a
-		# significantly worse user experience on systemd then.
-		eapply "${FILESDIR}"/${PN}-0.3.36-non-systemd-integration.patch
-	fi
-
 	einfo "Generating ${limitsdfile}"
 	cat > ${limitsdfile} <<- EOF || die
 		# Start of ${limitsdfile} from ${P}
@@ -206,8 +200,9 @@ multilib_src_install_all() {
 		insinto /etc/xdg/autostart
 		newins "${FILESDIR}"/pipewire.desktop pipewire.desktop
 
-		exeinto /usr/libexec
-		newexe "${FILESDIR}"/pipewire-launcher.sh pipewire-launcher
+		exeinto /usr/bin
+		newexe "${FILESDIR}"/gentoo-pipewire-launcher.in gentoo-pipewire-launcher
+		eprefixify "${ED}"/usr/bin/gentoo-pipewire-launcher
 	fi
 }
 
@@ -247,20 +242,31 @@ pkg_postinst() {
 		elog "  systemctl --user enable --now wireplumber.service"
 		elog
 	else
-		elog "This ebuild auto-enables PulseAudio replacement. Because of that, users"
-		elog "are recommended to edit: ${EROOT}/etc/pulse/client.conf and disable"
-		elog "autospawning of the original daemon by setting:"
-		elog
-		elog "  autospawn = no"
-		elog
-		elog "Please note that the semicolon (;) must _NOT_ be at the beginning of the line!"
-		elog
-		elog "Alternatively, if replacing PulseAudio daemon is not desired, edit"
-		elog "${EROOT}/etc/pipewire/pipewire.conf by commenting out the relevant"
-		elog "command near the end of the file:"
-		elog
-		elog "#\"/usr/bin/pipewire\" = { args = \"-c pipewire-pulse.conf\" }"
-		elog
+		ewarn "PipeWire daemon startup has been moved to a launcher script!"
+		ewarn "Make sure that ${EROOT}/etc/pipewire/pipewire.conf either does not exist or no"
+		ewarn "longer is set to start a session manager or PulseAudio compatibility daemon (all"
+		ewarn "lines similar to `{ path = \"/usr/bin/pipewire*` should be commented out)"
+		ewarn
+		ewarn "Those manually starting /usr/bin/pipewire via .xinitrc or similar _must_ from"
+		ewarn "now on start ${EROOT}/usr/bin/gentoo-pipewire-launcher instead! It is highly"
+		ewarn "advised that a D-Bus user session is set up before starting the script."
+		ewarn
+		if has_version 'media-sound/pulseaudio[daemon]' || has_version 'media-sound/pulseaudio-daemon'; then
+			elog "This ebuild auto-enables PulseAudio replacement. Because of that, users"
+			elog "are recommended to edit: ${EROOT}/etc/pulse/client.conf and disable"
+			elog "autospawning of the original daemon by setting:"
+			elog
+			elog "  autospawn = no"
+			elog
+			elog "Please note that the semicolon (;) must _NOT_ be at the beginning of the line!"
+			elog
+			elog "Alternatively, if replacing PulseAudio daemon is not desired, edit"
+			elog "${EROOT}/usr/bin/gentoo-pipewire-launcher  by commenting out the relevant"
+			elog "command:"
+			elog
+			elog "#${EROOT}/usr/bin/pipewire -c pipewire-pulse.conf &"
+			elog
+		fi
 		elog "NOTE:"
 		elog "Starting with PipeWire-0.3.30, this package is no longer installing its config"
 		elog "into ${EROOT}/etc/pipewire by default. In case you need to change"


             reply	other threads:[~2021-10-24  1:58 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-24  1:58 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-02-28 12:08 [gentoo-commits] repo/gentoo:master commit in: media-video/pipewire/, media-video/pipewire/files/ Sam James
2024-07-01  8:19 Sam James
2024-03-19  5:48 Sam James
2023-09-12  0:43 Sam James
2023-05-11  1:21 Sam James
2023-01-15 22:32 Sam James
2022-12-16  4:56 Sam James
2022-12-14  8:45 Sam James
2022-11-17 19:20 Sam James
2022-10-14 19:33 Sam James
2022-07-31  3:40 Sam James
2022-07-12 23:23 Sam James
2022-07-12 23:23 Sam James
2022-07-04 23:36 Sam James
2022-05-01 19:52 Sam James
2022-05-01 19:52 Sam James
2022-02-21  3:30 Sam James
2021-11-26 19:37 Andreas Sturmlechner
2021-10-13 21:11 Andreas Sturmlechner
2021-10-01  0:00 Sam James
2021-09-16 21:55 Sam James
2021-09-13 23:07 Sam James
2021-04-12 21:55 Thomas Deutschmann
2021-01-01 19:12 Andreas Sturmlechner
2020-06-28 15:36 Andreas Sturmlechner
2019-07-07 15:56 Andreas Sturmlechner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1635040669.e4a4227c737503f7145ad76dea878f96f25688ca.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox