Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Nov 2021 22:51:37 GMT
From:      Jan Beich <jbeich@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-branches@FreeBSD.org
Subject:   git: 031836e2ec8b - 2021Q4 - multimedia/pipewire: Add a patch to fix ambguous function name issue.
Message-ID:  <202111202251.1AKMpbZB019837@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch 2021Q4 has been updated by jbeich:

URL: https://cgit.FreeBSD.org/ports/commit/?id=031836e2ec8b0463dec91f282f9cdfde38281008

commit 031836e2ec8b0463dec91f282f9cdfde38281008
Author:     Gleb Popov <arrowd@FreeBSD.org>
AuthorDate: 2021-11-20 16:47:48 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2021-11-20 21:31:15 +0000

    multimedia/pipewire: Add a patch to fix ambguous function name issue.
    
    PR:             259621
    (cherry picked from commit 8691df3a5142ab9381d6f1c9af2377dd4696e084)
---
 multimedia/pipewire/Makefile                       |  2 +-
 .../files/patch-src_pipewire_pipewire_init         | 67 ++++++++++++++++++++++
 2 files changed, 68 insertions(+), 1 deletion(-)

diff --git a/multimedia/pipewire/Makefile b/multimedia/pipewire/Makefile
index de71441b82de..5405377017a3 100644
--- a/multimedia/pipewire/Makefile
+++ b/multimedia/pipewire/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	pipewire
 DISTVERSION=	0.3.36
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	multimedia
 
 MAINTAINER=	arrowd@FreeBSD.org
diff --git a/multimedia/pipewire/files/patch-src_pipewire_pipewire_init b/multimedia/pipewire/files/patch-src_pipewire_pipewire_init
new file mode 100644
index 000000000000..3f94963d19c0
--- /dev/null
+++ b/multimedia/pipewire/files/patch-src_pipewire_pipewire_init
@@ -0,0 +1,67 @@
+PipeWire exports a function named "pw_init". FreeBSD also has the libutil.so
+library, which exports a function with the same name. To workaround the
+conflict, rename the PipeWire init function into "pipewire_init".
+
+Upstream issue: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1819
+
+--- src/pipewire/pipewire.c.orig	2021-11-11 12:21:29 UTC
++++ src/pipewire/pipewire.c
+@@ -583,7 +583,7 @@ out:
+  *
+  */
+ SPA_EXPORT
+-void pw_init(int *argc, char **argv[])
++void pipewire_init(int *argc, char **argv[])
+ {
+ 	const char *str;
+ 	struct spa_dict_item items[6];
+@@ -672,8 +672,9 @@ done:
+ 	pthread_mutex_unlock(&init_lock);
+ }
+ 
++
+ SPA_EXPORT
+-void pw_deinit(void)
++void pipewire_deinit(void)
+ {
+ 	struct support *support = &global_support;
+ 	struct registry *registry = &support->registry;
+@@ -696,6 +697,21 @@ void pw_deinit(void)
+ 	pthread_mutex_unlock(&init_lock);
+ 
+ }
++
++#if !defined(__FreeBSD__)
++#undef pw_init
++SPA_EXPORT
++void pw_init(int *argc, char **argv[])
++{
++	pipewire_init(argc, argv);
++}
++#undef pw_deinit
++SPA_EXPORT
++void pw_deinit(void)
++{
++	pipewire_deinit();
++}
++#endif
+ 
+ /** Check if a debug category is enabled
+  *
+--- src/pipewire/pipewire.h.orig	2021-11-11 12:21:29 UTC
++++ src/pipewire/pipewire.h
+@@ -69,9 +69,12 @@ extern "C" {
+  * \{
+  */
+ void
+-pw_init(int *argc, char **argv[]);
++pipewire_init(int *argc, char **argv[]);
++void pipewire_deinit(void);
+ 
+-void pw_deinit(void);
++/* BSD has pw_init already */
++#define pw_init pipewire_init
++#define pw_deinit pipewire_deinit
+ 
+ bool
+ pw_debug_is_category_enabled(const char *name);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202111202251.1AKMpbZB019837>