- Update to version 0.5.7:

* Highlights:
    - Fixed an issue that would cause random profile switching when
      an application was trying to capture from non-Bluetooth
      devices (#715, #634, !669)
    - Fixed an issue that would cause strange profile selection
      issues [choices not being remembered or unavailable routes
      being selected] (#734)
    - Added a timer that delays switching Bluetooth headsets to the
      HSP/HFP profile, avoiding needless rapid switching when an
      application is trying to probe device capabilities instead of
      actually capturing audio (!664)
    - Improved libcamera/v4l2 device deduplication logic to work
      with more complex devices (!674, !675, #689, #708)
  * Fixes:
    - Fixed two memory leaks in module-mixer-api and
      module-dbus-connection (!672, !673)
    - Fixed a crash that could occur in module-reserve-device
      (!680, #742)
    - Fixed an issue that would cause the warning
      "[string "alsa.lua"]:182: attempt to concatenate a nil value
      (local 'node_name')" to appear in the logs when an ALSA
      device was busy, breaking node name deduplication (!681)
    - Fixed an issue that could make find-preferred-profile.lua
      crash instead of properly applying profile priority rules
      (#751)
- Remove patches that are already included in 0.5.7:
  * 0001-autoswitch-bluetooth-profile-switch-only-Bluetooth-devices.patch
  * 0002-autoswitch-bluetooth-profile-Switch-to-HSP_HFP-on-timeout.patch
  * 0003-m-mixer-api-Fix-memory-in-leak-wp_mixer_api_set_volume.patch

OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/wireplumber?expand=0&rev=89
This commit is contained in:
Antonio Larrosa 2024-12-04 11:44:23 +00:00 committed by Git OBS Bridge
commit 4208d2399f
13 changed files with 2892 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

View File

@ -0,0 +1,67 @@
From b68a6794cd5c3702a2144be60c41a9ca982c416b Mon Sep 17 00:00:00 2001
From: Pauli Virtanen <pav@iki.fi>
Date: Sun, 8 Sep 2024 20:22:41 +0300
Subject: [PATCH] autoswitch-bluetooth-profile: switch only Bluetooth devices
Handle only devices associated with Bluetooth loopback nodes.
Make sure the node.link-group iteration cannot get stuck if there is a
loop in the link graph.
---
.../device/autoswitch-bluetooth-profile.lua | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/src/scripts/device/autoswitch-bluetooth-profile.lua b/src/scripts/device/autoswitch-bluetooth-profile.lua
index d4f3529f..70e27601 100644
--- a/src/scripts/device/autoswitch-bluetooth-profile.lua
+++ b/src/scripts/device/autoswitch-bluetooth-profile.lua
@@ -301,13 +301,14 @@ end
-- We consider a Stream of interest if it is linked to a bluetooth loopback
-- source filter
-local function checkStreamStatus (stream, node_om)
+local function checkStreamStatus (stream, node_om, visited_link_groups)
-- check if the stream is linked to a bluetooth loopback source
local stream_id = tonumber(stream["bound-id"])
local peer_id = lutils.getNodePeerId (stream_id)
if peer_id ~= nil then
local bt_node = node_om:lookup {
- Constraint { "bound-id", "=", peer_id, type = "gobject" }
+ Constraint { "bound-id", "=", peer_id, type = "gobject" },
+ Constraint { "bluez5.loopback", "=", "true", type = "pw" }
}
if bt_node ~= nil then
local dev_id = bt_node.properties["device.id"]
@@ -325,18 +326,27 @@ local function checkStreamStatus (stream, node_om)
else
-- Check if it is linked to a filter main node, and recursively advance if so
local filter_main_node = node_om:lookup {
- Constraint { "bound-id", "=", peer_id, type = "gobject" }
+ Constraint { "bound-id", "=", peer_id, type = "gobject" },
+ Constraint { "node.link-group", "+", type = "pw" }
}
if filter_main_node ~= nil then
-- Now check all stream nodes for this filter
local filter_link_group = filter_main_node.properties ["node.link-group"]
+ if visited_link_groups == nil then
+ visited_link_groups = {}
+ end
+ if visited_link_groups [filter_link_group] then
+ return nil
+ else
+ visited_link_groups [filter_link_group] = true
+ end
for filter_stream_node in node_om:iterate {
Constraint { "media.class", "matches", "Stream/Input/Audio", type = "pw-global" },
Constraint { "stream.monitor", "!", "true", type = "pw" },
Constraint { "bluez5.loopback", "!", "true", type = "pw" },
Constraint { "node.link-group", "=", filter_link_group, type = "pw" }
} do
- local dev_id = checkStreamStatus (filter_stream_node, node_om)
+ local dev_id = checkStreamStatus (filter_stream_node, node_om, visited_link_groups)
if dev_id ~= nil then
return dev_id
end
--
GitLab

View File

@ -0,0 +1,94 @@
From 76985fff5b4f771714ea1814d85a69298dd83897 Mon Sep 17 00:00:00 2001
From: Julian Bouzas <julian.bouzas@collabora.com>
Date: Fri, 12 Jul 2024 10:49:16 -0400
Subject: [PATCH] autoswitch-bluetooth-profile: Switch to HSP/HFP on timeout
This patch adds a 500ms timeout callback to switch to HSP/HFP when a stream
starts capturing BT audio. This avoids quickly switching from A2DP to HSP/HFP
back and forth if an application just wants to probe the BT source for a short
period of time.
See #634
---
.../device/autoswitch-bluetooth-profile.lua | 34 ++++++++++++++-----
1 file changed, 26 insertions(+), 8 deletions(-)
diff --git a/src/scripts/device/autoswitch-bluetooth-profile.lua b/src/scripts/device/autoswitch-bluetooth-profile.lua
index 70e27601..bd9def55 100644
--- a/src/scripts/device/autoswitch-bluetooth-profile.lua
+++ b/src/scripts/device/autoswitch-bluetooth-profile.lua
@@ -32,9 +32,11 @@ state = nil
headset_profiles = nil
local profile_restore_timeout_msec = 2000
+local profile_switch_timeout_msec = 500
local INVALID = -1
local restore_timeout_source = {}
+local switch_timeout_source = {}
local last_profiles = {}
@@ -174,12 +176,6 @@ local function switchDeviceToHeadsetProfile (dev_id, device_om)
return
end
- -- clear restore callback, if any
- if restore_timeout_source[dev_id] ~= nil then
- restore_timeout_source[dev_id]:destroy ()
- restore_timeout_source[dev_id] = nil
- end
-
local cur_profile_name = getCurrentProfile (device)
local priority, index, name = findProfile (device, nil, cur_profile_name)
if hasProfileInputRoute (device, index) then
@@ -278,6 +274,24 @@ local function restoreProfile (dev_id, device_om)
end
end
+local function triggerSwitchDeviceToHeadsetProfile (dev_id, device_om)
+ -- Always clear any pending restore/switch callbacks when triggering a new switch
+ if restore_timeout_source[dev_id] ~= nil then
+ restore_timeout_source[dev_id]:destroy ()
+ restore_timeout_source[dev_id] = nil
+ end
+ if switch_timeout_source[dev_id] ~= nil then
+ switch_timeout_source[dev_id]:destroy ()
+ switch_timeout_source[dev_id] = nil
+ end
+
+ -- create new switch callback
+ switch_timeout_source[dev_id] = Core.timeout_add (profile_switch_timeout_msec, function ()
+ switch_timeout_source[dev_id] = nil
+ switchDeviceToHeadsetProfile (dev_id, device_om)
+ end)
+end
+
local function triggerRestoreProfile (dev_id, device_om)
-- we never restore the device profiles if there are active streams
for _, v in pairs (active_streams) do
@@ -286,7 +300,11 @@ local function triggerRestoreProfile (dev_id, device_om)
end
end
- -- clear restore callback, if any
+ -- Always clear any pending restore/switch callbacks when triggering a new restore
+ if switch_timeout_source[dev_id] ~= nil then
+ switch_timeout_source[dev_id]:destroy ()
+ switch_timeout_source[dev_id] = nil
+ end
if restore_timeout_source[dev_id] ~= nil then
restore_timeout_source[dev_id]:destroy ()
restore_timeout_source[dev_id] = nil
@@ -367,7 +385,7 @@ local function handleStream (stream, node_om, device_om)
if dev_id ~= nil then
active_streams [stream.id] = dev_id
previous_streams [stream.id] = dev_id
- switchDeviceToHeadsetProfile (dev_id, device_om)
+ triggerSwitchDeviceToHeadsetProfile (dev_id, device_om)
else
dev_id = active_streams [stream.id]
active_streams [stream.id] = nil
--
GitLab

View File

@ -0,0 +1,36 @@
From 255b65d18204f7cf5c0706308196ffbcf8f1a697 Mon Sep 17 00:00:00 2001
From: Torkel Niklasson <torkel@axis.com>
Date: Thu, 26 Sep 2024 12:01:18 +0200
Subject: [PATCH] m-mixer-api: Fix memory in leak wp_mixer_api_set_volume
Declare result from wp_object_manager_lookup as g_autoptr, to prevent
leaking memory.
---
modules/module-mixer-api.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules/module-mixer-api.c b/modules/module-mixer-api.c
index e9dccbab0..502640c68 100644
--- a/modules/module-mixer-api.c
+++ b/modules/module-mixer-api.c
@@ -501,7 +501,7 @@ wp_mixer_api_set_volume (WpMixerApi * self, guint32 id, GVariant * vvolume)
props = wp_spa_pod_builder_end (b);
if (info->device_id != SPA_ID_INVALID) {
- WpPipewireObject *device = wp_object_manager_lookup (self->om,
+ g_autoptr (WpPipewireObject) device = wp_object_manager_lookup (self->om,
WP_TYPE_DEVICE, WP_CONSTRAINT_TYPE_G_PROPERTY,
"bound-id", "=u", info->device_id, NULL);
g_return_val_if_fail (device != NULL, FALSE);
@@ -514,7 +514,7 @@ wp_mixer_api_set_volume (WpMixerApi * self, guint32 id, GVariant * vvolume)
"save", "b", true,
NULL));
} else {
- WpPipewireObject *node = wp_object_manager_lookup (self->om,
+ g_autoptr (WpPipewireObject) node = wp_object_manager_lookup (self->om,
WP_TYPE_NODE, WP_CONSTRAINT_TYPE_G_PROPERTY,
"bound-id", "=u", id, NULL);
g_return_val_if_fail (node != NULL, FALSE);
--
GitLab

View File

@ -0,0 +1,64 @@
From ed80938b8c6a08aeb22ec4cefdee6f98c2f8e646 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= <pobrn@protonmail.com>
Date: Thu, 26 Sep 2024 14:49:12 +0200
Subject: [PATCH] module-dbus-connection: fix GCancellable leak
`wp_dbus_connection_disable()` creates a new GCancellable
object at the end, which is never freed if the GObject
is then destroyed. To fix this, override `finalize()` and
clear everything there as well.
Direct leak of 64 byte(s) in 1 object(s) allocated from:
0 0x70e688efd1aa in calloc /usr/src/debug/gcc/gcc/libsanitizer/asan/asan_malloc_linux.cpp:77
1 0x70e6874b3e62 in g_malloc0 (/usr/lib/libglib-2.0.so.0+0x63e62) (BuildId: 7b781c8d1a6e2161838c5d8f3bd797797c132753)
2 0x70e6875dea75 in g_type_create_instance (/usr/lib/libgobject-2.0.so.0+0x3ea75) (BuildId: 5af5e0f7d0a900ecb6083fbd71e22e5522d872e2)
3 0x70e6875c3804 (/usr/lib/libgobject-2.0.so.0+0x23804) (BuildId: 5af5e0f7d0a900ecb6083fbd71e22e5522d872e2)
4 0x70e6875c4e7e in g_object_new_with_properties (/usr/lib/libgobject-2.0.so.0+0x24e7e) (BuildId: 5af5e0f7d0a900ecb6083fbd71e22e5522d872e2)
5 0x70e6875c5ed1 in g_object_new (/usr/lib/libgobject-2.0.so.0+0x25ed1) (BuildId: 5af5e0f7d0a900ecb6083fbd71e22e5522d872e2)
6 0x70e684d2a8a6 in wp_dbus_connection_disable ../subprojects/wireplumber/modules/module-dbus-connection.c:173
7 0x70e688a833cc in wp_plugin_deactivate ../subprojects/wireplumber/lib/wp/plugin.c:144
8 0x70e688a7126c in wp_object_deactivate ../subprojects/wireplumber/lib/wp/object.c:542
9 0x70e688a6e74e in wp_object_dispose ../subprojects/wireplumber/lib/wp/object.c:191
10 0x70e6875c0f6c in g_object_unref (/usr/lib/libgobject-2.0.so.0+0x20f6c) (BuildId: 5af5e0f7d0a900ecb6083fbd71e22e5522d872e2)
11 0x70e6841f7d6d in wp_portal_permissionstore_plugin_disable ../subprojects/wireplumber/modules/module-portal-permissionstore.c:207
12 0x70e688a833cc in wp_plugin_deactivate ../subprojects/wireplumber/lib/wp/plugin.c:144
[...]
---
modules/module-dbus-connection.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/modules/module-dbus-connection.c b/modules/module-dbus-connection.c
index 21ba95a20..b337be5e1 100644
--- a/modules/module-dbus-connection.c
+++ b/modules/module-dbus-connection.c
@@ -211,6 +211,19 @@ wp_dbus_connection_set_property (GObject * object, guint property_id,
}
}
+static void
+wp_dbus_connection_finalize (GObject * object)
+{
+ WpDBusConnection *self = WP_DBUS_CONNECTION (object);
+
+ g_cancellable_cancel (self->cancellable);
+
+ g_clear_object (&self->connection);
+ g_clear_object (&self->cancellable);
+
+ G_OBJECT_CLASS (wp_dbus_connection_parent_class)->finalize (object);
+}
+
static void
wp_dbus_connection_class_init (WpDBusConnectionClass * klass)
{
@@ -219,6 +232,7 @@ wp_dbus_connection_class_init (WpDBusConnectionClass * klass)
object_class->get_property = wp_dbus_connection_get_property;
object_class->set_property = wp_dbus_connection_set_property;
+ object_class->finalize = wp_dbus_connection_finalize;
plugin_class->enable = wp_dbus_connection_enable;
plugin_class->disable = wp_dbus_connection_disable;
--
GitLab

24
_service Normal file
View File

@ -0,0 +1,24 @@
<?xml version="1.0"?>
<services>
<service name="obs_scm" mode="manual">
<param name="scm">git</param>
<param name="url">https://gitlab.freedesktop.org/pipewire/wireplumber.git</param>
<param name="revision">0.5.7</param>
<param name="versionformat">@PARENT_TAG@</param>
<!--
<param name="revision">master</param>
<param name="versionformat">@PARENT_TAG@+git@TAG_OFFSET@.%h</param>
<param name="changesgenerate">enable</param>
-->
<!--
<param name="revision">master</param>
<param name="versionformat">@PARENT_TAG@+git%cd.%h</param>
-->
</service>
<service name="tar" mode="buildtime"/>
<service name="recompress" mode="buildtime">
<param name="file">*.tar</param>
<param name="compression">xz</param>
</service>
<service name="set_version" mode="manual" />
</services>

52
split-config-file.py Normal file
View File

@ -0,0 +1,52 @@
#!/usr/bin/python3
import hashlib
import sys
import re
def sha256_from_data(data):
hash_sha256 = hashlib.sha256()
hash_sha256.update(data)
return hash_sha256.hexdigest()
lines = open('wireplumber.conf', 'r', encoding='utf-8').readlines()
is_in_device_monitor = False
main_config_content = ''
device_monitors_content = ''
main_profile_contents = ''
for line in lines:
if re.match(' *## Device monitors$', line):
main_config_content += line
main_config_content += ' # Section moved to a device-monitors.conf file which is provided by the wireplumber-audio package\n\n'
is_in_device_monitor = True
continue
elif re.match(' *## ', line):
is_in_device_monitor = False
if is_in_device_monitor:
device_monitors_content += line
else:
# Fixes wireplumber running the main profile when not having audio support (bsc#1223916)
if line in [' hardware.audio = required\n', ' hardware.bluetooth = required\n']:
main_profile_contents += line
line = line.replace('required', 'disabled')
main_config_content += line
config_sha256 = sha256_from_data(device_monitors_content.encode('utf-8'))
verified_sha256 = 'bf33d018e5b924da71266636757fa264bc677b945c35e4dcd7f708da42731cc9'
if config_sha256 != verified_sha256:
print('The "Device monitors" section was modified, please verify that the contents are ok')
print('and if they are, modify the "verified_sha256" value in this script to')
print(f' {config_sha256}')
print('Current device monitors section is:')
print(device_monitors_content)
sys.exit(1)
device_monitors_content = 'wireplumber.components = [\n' + device_monitors_content + ']'
main_profile_contents = 'wireplumber.profiles = {\n main = {\n' + main_profile_contents + ' }\n}\n'
open('wireplumber.conf', 'w', encoding='utf-8').write(main_config_content)
open('wireplumber.conf.d/00-device-monitors.conf', 'w', encoding='utf-8').write(device_monitors_content)
open('wireplumber.conf.d/01-require-audio-in-main-profile.conf', 'w', encoding='utf-8').write(main_profile_contents)

BIN
wireplumber-0.5.6.obscpio (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:93899496a3ffaf69bc0d683343b14eb4a98a505f98796f592f9a7b6c9e4672a8
size 2802700

2240
wireplumber.changes Normal file

File diff suppressed because it is too large Load Diff

4
wireplumber.obsinfo Normal file
View File

@ -0,0 +1,4 @@
name: wireplumber
version: 0.5.7
mtime: 1733148617
commit: 3e7c87a84c30125717eaf8adb1aca3d4dedbb70e

281
wireplumber.spec Normal file
View File

@ -0,0 +1,281 @@
#
# spec file for package wireplumber
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define pipewire_minimum_version 1.0.2
%define apiver 0.5
%define apiver_str 0_5
%define sover 0
%define libwireplumber libwireplumber-%{apiver_str}-%{sover}
Name: wireplumber
Version: 0.5.7
Release: 0
Summary: Session / policy manager implementation for PipeWire
License: MIT
Group: Development/Libraries/C and C++
URL: https://gitlab.freedesktop.org/pipewire/wireplumber
Source0: wireplumber-%{version}.tar.xz
Source1: split-config-file.py
# docs
BuildRequires: doxygen
BuildRequires: graphviz
# /docs
BuildRequires: cmake
BuildRequires: fdupes
BuildRequires: meson >= 0.59.0
BuildRequires: pipewire >= %{pipewire_minimum_version}
BuildRequires: pipewire-spa-plugins-0_2 >= %{pipewire_minimum_version}
BuildRequires: pkgconfig
BuildRequires: python3-base
BuildRequires: python3-lxml
BuildRequires: xmltoman
BuildRequires: pkgconfig(dbus-1)
BuildRequires: pkgconfig(gio-unix-2.0)
BuildRequires: pkgconfig(glib-2.0) >= 2.62.0
BuildRequires: pkgconfig(gmodule-2.0)
BuildRequires: pkgconfig(gobject-2.0) >= 2.62
BuildRequires: pkgconfig(gobject-introspection-1.0)
BuildRequires: pkgconfig(libpipewire-0.3) >= %{pipewire_minimum_version}
BuildRequires: pkgconfig(libsystemd)
BuildRequires: pkgconfig(lua)
BuildRequires: pkgconfig(systemd)
BuildRequires: python3-Sphinx
BuildRequires: python3-sphinx_rtd_theme
BuildRequires: python3-breathe
#!BuildIgnore: pipewire-session-manager
# Setup ALSA devices if PipeWire handles PulseAudio or JACK connections.
Requires: (%{name}-audio if (pipewire-pulseaudio or pipewire-jack))
Requires: pipewire >= %{pipewire_minimum_version}
Provides: pipewire-session-manager
%if 0%{?suse_version} <= 1500
BuildRequires: gcc9
BuildRequires: gcc9-c++
%else
BuildRequires: c++_compiler
%endif
%{?systemd_ordering}
%description
WirePlumber is a modular session / policy manager for PipeWire and
a GObject-based high-level library that wraps PipeWire's API,
providing convenience for writing the daemon's modules as well as
external tools for managing PipeWire.
%lang_package
%package doc
Summary: Wireplumber Session / policy manager documentation
Group: Development/Libraries/C and C++
BuildArch: noarch
%description doc
This package contains documentation for the WirePlumber
session/policy manager for PipeWire.
%package audio
Summary: Enable audio support in PipeWire / WirePlumber
Group: Development/Libraries/C and C++
Requires: %{libwireplumber} = %{version}
Requires: %{name} = %{version}
Recommends: pipewire-jack
Recommends: pipewire-pulseaudio
Conflicts: pulseaudio
BuildArch: noarch
%description audio
WirePlumber is a modular session / policy manager for PipeWire and
a GObject-based high-level library that wraps PipeWire's API,
providing convenience for writing the daemon's modules as well as
external tools for managing PipeWire.
This package enables the use of alsa devices in PipeWire.
%package devel
Summary: Session / policy manager implementation for PipeWire
Group: Development/Libraries/C and C++
Requires: %{libwireplumber} = %{version}
Requires: %{name} = %{version}
%description devel
WirePlumber is a modular session / policy manager for PipeWire and
a GObject-based high-level library that wraps PipeWire's API,
providing convenience for writing the daemon's modules as well as
external tools for managing PipeWire.
This package provides all the necessary files for development with WirePlumber
%package -n %{libwireplumber}
Summary: Session / policy manager implementation for PipeWire
Group: System/Libraries
%description -n %{libwireplumber}
WirePlumber is a modular session / policy manager for PipeWire and
a GObject-based high-level library that wraps PipeWire's API,
providing convenience for writing the daemon's modules as well as
external tools for managing PipeWire.
This package provides the wireplumber shared library.
%package -n typelib-1_0-Wp-%{apiver_str}
Summary: Introspection bindings for libwireplumber
Group: System/Libraries
%description -n typelib-1_0-Wp-%{apiver_str}
WirePlumber is a modular session / policy manager for PipeWire and
a GObject-based high-level library that wraps PipeWire's API,
providing convenience for writing the daemon's modules as well as
external tools for managing PipeWire.
This package provides the GObject Introspection bindings for
the wireplumber shared library.
%package zsh-completion
Summary: Wireplumber zsh completion
Group: System/Shells
Requires: %{name} = %{version}
Requires: zsh
Supplements: (wireplumber and zsh)
BuildArch: noarch
%description zsh-completion
Optional dependency offering zsh completion for various wpctl parameters.
%prep
%autosetup -p1
pushd src/config
python3 %{SOURCE1}
popd
%build
%if 0%{?suse_version} <= 1500
export CC=gcc-9
export CXX=g++-9
%endif
%meson -Ddoc=enabled \
-Dsystem-lua=true \
-Delogind=disabled
%meson_build
%install
%meson_install
%fdupes -s %{buildroot}/%{_datadir}/doc/pipewire/html
%find_lang %{name} %{?no_lang_C}
%ifnarch %ix86 ppc64
%check
export XDG_RUNTIME_DIR=/tmp
%meson_test
%endif
%pre
%systemd_user_pre wireplumber.service
%post
%systemd_user_post wireplumber.service
%if 0%{?suse_version} <= 1500
# If the pipewire.socket user unit is not enabled and the workaround
# for boo#1186561 has never been executed, we need to execute it now
if [ ! -L %{_sysconfdir}/systemd/user/pipewire.service.wants/wireplumber.service \
-a ! -f %{_localstatedir}/lib/pipewire/wireplumber_post_workaround \
-a -x %{_bindir}/systemctl ]; then
for service in wireplumber.service ; do
%{_bindir}/systemctl --global preset "$service" || :
done
mkdir -p %{_localstatedir}/lib/pipewire
cat << EOF > %{_localstatedir}/lib/pipewire/wireplumber_post_workaround
# The existence of this file means that the wireplumber user services were
# enabled at least once. Please don't remove this file as that would
# make the services to be enabled again in the next package update.
#
# Check the following bugs for more information:
# https://bugzilla.opensuse.org/show_bug.cgi?id=1200485
EOF
fi
%endif
%preun
%systemd_user_preun wireplumber.service
%postun
%systemd_user_postun wireplumber.service
%post -n %{libwireplumber} -p /sbin/ldconfig
%postun -n %{libwireplumber} -p /sbin/ldconfig
%files
%{_bindir}/wireplumber
%{_bindir}/wpctl
%{_bindir}/wpexec
%dir %{_libdir}/wireplumber-%{apiver}
%{_libdir}/wireplumber-%{apiver}/libwireplumber-module-dbus-connection.so
%{_libdir}/wireplumber-%{apiver}/libwireplumber-module-default-nodes-api.so
%{_libdir}/wireplumber-%{apiver}/libwireplumber-module-file-monitor-api.so
%{_libdir}/wireplumber-%{apiver}/libwireplumber-module-log-settings.so
%{_libdir}/wireplumber-%{apiver}/libwireplumber-module-logind.so
%{_libdir}/wireplumber-%{apiver}/libwireplumber-module-lua-scripting.so
%{_libdir}/wireplumber-%{apiver}/libwireplumber-module-mixer-api.so
%{_libdir}/wireplumber-%{apiver}/libwireplumber-module-portal-permissionstore.so
%{_libdir}/wireplumber-%{apiver}/libwireplumber-module-reserve-device.so
%{_libdir}/wireplumber-%{apiver}/libwireplumber-module-settings.so
%{_libdir}/wireplumber-%{apiver}/libwireplumber-module-si-audio-adapter.so
%{_libdir}/wireplumber-%{apiver}/libwireplumber-module-si-node.so
%{_libdir}/wireplumber-%{apiver}/libwireplumber-module-si-standard-link.so
%{_libdir}/wireplumber-%{apiver}/libwireplumber-module-standard-event-source.so
%{_userunitdir}/wireplumber.service
%{_userunitdir}/wireplumber@.service
%dir %{_datadir}/doc/wireplumber
%dir %{_datadir}/doc/wireplumber/examples
%{_datadir}/doc/wireplumber/examples/wireplumber.conf.d
%{_datadir}/wireplumber
%exclude %{_datadir}/wireplumber/wireplumber.conf.d/00-device-monitors.conf
%exclude %{_datadir}/wireplumber/wireplumber.conf.d/01-require-audio-in-main-profile.conf
%files lang -f %{name}.lang
%files audio
%{_datadir}/wireplumber/wireplumber.conf.d/00-device-monitors.conf
%{_datadir}/wireplumber/wireplumber.conf.d/01-require-audio-in-main-profile.conf
%files devel
%{_includedir}/wireplumber-%{apiver}
%{_libdir}/libwireplumber-%{apiver}.so
%{_libdir}/pkgconfig/wireplumber-%{apiver}.pc
%{_datadir}/gir-1.0/Wp-%{apiver}.gir
%files doc
%{_datadir}/doc/wireplumber/html/
%exclude %{_datadir}/doc/wireplumber/examples
%files -n typelib-1_0-Wp-%{apiver_str}
%{_libdir}/girepository-1.0/Wp-%{apiver}.typelib
%files -n %{libwireplumber}
%{_libdir}/libwireplumber-%{apiver}.so.%{sover}
%{_libdir}/libwireplumber-%{apiver}.so.%{sover}.*
%files zsh-completion
%dir %{_datarootdir}/zsh
%dir %{_datarootdir}/zsh/site-functions/
%{_datarootdir}/zsh/site-functions/_wpctl
%changelog