From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id B51C215808D for ; Thu, 21 Apr 2022 21:57:26 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D46EAE092D; Thu, 21 Apr 2022 21:57:24 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C7E07E0928 for ; Thu, 21 Apr 2022 21:57:23 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A0B42341C4D for ; Thu, 21 Apr 2022 21:57:22 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 234B02E0 for ; Thu, 21 Apr 2022 21:57:21 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1650578220.dbd15d4f2887fa9bd30a88ae68e77d23f0835928.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: media-video/wireplumber/files/, media-video/wireplumber/ X-VCS-Repository: repo/gentoo X-VCS-Files: media-video/wireplumber/files/wireplumber-0.4.9-config-document-which-options-need-to-be-turned-off-.patch media-video/wireplumber/files/wireplumber-0.4.9-scripts-policy-device-profile-clear-tables-when-devi.patch media-video/wireplumber/wireplumber-0.4.9-r1.ebuild X-VCS-Directories: media-video/wireplumber/files/ media-video/wireplumber/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: dbd15d4f2887fa9bd30a88ae68e77d23f0835928 X-VCS-Branch: master Date: Thu, 21 Apr 2022 21:57:21 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 796d94f3-f06f-4be9-bc51-7ec69d9c27d5 X-Archives-Hash: 7534eb8806ae0f39ec68272afd757ae1 commit: dbd15d4f2887fa9bd30a88ae68e77d23f0835928 Author: Niklāvs Koļesņikovs <89q1r14hd relay firefox com> AuthorDate: Thu Apr 21 18:02:38 2022 +0000 Commit: Sam James gentoo org> CommitDate: Thu Apr 21 21:57:00 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dbd15d4f media-video/wireplumber: backport two minor fixes The first fix deals with handling of device removal and is included for correctness sake, since it appears to be the right thing for WirePlumber to do. The second fix implements and documents D-Bus disabling for WirePlumber which must be done when attempting to run WirePlumber as a system service. This does not mean it's a recommended or even fully supported configuration but there's people who want it. And having it available should not cause any harm to other users. Signed-off-by: Niklāvs Koļesņikovs <89q1r14hd relay.firefox.com> Signed-off-by: Sam James gentoo.org> ...ment-which-options-need-to-be-turned-off-.patch | 87 +++++++++++++++ ...icy-device-profile-clear-tables-when-devi.patch | 33 ++++++ .../wireplumber/wireplumber-0.4.9-r1.ebuild | 121 +++++++++++++++++++++ 3 files changed, 241 insertions(+) diff --git a/media-video/wireplumber/files/wireplumber-0.4.9-config-document-which-options-need-to-be-turned-off-.patch b/media-video/wireplumber/files/wireplumber-0.4.9-config-document-which-options-need-to-be-turned-off-.patch new file mode 100644 index 000000000000..9e664ec56564 --- /dev/null +++ b/media-video/wireplumber/files/wireplumber-0.4.9-config-document-which-options-need-to-be-turned-off-.patch @@ -0,0 +1,87 @@ +https://gitlab.freedesktop.org/pipewire/wireplumber/-/commit/0da29f38181e391160fa8702623050b8544ec775 + +From 0da29f38181e391160fa8702623050b8544ec775 Mon Sep 17 00:00:00 2001 +From: George Kiagiadakis +Date: Mon, 4 Apr 2022 14:38:28 +0300 +Subject: [PATCH] config: document which options need to be turned off to use + wp without D-Bus + +and actually implement an option for the logind module + +Related to: #237 +--- + src/config/bluetooth.lua.d/30-bluez-monitor.lua | 4 +++- + src/config/bluetooth.lua.d/50-bluez-config.lua | 8 ++++++++ + src/config/main.lua.d/50-alsa-config.lua | 4 +++- + src/config/main.lua.d/50-default-access-config.lua | 3 +++ + 4 files changed, 17 insertions(+), 2 deletions(-) + +diff --git a/src/config/bluetooth.lua.d/30-bluez-monitor.lua b/src/config/bluetooth.lua.d/30-bluez-monitor.lua +index 266d3e2f..ba86657f 100644 +--- a/src/config/bluetooth.lua.d/30-bluez-monitor.lua ++++ b/src/config/bluetooth.lua.d/30-bluez-monitor.lua +@@ -8,5 +8,7 @@ function bluez_monitor.enable() + rules = bluez_monitor.rules, + }) + +- load_optional_module("logind") ++ if bluez_monitor.properties["with-logind"] then ++ load_optional_module("logind") ++ end + end +diff --git a/src/config/bluetooth.lua.d/50-bluez-config.lua b/src/config/bluetooth.lua.d/50-bluez-config.lua +index 072504ec..dd8033ff 100644 +--- a/src/config/bluetooth.lua.d/50-bluez-config.lua ++++ b/src/config/bluetooth.lua.d/50-bluez-config.lua +@@ -34,6 +34,14 @@ bluez_monitor.properties = { + -- Register dummy AVRCP player, required for AVRCP volume function. + -- Disable if you are running mpris-proxy or equivalent. + --["bluez5.dummy-avrcp-player"] = true, ++ ++ -- Enable the logind module, which arbitrates which user will be allowed ++ -- to have bluetooth audio enabled at any given time (particularly useful ++ -- if you are using GDM as a display manager, as the gdm user also launches ++ -- pipewire and wireplumber). ++ -- This requires access to the D-Bus user session; disable if you are running ++ -- a system-wide instance of wireplumber. ++ ["with-logind"] = true, + } + + bluez_monitor.rules = { +diff --git a/src/config/main.lua.d/50-alsa-config.lua b/src/config/main.lua.d/50-alsa-config.lua +index 6c97e8ad..d29b0b6f 100644 +--- a/src/config/main.lua.d/50-alsa-config.lua ++++ b/src/config/main.lua.d/50-alsa-config.lua +@@ -7,6 +7,8 @@ alsa_monitor.properties = { + --["alsa.jack-device"] = false, + + -- Reserve devices via org.freedesktop.ReserveDevice1 on D-Bus ++ -- Disable if you are running a system-wide instance, which ++ -- doesn't have access to the D-Bus user session + ["alsa.reserve"] = true, + --["alsa.reserve.priority"] = -20, + --["alsa.reserve.application-name"] = "WirePlumber", +@@ -20,7 +22,7 @@ alsa_monitor.properties = { + + alsa_monitor.rules = { + -- An array of matches/actions to evaluate. +- -- ++ -- + -- If you want to disable some devices or nodes, you can apply properties per device as the following example. + -- The name can be found by running pw-cli ls Device, or pw-cli dump Device + --{ +diff --git a/src/config/main.lua.d/50-default-access-config.lua b/src/config/main.lua.d/50-default-access-config.lua +index 6cf18bed..45cc5b73 100644 +--- a/src/config/main.lua.d/50-default-access-config.lua ++++ b/src/config/main.lua.d/50-default-access-config.lua +@@ -1,4 +1,7 @@ + default_access.properties = { ++ -- Enable the use of the flatpak portal integration. ++ -- Disable if you are running a system-wide instance, which ++ -- doesn't have access to the D-Bus user session + ["enable-flatpak-portal"] = true, + } + +-- +GitLab + diff --git a/media-video/wireplumber/files/wireplumber-0.4.9-scripts-policy-device-profile-clear-tables-when-devi.patch b/media-video/wireplumber/files/wireplumber-0.4.9-scripts-policy-device-profile-clear-tables-when-devi.patch new file mode 100644 index 000000000000..4dc8e276fbfa --- /dev/null +++ b/media-video/wireplumber/files/wireplumber-0.4.9-scripts-policy-device-profile-clear-tables-when-devi.patch @@ -0,0 +1,33 @@ +https://gitlab.freedesktop.org/pipewire/wireplumber/-/commit/da5d25acbea5ae03336bd2b4ef2b0687b380978e + +From da5d25acbea5ae03336bd2b4ef2b0687b380978e Mon Sep 17 00:00:00 2001 +From: Pauli Virtanen +Date: Mon, 28 Mar 2022 20:16:52 +0300 +Subject: [PATCH] scripts: policy-device-profile: clear tables when devices + removed + +When device ids are invalidated, clear all local tables about them, +because the id may be reused by different object, or the same object +reappearing. +--- + src/scripts/policy-device-profile.lua | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/scripts/policy-device-profile.lua b/src/scripts/policy-device-profile.lua +index d0aa2696..9daeafaa 100644 +--- a/src/scripts/policy-device-profile.lua ++++ b/src/scripts/policy-device-profile.lua +@@ -229,4 +229,10 @@ self.om:connect("object-added", function (_, device) + handleProfiles (device, true) + end) + ++self.om:connect("object-removed", function (_, device) ++ local dev_id = device["bound-id"] ++ self.active_profiles[dev_id] = nil ++ self.best_profiles[dev_id] = nil ++end) ++ + self.om:activate() +-- +GitLab + diff --git a/media-video/wireplumber/wireplumber-0.4.9-r1.ebuild b/media-video/wireplumber/wireplumber-0.4.9-r1.ebuild new file mode 100644 index 000000000000..f269c7faf59c --- /dev/null +++ b/media-video/wireplumber/wireplumber-0.4.9-r1.ebuild @@ -0,0 +1,121 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +LUA_COMPAT=( lua5-{3,4} ) + +inherit lua-single meson systemd + +if [[ ${PV} == 9999 ]]; then + EGIT_REPO_URI="https://gitlab.freedesktop.org/pipewire/${PN}.git" + EGIT_BRANCH="master" + inherit git-r3 +else + SRC_URI="https://gitlab.freedesktop.org/pipewire/${PN}/-/archive/${PV}/${P}.tar.gz" + KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~sparc ~x86" +fi + +DESCRIPTION="Replacement for pipewire-media-session" +HOMEPAGE="https://gitlab.freedesktop.org/pipewire/wireplumber" + +LICENSE="MIT" +SLOT="0/0.4" +IUSE="elogind system-service systemd test" + +REQUIRED_USE=" + ${LUA_REQUIRED_USE} + ?? ( elogind systemd ) + system-service? ( systemd ) +" + +RESTRICT="!test? ( test )" + +# introspection? ( dev-libs/gobject-introspection ) is valid but likely only used for doc building +BDEPEND=" + dev-libs/glib + dev-util/gdbus-codegen + dev-util/glib-utils +" + +DEPEND=" + ${LUA_DEPS} + >=dev-libs/glib-2.62 + >=media-video/pipewire-0.3.48:= + virtual/libc + elogind? ( sys-auth/elogind ) + systemd? ( sys-apps/systemd ) +" + +# Any dev-lua/* deps get declared like this inside RDEPEND: +# $(lua_gen_cond_dep ' +# dev-lua/[${LUA_USEDEP}] +# ') +RDEPEND="${DEPEND} + system-service? ( + acct-user/pipewire + acct-group/pipewire + ) +" + +DOCS=( {NEWS,README}.rst ) + +PATCHES=( + "${FILESDIR}"/${P}-scripts-policy-device-profile-clear-tables-when-devi.patch + "${FILESDIR}"/${P}-config-document-which-options-need-to-be-turned-off-.patch +) + +src_configure() { + local emesonargs=( + -Ddoc=disabled # Ebuild not wired up yet (Sphinx, Doxygen?) + -Dintrospection=disabled # Only used for Sphinx doc generation + -Dsystem-lua=true # We always unbundle everything we can + -Dsystem-lua-version=$(ver_cut 1-2 $(lua_get_version)) + $(meson_feature elogind) + $(meson_feature systemd) + $(meson_use system-service systemd-system-service) + $(meson_use systemd systemd-user-service) + -Dsystemd-system-unit-dir=$(systemd_get_systemunitdir) + -Dsystemd-user-unit-dir=$(systemd_get_userunitdir) + $(meson_use test tests) + ) + + meson_src_configure +} + +src_install() { + meson_src_install + + # We copy the default config, so that Gentoo tools can pick up on any + # updates and /etc does not end up with stale overrides. + # If a reflinking CoW filesystem is used (e.g. Btrfs), then the files + # will not actually get stored twice until modified. + insinto /etc + doins -r ${ED}/usr/share/wireplumber +} + +pkg_postinst() { + if systemd_is_booted ; then + ewarn "pipewire-media-session.service is no longer installed. You must switch" + ewarn "to wireplumber.service user unit before your next logout/reboot:" + ewarn "systemctl --user disable pipewire-media-session.service" + ewarn "systemctl --user --force enable wireplumber.service" + else + ewarn "Switch to WirePlumber will happen the next time gentoo-pipewire-launcher" + ewarn "is started (a replacement for directly calling pipewire binary)." + ewarn + ewarn "Please ensure that ${EROOT}/etc/pipewire/pipewire.conf either does not exist" + ewarn "or, if it does exist, that any reference to" + ewarn "${EROOT}/usr/bin/pipewire-media-session is commented out (begins with a #)." + fi + if use system-service; then + ewarn + ewarn "WARNING: you have enabled the system-service USE flag, which installs" + ewarn "the system-wide systemd units that enable WirePlumber to run as a system" + ewarn "service. This is more than likely NOT what you want. You are strongly" + ewarn "advised not to enable this mode and instead stick with systemd user" + ewarn "units. The default configuration files will likely not work out of" + ewarn "box, and you are on your own with configuration." + ewarn + fi +}