Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-video/wireplumber/files/, media-video/wireplumber/
Date: Fri, 13 May 2022 00:41:51
Message-Id: 1652402475.12ffc90b5986b4a2eb943fb5bf94c3393991761d.sam@gentoo
1 commit: 12ffc90b5986b4a2eb943fb5bf94c3393991761d
2 Author: Niklāvs Koļesņikovs <89q1r14hd <AT> relay <DOT> firefox <DOT> com>
3 AuthorDate: Thu May 12 13:51:21 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Fri May 13 00:41:15 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=12ffc90b
7
8 media-video/wireplumber: patch 0.4.10 to default enable backends
9
10 Due to signifiant number of people having outdated copies of
11 WirePlumber scripts, upstream chose to change the default behavior of
12 WP monitors (essentially PW backends) and to enable them by default,
13 so that they work with the older scripts.
14
15 Gentoo already duplicates to /etc/wireplumber which would trigger the
16 usual config protection mechanism but users could also have copied them
17 to ~/.config/wireplumber. Therefore it's still a nice thing to apply this
18 change.
19
20 Bug: https://gitlab.freedesktop.org/pipewire/wireplumber/-/issues/254
21
22 Signed-off-by: Niklāvs Koļesņikovs <89q1r14hd <AT> relay.firefox.com>
23 Closes: https://github.com/gentoo/gentoo/pull/25455
24 Signed-off-by: Sam James <sam <AT> gentoo.org>
25
26 ...-enabled-property-to-default-to-true-when.patch | 129 +++++++++++++++++++++
27 .../wireplumber/wireplumber-0.4.10-r1.ebuild | 122 +++++++++++++++++++
28 2 files changed, 251 insertions(+)
29
30 diff --git a/media-video/wireplumber/files/wireplumber-0.4.10-config-fix-enabled-property-to-default-to-true-when.patch b/media-video/wireplumber/files/wireplumber-0.4.10-config-fix-enabled-property-to-default-to-true-when.patch
31 new file mode 100644
32 index 000000000000..40a486616580
33 --- /dev/null
34 +++ b/media-video/wireplumber/files/wireplumber-0.4.10-config-fix-enabled-property-to-default-to-true-when.patch
35 @@ -0,0 +1,129 @@
36 +https://gitlab.freedesktop.org/pipewire/wireplumber/-/commit/1f045309208ab5d927883b5adc2b7d1623fae162
37 +
38 +From 1f045309208ab5d927883b5adc2b7d1623fae162 Mon Sep 17 00:00:00 2001
39 +From: George Kiagiadakis <george.kiagiadakis@×××××××××.com>
40 +Date: Thu, 12 May 2022 12:19:38 +0300
41 +Subject: [PATCH] config: fix enabled property to default to "true" when not
42 + defined
43 +
44 +Fixes backwards compatibility with older config files
45 +
46 +Fixes: #254
47 +---
48 + src/config/bluetooth.lua.d/30-bluez-monitor.lua | 2 +-
49 + src/config/main.lua.d/20-default-access.lua | 2 +-
50 + src/config/main.lua.d/30-alsa-monitor.lua | 2 +-
51 + src/config/main.lua.d/30-libcamera-monitor.lua | 2 +-
52 + src/config/main.lua.d/30-v4l2-monitor.lua | 2 +-
53 + src/config/main.lua.d/40-device-defaults.lua | 2 +-
54 + src/config/main.lua.d/40-stream-defaults.lua | 2 +-
55 + src/config/policy.lua.d/10-default-policy.lua | 2 +-
56 + 8 files changed, 8 insertions(+), 8 deletions(-)
57 +
58 +diff --git a/src/config/bluetooth.lua.d/30-bluez-monitor.lua b/src/config/bluetooth.lua.d/30-bluez-monitor.lua
59 +index b40026c2..a870aa5d 100644
60 +--- a/src/config/bluetooth.lua.d/30-bluez-monitor.lua
61 ++++ b/src/config/bluetooth.lua.d/30-bluez-monitor.lua
62 +@@ -3,7 +3,7 @@ bluez_monitor.properties = {}
63 + bluez_monitor.rules = {}
64 +
65 + function bluez_monitor.enable()
66 +- if not bluez_monitor.enabled then
67 ++ if bluez_monitor.enabled == false then
68 + return
69 + end
70 +
71 +diff --git a/src/config/main.lua.d/20-default-access.lua b/src/config/main.lua.d/20-default-access.lua
72 +index a6ffb2ee..0a7eb955 100644
73 +--- a/src/config/main.lua.d/20-default-access.lua
74 ++++ b/src/config/main.lua.d/20-default-access.lua
75 +@@ -3,7 +3,7 @@ default_access.properties = {}
76 + default_access.rules = {}
77 +
78 + function default_access.enable()
79 +- if not default_access.enabled then
80 ++ if default_access.enabled == false then
81 + return
82 + end
83 +
84 +diff --git a/src/config/main.lua.d/30-alsa-monitor.lua b/src/config/main.lua.d/30-alsa-monitor.lua
85 +index da0b2c70..8e45e434 100644
86 +--- a/src/config/main.lua.d/30-alsa-monitor.lua
87 ++++ b/src/config/main.lua.d/30-alsa-monitor.lua
88 +@@ -3,7 +3,7 @@ alsa_monitor.properties = {}
89 + alsa_monitor.rules = {}
90 +
91 + function alsa_monitor.enable()
92 +- if not alsa_monitor.enabled then
93 ++ if alsa_monitor.enabled == false then
94 + return
95 + end
96 +
97 +diff --git a/src/config/main.lua.d/30-libcamera-monitor.lua b/src/config/main.lua.d/30-libcamera-monitor.lua
98 +index 4a8257ff..cd820a83 100644
99 +--- a/src/config/main.lua.d/30-libcamera-monitor.lua
100 ++++ b/src/config/main.lua.d/30-libcamera-monitor.lua
101 +@@ -3,7 +3,7 @@ libcamera_monitor.properties = {}
102 + libcamera_monitor.rules = {}
103 +
104 + function libcamera_monitor.enable()
105 +- if not libcamera_monitor.enabled then
106 ++ if libcamera_monitor.enabled == false then
107 + return
108 + end
109 +
110 +diff --git a/src/config/main.lua.d/30-v4l2-monitor.lua b/src/config/main.lua.d/30-v4l2-monitor.lua
111 +index 7cfd4bcd..3fbdc9e7 100644
112 +--- a/src/config/main.lua.d/30-v4l2-monitor.lua
113 ++++ b/src/config/main.lua.d/30-v4l2-monitor.lua
114 +@@ -3,7 +3,7 @@ v4l2_monitor.properties = {}
115 + v4l2_monitor.rules = {}
116 +
117 + function v4l2_monitor.enable()
118 +- if not v4l2_monitor.enabled then
119 ++ if v4l2_monitor.enabled == false then
120 + return
121 + end
122 +
123 +diff --git a/src/config/main.lua.d/40-device-defaults.lua b/src/config/main.lua.d/40-device-defaults.lua
124 +index 55aafe85..2204c4ac 100644
125 +--- a/src/config/main.lua.d/40-device-defaults.lua
126 ++++ b/src/config/main.lua.d/40-device-defaults.lua
127 +@@ -38,7 +38,7 @@ device_defaults.persistent_profiles = {
128 + }
129 +
130 + function device_defaults.enable()
131 +- if not device_defaults.enabled then
132 ++ if device_defaults.enabled == false then
133 + return
134 + end
135 +
136 +diff --git a/src/config/main.lua.d/40-stream-defaults.lua b/src/config/main.lua.d/40-stream-defaults.lua
137 +index 2975f4f6..307d83df 100644
138 +--- a/src/config/main.lua.d/40-stream-defaults.lua
139 ++++ b/src/config/main.lua.d/40-stream-defaults.lua
140 +@@ -25,7 +25,7 @@ stream_defaults.rules = {
141 + }
142 +
143 + function stream_defaults.enable()
144 +- if not stream_defaults.enabled then
145 ++ if stream_defaults.enabled == false then
146 + return
147 + end
148 +
149 +diff --git a/src/config/policy.lua.d/10-default-policy.lua b/src/config/policy.lua.d/10-default-policy.lua
150 +index 7b00e94e..edfdeb1c 100644
151 +--- a/src/config/policy.lua.d/10-default-policy.lua
152 ++++ b/src/config/policy.lua.d/10-default-policy.lua
153 +@@ -38,7 +38,7 @@ bluetooth_policy.policy = {
154 + }
155 +
156 + function default_policy.enable()
157 +- if not default_policy.enabled then
158 ++ if default_policy.enabled == false then
159 + return
160 + end
161 +
162 +--
163 +GitLab
164 +
165
166 diff --git a/media-video/wireplumber/wireplumber-0.4.10-r1.ebuild b/media-video/wireplumber/wireplumber-0.4.10-r1.ebuild
167 new file mode 100644
168 index 000000000000..b711ad6e7ae9
169 --- /dev/null
170 +++ b/media-video/wireplumber/wireplumber-0.4.10-r1.ebuild
171 @@ -0,0 +1,122 @@
172 +# Copyright 1999-2022 Gentoo Authors
173 +# Distributed under the terms of the GNU General Public License v2
174 +
175 +EAPI=8
176 +
177 +LUA_COMPAT=( lua5-{3,4} )
178 +
179 +inherit lua-single meson systemd
180 +
181 +if [[ ${PV} == 9999 ]]; then
182 + EGIT_REPO_URI="https://gitlab.freedesktop.org/pipewire/${PN}.git"
183 + EGIT_BRANCH="master"
184 + inherit git-r3
185 +else
186 + SRC_URI="https://gitlab.freedesktop.org/pipewire/${PN}/-/archive/${PV}/${P}.tar.gz"
187 + KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~sparc ~x86"
188 +fi
189 +
190 +DESCRIPTION="Replacement for pipewire-media-session"
191 +HOMEPAGE="https://gitlab.freedesktop.org/pipewire/wireplumber"
192 +
193 +LICENSE="MIT"
194 +SLOT="0/0.4"
195 +IUSE="elogind system-service systemd test"
196 +
197 +REQUIRED_USE="
198 + ${LUA_REQUIRED_USE}
199 + ?? ( elogind systemd )
200 + system-service? ( systemd )
201 +"
202 +
203 +RESTRICT="!test? ( test )"
204 +
205 +# introspection? ( dev-libs/gobject-introspection ) is valid but likely only used for doc building
206 +BDEPEND="
207 + dev-libs/glib
208 + dev-util/gdbus-codegen
209 + dev-util/glib-utils
210 + sys-devel/gettext
211 +"
212 +
213 +DEPEND="
214 + ${LUA_DEPS}
215 + >=dev-libs/glib-2.62
216 + >=media-video/pipewire-0.3.48:=
217 + virtual/libc
218 + virtual/libintl
219 + elogind? ( sys-auth/elogind )
220 + systemd? ( sys-apps/systemd )
221 +"
222 +
223 +# Any dev-lua/* deps get declared like this inside RDEPEND:
224 +# $(lua_gen_cond_dep '
225 +# dev-lua/<NAME>[${LUA_USEDEP}]
226 +# ')
227 +RDEPEND="${DEPEND}
228 + system-service? (
229 + acct-user/pipewire
230 + acct-group/pipewire
231 + )
232 +"
233 +
234 +DOCS=( {NEWS,README}.rst )
235 +
236 +PATCHES=(
237 + "${FILESDIR}"/${P}-config-fix-enabled-property-to-default-to-true-when.patch
238 +)
239 +
240 +src_configure() {
241 + local emesonargs=(
242 + -Ddoc=disabled # Ebuild not wired up yet (Sphinx, Doxygen?)
243 + -Dintrospection=disabled # Only used for Sphinx doc generation
244 + -Dsystem-lua=true # We always unbundle everything we can
245 + -Dsystem-lua-version=$(ver_cut 1-2 $(lua_get_version))
246 + $(meson_feature elogind)
247 + $(meson_feature systemd)
248 + $(meson_use system-service systemd-system-service)
249 + $(meson_use systemd systemd-user-service)
250 + -Dsystemd-system-unit-dir=$(systemd_get_systemunitdir)
251 + -Dsystemd-user-unit-dir=$(systemd_get_userunitdir)
252 + $(meson_use test tests)
253 + )
254 +
255 + meson_src_configure
256 +}
257 +
258 +src_install() {
259 + meson_src_install
260 +
261 + # We copy the default config, so that Gentoo tools can pick up on any
262 + # updates and /etc does not end up with stale overrides.
263 + # If a reflinking CoW filesystem is used (e.g. Btrfs), then the files
264 + # will not actually get stored twice until modified.
265 + insinto /etc
266 + doins -r ${ED}/usr/share/wireplumber
267 +}
268 +
269 +pkg_postinst() {
270 + if systemd_is_booted ; then
271 + ewarn "pipewire-media-session.service is no longer installed. You must switch"
272 + ewarn "to wireplumber.service user unit before your next logout/reboot:"
273 + ewarn "systemctl --user disable pipewire-media-session.service"
274 + ewarn "systemctl --user --force enable wireplumber.service"
275 + else
276 + ewarn "Switch to WirePlumber will happen the next time gentoo-pipewire-launcher"
277 + ewarn "is started (a replacement for directly calling pipewire binary)."
278 + ewarn
279 + ewarn "Please ensure that ${EROOT}/etc/pipewire/pipewire.conf either does not exist"
280 + ewarn "or, if it does exist, that any reference to"
281 + ewarn "${EROOT}/usr/bin/pipewire-media-session is commented out (begins with a #)."
282 + fi
283 + if use system-service; then
284 + ewarn
285 + ewarn "WARNING: you have enabled the system-service USE flag, which installs"
286 + ewarn "the system-wide systemd units that enable WirePlumber to run as a system"
287 + ewarn "service. This is more than likely NOT what you want. You are strongly"
288 + ewarn "advised not to enable this mode and instead stick with systemd user"
289 + ewarn "units. The default configuration files will likely not work out of"
290 + ewarn "box, and you are on your own with configuration."
291 + ewarn
292 + fi
293 +}