commit:     567cd216a230328da9e1471267e717f996a19d32
Author:     Anna (navi) Figueiredo Gomes <navi <AT> vlhl <DOT> dev>
AuthorDate: Thu Feb 27 10:29:07 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Feb 28 12:07:11 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=567cd216

media-video/pipewire: add user initd

The ebuild still ships gentoo-pipewire-launcher in /etc/xdg/autostart,
so users in desktop environments that follow the xdg-autostart spec
should disable the pipewire launcher before attempting to use the
openrc-user init script.

Signed-off-by: Anna (navi) Figueiredo Gomes <navi <AT> vlhl.dev>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 media-video/pipewire/files/pipewire-pulse.initd         | 12 ++++++++++++
 media-video/pipewire/files/pipewire.initd               | 11 +++++++++++
 .../{pipewire-9999.ebuild => pipewire-1.2.7-r2.ebuild}  | 17 ++++++++++-------
 media-video/pipewire/pipewire-9999.ebuild               |  6 +++++-
 4 files changed, 38 insertions(+), 8 deletions(-)

diff --git a/media-video/pipewire/files/pipewire-pulse.initd 
b/media-video/pipewire/files/pipewire-pulse.initd
new file mode 100644
index 000000000000..af7de8681c4a
--- /dev/null
+++ b/media-video/pipewire/files/pipewire-pulse.initd
@@ -0,0 +1,12 @@
+#!/sbin/openrc-run
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License, v2 or later
+
+depend() {
+       need pipewire dbus
+}
+
+export DBUS_SESSION_BUS_ADDRESS="unix:path=${XDG_RUNTIME_DIR}/bus"
+supervisor=supervise-daemon
+command="/usr/bin/pipewire"
+command_args="-c pipewire-pulse.conf"

diff --git a/media-video/pipewire/files/pipewire.initd 
b/media-video/pipewire/files/pipewire.initd
new file mode 100644
index 000000000000..76a0f1930612
--- /dev/null
+++ b/media-video/pipewire/files/pipewire.initd
@@ -0,0 +1,11 @@
+#!/sbin/openrc-run
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License, v2 or later
+
+depend() {
+       need dbus
+}
+
+export DBUS_SESSION_BUS_ADDRESS="unix:path=${XDG_RUNTIME_DIR}/bus"
+supervisor=supervise-daemon
+command="/usr/bin/pipewire"

diff --git a/media-video/pipewire/pipewire-9999.ebuild 
b/media-video/pipewire/pipewire-1.2.7-r2.ebuild
similarity index 98%
copy from media-video/pipewire/pipewire-9999.ebuild
copy to media-video/pipewire/pipewire-1.2.7-r2.ebuild
index 1593763ba9c5..e2697a5647a3 100644
--- a/media-video/pipewire/pipewire-9999.ebuild
+++ b/media-video/pipewire/pipewire-1.2.7-r2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -23,11 +23,11 @@ EAPI=8
 : ${PIPEWIRE_DOCS_PREBUILT:=1}
 
 PIPEWIRE_DOCS_PREBUILT_DEV=sam
-PIPEWIRE_DOCS_VERSION="${PV}"
+PIPEWIRE_DOCS_VERSION="$(ver_cut 1-2).0"
 # Default to generating docs (inc. man pages) if no prebuilt; overridden later
 PIPEWIRE_DOCS_USEFLAG="+man"
 PYTHON_COMPAT=( python3_{10..13} )
-inherit meson-multilib optfeature prefix python-any-r1 systemd tmpfiles udev
+inherit eapi9-ver meson-multilib optfeature prefix python-any-r1 systemd 
tmpfiles udev
 
 if [[ ${PV} == 9999 ]]; then
        PIPEWIRE_DOCS_PREBUILT=0
@@ -334,8 +334,12 @@ multilib_src_install_all() {
                dosym 
../../../usr/share/alsa/alsa.conf.d/99-pipewire-default-hook.conf 
/etc/alsa/conf.d/99-pipewire-default-hook.conf
        fi
 
+       exeinto /etc/user/init.d
+       newexe "${FILESDIR}"/pipewire.initd pipewire
        # Enable required wireplumber alsa and bluez monitors
        if use sound-server; then
+               newexe "${FILESDIR}"/pipewire-pulse.initd pipewire-pulse
+
                # Install sound-server enabler for wireplumber 0.5.0+ conf 
syntax
                insinto /etc/wireplumber/wireplumber.conf.d
                doins 
"${FILESDIR}"/gentoo-sound-server-enable-audio-bluetooth.conf
@@ -387,8 +391,7 @@ pkg_postinst() {
 
        use system-service && tmpfiles_process pipewire.conf
 
-       local ver
-       for ver in ${REPLACING_VERSIONS} ; do
+       if [[ -n ${REPLACING_VERSIONS} ]] ; then
                if has_version kde-plasma/kwin[screencast] || has_version 
x11-wm/mutter[screencast] ; then
                        # https://bugs.gentoo.org/908490
                        # 
https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/3243
@@ -396,7 +399,7 @@ pkg_postinst() {
                        ewarn "Screencasting may not work until you do."
                fi
 
-               if ver_test ${ver} -le 0.3.66-r1 ; then
+               if ver_replacing -le 0.3.66-r1 ; then
                        elog ">=pipewire-0.3.66 uses the 'pipewire' group to 
manage permissions"
                        elog "and limits needed to function smoothly:"
                        elog
@@ -462,7 +465,7 @@ pkg_postinst() {
                                fi
                        fi
                fi
-       done
+       fi
 
        if [[ ${HAD_SOUND_SERVER} -eq 0 || -z ${REPLACING_VERSIONS} ]] ; then
                # TODO: We could drop most of this if we set up systemd presets?

diff --git a/media-video/pipewire/pipewire-9999.ebuild 
b/media-video/pipewire/pipewire-9999.ebuild
index 1593763ba9c5..98cf773a4ab6 100644
--- a/media-video/pipewire/pipewire-9999.ebuild
+++ b/media-video/pipewire/pipewire-9999.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -334,8 +334,12 @@ multilib_src_install_all() {
                dosym 
../../../usr/share/alsa/alsa.conf.d/99-pipewire-default-hook.conf 
/etc/alsa/conf.d/99-pipewire-default-hook.conf
        fi
 
+       exeinto /etc/user/init.d
+       newexe "${FILESDIR}"/pipewire.initd pipewire
        # Enable required wireplumber alsa and bluez monitors
        if use sound-server; then
+               newexe "${FILESDIR}"/pipewire-pulse.initd pipewire-pulse
+
                # Install sound-server enabler for wireplumber 0.5.0+ conf 
syntax
                insinto /etc/wireplumber/wireplumber.conf.d
                doins 
"${FILESDIR}"/gentoo-sound-server-enable-audio-bluetooth.conf

Reply via email to