public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: media-video/pipewire/, media-video/pipewire/files/
Date: Mon,  1 Jul 2024 08:19:59 +0000 (UTC)	[thread overview]
Message-ID: <1719821952.a7ff87b07c894cdfce5c6b041d4aff5dd353b889.sam@gentoo> (raw)

commit:     a7ff87b07c894cdfce5c6b041d4aff5dd353b889
Author:     Eli Schwartz <eschwartz93 <AT> gmail <DOT> com>
AuthorDate: Sun Jun 30 15:30:06 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jul  1 08:19:12 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a7ff87b0

media-video/pipewire: backport patch to fix automagic webrtc dependency

 * VDB: detected possibly incorrect RDEPEND (media-video/pipewire-1.0.7)
 *                  > media-libs/libpulse
 *                  > media-libs/webrtc-audio-processing

The build system was simply ignoring the option which controlled this.

Closes: https://bugs.gentoo.org/933218
Signed-off-by: Eli Schwartz <eschwartz93 <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...e-1.0.7-automagic-webrtc-audio-processing.patch | 95 ++++++++++++++++++++++
 media-video/pipewire/pipewire-1.0.7.ebuild         |  3 +
 2 files changed, 98 insertions(+)

diff --git a/media-video/pipewire/files/pipewire-1.0.7-automagic-webrtc-audio-processing.patch b/media-video/pipewire/files/pipewire-1.0.7-automagic-webrtc-audio-processing.patch
new file mode 100644
index 000000000000..ac245dd7cc15
--- /dev/null
+++ b/media-video/pipewire/files/pipewire-1.0.7-automagic-webrtc-audio-processing.patch
@@ -0,0 +1,95 @@
+From acd5bf60b9d4a35d00c90bfdca7f89e4ff4a4ff7 Mon Sep 17 00:00:00 2001
+From: Eli Schwartz <eschwartz93@gmail.com>
+Date: Thu, 30 May 2024 19:44:38 -0400
+Subject: [PATCH] meson: fix webrtc-audio-processing dependency ignoring
+ configure args
+
+Most dependencies use meson "feature" options for optional
+functionality. This allows people to disable them, if they don't want
+them, through the power of tristate decision-making.
+
+This particular dependency does something a bit more complicated than
+can be described by simply passing feature options to the required
+kwarg. It:
+
+- tries to look for two different names of the dependency
+- selects different version ranges, depending on the dependency name
+- has a hole in the middle of the versions
+
+Unfortunately, `required: false` for the first dependency isn't
+equivalent to a tristate decision-making process. We have to manually
+code the logic ourselves.
+
+The problem is that when we look up the first name, we cannot pass the
+feature option in because if the option is force enabled, then the
+dependency lookup fails and configuration never tries to find the older
+version instead.
+
+But also, we can't just say it *isn't* required, because if the option
+is force *disabled* but it is installed on the system, we still find it
+and build against it.
+
+One solution would be using meson 0.60's support for multiple dependency
+names:
+
+```
+dependency('webrtc-audio-processing-1', 'webrtc-audio-processing',
+    version : ['>= 0.2'],
+    required: get_option('echo-cancel-webrtc'),
+)
+```
+
+Unfortunately, this too doesn't work since we could end up detecting 1.1
+(the hole in the middle) which is invalid.
+
+Instead, we do a bit of checking for tristate values before deciding to
+invoke `dependency()`. This lets us guarantee that disabled dependencies
+are well and truly disabled.
+
+Bug: https://bugs.gentoo.org/933218
+Fixes: #3678
+---
+ meson.build | 25 +++++++++++++++----------
+ 1 file changed, 15 insertions(+), 10 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index cda60112f..72d275086 100644
+--- a/meson.build
++++ b/meson.build
+@@ -393,18 +393,23 @@ cdata.set('HAVE_GSTREAMER_DEVICE_PROVIDER', get_option('gstreamer-device-provide
+ summary({'gstreamer DMA_DRM support': gst_dma_drm_found}, bool_yn: true, section: 'Backend')
+ cdata.set('HAVE_GSTREAMER_DMA_DRM', gst_dma_drm_found)
+ 
+-webrtc_dep = dependency('webrtc-audio-processing-1',
+-  version : ['>= 1.2' ],
+-  required : false)
+-cdata.set('HAVE_WEBRTC1', webrtc_dep.found())
+-if webrtc_dep.found()
++if get_option('echo-cancel-webrtc').disabled()
++  webrtc_dep = dependency('', required: false)
+   summary({'WebRTC Echo Canceling >= 1.2': webrtc_dep.found()}, bool_yn: true, section: 'Misc dependencies')
+ else
+-  webrtc_dep = dependency('webrtc-audio-processing',
+-    version : ['>= 0.2', '< 1.0'],
+-    required : get_option('echo-cancel-webrtc'))
+-  cdata.set('HAVE_WEBRTC', webrtc_dep.found())
+-  summary({'WebRTC Echo Canceling < 1.0': webrtc_dep.found()}, bool_yn: true, section: 'Misc dependencies')
++  webrtc_dep = dependency('webrtc-audio-processing-1',
++    version : ['>= 1.2' ],
++    required : false)
++  cdata.set('HAVE_WEBRTC1', webrtc_dep.found())
++  if webrtc_dep.found()
++    summary({'WebRTC Echo Canceling >= 1.2': webrtc_dep.found()}, bool_yn: true, section: 'Misc dependencies')
++  else
++    webrtc_dep = dependency('webrtc-audio-processing',
++      version : ['>= 0.2', '< 1.0'],
++      required : get_option('echo-cancel-webrtc'))
++    cdata.set('HAVE_WEBRTC', webrtc_dep.found())
++    summary({'WebRTC Echo Canceling < 1.0': webrtc_dep.found()}, bool_yn: true, section: 'Misc dependencies')
++  endif
+ endif
+ 
+ # On FreeBSD and MidnightBSD, epoll-shim library is required for eventfd() and timerfd()
+-- 
+GitLab
+

diff --git a/media-video/pipewire/pipewire-1.0.7.ebuild b/media-video/pipewire/pipewire-1.0.7.ebuild
index 69bb29b9e1af..e2e457730428 100644
--- a/media-video/pipewire/pipewire-1.0.7.ebuild
+++ b/media-video/pipewire/pipewire-1.0.7.ebuild
@@ -175,6 +175,9 @@ PDEPEND=">=media-video/wireplumber-0.5.2"
 
 PATCHES=(
 	"${FILESDIR}"/${PN}-0.3.25-enable-failed-mlock-warning.patch
+	# https://bugs.gentoo.org/933218
+	# https://gitlab.freedesktop.org/pipewire/pipewire/-/merge_requests/2028
+	"${FILESDIR}"/${P}-automagic-webrtc-audio-processing.patch
 )
 
 pkg_setup() {


             reply	other threads:[~2024-07-01  8:20 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-01  8:19 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-03-19  5:48 [gentoo-commits] repo/gentoo:master commit in: media-video/pipewire/, media-video/pipewire/files/ Sam James
2023-09-12  0:43 Sam James
2023-05-11  1:21 Sam James
2023-01-15 22:32 Sam James
2022-12-16  4:56 Sam James
2022-12-14  8:45 Sam James
2022-11-17 19:20 Sam James
2022-10-14 19:33 Sam James
2022-07-31  3:40 Sam James
2022-07-12 23:23 Sam James
2022-07-12 23:23 Sam James
2022-07-04 23:36 Sam James
2022-05-01 19:52 Sam James
2022-05-01 19:52 Sam James
2022-02-21  3:30 Sam James
2021-11-26 19:37 Andreas Sturmlechner
2021-10-24  1:58 Sam James
2021-10-13 21:11 Andreas Sturmlechner
2021-10-01  0:00 Sam James
2021-09-16 21:55 Sam James
2021-09-13 23:07 Sam James
2021-04-12 21:55 Thomas Deutschmann
2021-01-01 19:12 Andreas Sturmlechner
2020-06-28 15:36 Andreas Sturmlechner
2019-07-07 15:56 Andreas Sturmlechner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1719821952.a7ff87b07c894cdfce5c6b041d4aff5dd353b889.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox