git: 886566f7a290 - main - multimedia/wireplumber: Install the enabling config for Pipewire

From: Gleb Popov <arrowd_at_FreeBSD.org>
Date: Sun, 06 Oct 2024 10:06:51 UTC
The branch main has been updated by arrowd:

URL: https://cgit.FreeBSD.org/ports/commit/?id=886566f7a2908bf6f7e923453e3a433b2a426c9e

commit 886566f7a2908bf6f7e923453e3a433b2a426c9e
Author:     Gleb Popov <arrowd@FreeBSD.org>
AuthorDate: 2024-09-29 09:01:59 +0000
Commit:     Gleb Popov <arrowd@FreeBSD.org>
CommitDate: 2024-10-06 10:06:45 +0000

    multimedia/wireplumber: Install the enabling config for Pipewire
    
    Reviewed by:    jbeich
    Pull Request:   https://github.com/freebsd/freebsd-ports/pull/303
---
 multimedia/wireplumber/Makefile                     | 8 ++++++++
 multimedia/wireplumber/files/10-wireplumber.conf.in | 4 ++++
 multimedia/wireplumber/pkg-plist                    | 1 +
 3 files changed, 13 insertions(+)

diff --git a/multimedia/wireplumber/Makefile b/multimedia/wireplumber/Makefile
index 241cdc77a44d..7041ad10b082 100644
--- a/multimedia/wireplumber/Makefile
+++ b/multimedia/wireplumber/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	wireplumber
 DISTVERSION=	0.5.6
+PORTREVISION=	1
 CATEGORIES=	multimedia
 
 MAINTAINER=	arrowd@FreeBSD.org
@@ -36,6 +37,8 @@ MESON_ARGS=	-D system-lua=true \
 		-D systemd=disabled \
 		-D elogind=disabled
 
+SUB_FILES=	10-${PORTNAME}.conf
+
 OPTIONS_SUB=	yes
 
 PORTDOCS=	*
@@ -44,4 +47,9 @@ post-patch:
 	${REINPLACE_CMD} -e "s|'python3'|'python${PYTHON_VER}'|" \
 		${WRKSRC}/docs/meson.build
 
+post-install:
+	${MKDIR} ${STAGEDIR}${PREFIX}/share/pipewire/pipewire.conf.d
+	${INSTALL_DATA} ${WRKDIR}/10-wireplumber.conf \
+		${STAGEDIR}${PREFIX}/share/pipewire/pipewire.conf.d
+
 .include <bsd.port.mk>
diff --git a/multimedia/wireplumber/files/10-wireplumber.conf.in b/multimedia/wireplumber/files/10-wireplumber.conf.in
new file mode 100644
index 000000000000..f8460922d8ab
--- /dev/null
+++ b/multimedia/wireplumber/files/10-wireplumber.conf.in
@@ -0,0 +1,4 @@
+context.exec = [
+    { path = "%%PREFIX%%/bin/wireplumber" args = ""
+      condition = [ { exec.session-manager = null } { exec.session-manager = true } ] }
+]
diff --git a/multimedia/wireplumber/pkg-plist b/multimedia/wireplumber/pkg-plist
index 75d5f3cba7f4..b76d09fc6b43 100644
--- a/multimedia/wireplumber/pkg-plist
+++ b/multimedia/wireplumber/pkg-plist
@@ -115,6 +115,7 @@ libdata/pkgconfig/wireplumber-0.5.pc
 %%NLS%%share/locale/uk/LC_MESSAGES/wireplumber.mo
 %%NLS%%share/locale/zh_CN/LC_MESSAGES/wireplumber.mo
 %%NLS%%share/locale/zh_TW/LC_MESSAGES/wireplumber.mo
+share/pipewire/pipewire.conf.d/10-wireplumber.conf
 %%DATADIR%%/scripts/client/access-default.lua
 %%DATADIR%%/scripts/client/access-portal.lua
 %%DATADIR%%/scripts/client/access-snap.lua