commit: 0ea1a3a24469a4dad3145ee2a04a68374be6761a Author: Alfred Wingate <parona <AT> protonmail <DOT> com> AuthorDate: Mon Oct 20 11:12:43 2025 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Tue Oct 21 01:13:22 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0ea1a3a2
media-libs/webrtc-audio-processing: add 2.1 Signed-off-by: Alfred Wingate <parona <AT> protonmail.com> Part-of: https://github.com/gentoo/gentoo/pull/44267 Signed-off-by: Sam James <sam <AT> gentoo.org> media-libs/webrtc-audio-processing/Manifest | 1 + ...tc-audio-processing-2.1-abseil-cpp-202508.patch | 279 +++++++++++++++++++++ ...webrtc-audio-processing-2.1-gcc15-cstdint.patch | 42 ++++ .../webrtc-audio-processing-2.1.ebuild | 36 +++ 4 files changed, 358 insertions(+) diff --git a/media-libs/webrtc-audio-processing/Manifest b/media-libs/webrtc-audio-processing/Manifest index efa5df187641..91a40bcdd4f6 100644 --- a/media-libs/webrtc-audio-processing/Manifest +++ b/media-libs/webrtc-audio-processing/Manifest @@ -1,2 +1,3 @@ DIST webrtc-audio-processing-0.3.1.tar.xz 695920 BLAKE2B 833c6d12b358918d95dee5b165308c8cc382f98264349fd38649bfe478557765b85d9112a35194676ee52a8ef297fb7cb7e3a570d9c2295785b6fb97d35be948 SHA512 1c7a2d16f7f6c03cf6d60405d0dcd224caae6e80c9c4d43f8373bad2446affcdf49a02efb0085387328289aa79c8981dcaedff876cde55be9602dbde9c3f440b DIST webrtc-audio-processing-1.3.tar.xz 655672 BLAKE2B 42669df1705e7c289b3e9b2d79ef06f6f493eb4ef16f6ce8a4c94312d2372c9158ed016217055819041c2981ca1fe9467ca0e099ac261f92e4f75fa53d3421d1 SHA512 daabaed06ff9d1d4076b2abba14efbbebeb8930b14a99fb47974399d2812f3f851e3d6a691b09fbcfb1a3535c6ade967bac4c17a3728f3138b302e3b844c5c67 +DIST webrtc-audio-processing-2.1.tar.xz 604192 BLAKE2B b0a5e6faf6a20317ab2427df4366f4fa8918497b8e68b3c864ae3abcd823438649dd23d5b7c2121f839f924eb71812cff2f721144e5fd01b392052a6da202cac SHA512 534af17db1082e900ebd964042679685f26e8452c2e08c6f29660d0484bd5b079c804104600e972281d1ddcbca7762c63cc58b561b175b73447d069dd00f1a61 diff --git a/media-libs/webrtc-audio-processing/files/webrtc-audio-processing-2.1-abseil-cpp-202508.patch b/media-libs/webrtc-audio-processing/files/webrtc-audio-processing-2.1-abseil-cpp-202508.patch new file mode 100644 index 000000000000..05e53cf456c6 --- /dev/null +++ b/media-libs/webrtc-audio-processing/files/webrtc-audio-processing-2.1-abseil-cpp-202508.patch @@ -0,0 +1,279 @@ +https://gitlab.freedesktop.org/pulseaudio/webrtc-audio-processing/-/issues/42 +https://gitlab.freedesktop.org/pulseaudio/webrtc-audio-processing/-/merge_requests/60 + +From c8896801dfbfe03b56f85c1533abc077ff74a533 Mon Sep 17 00:00:00 2001 +From: Reilly Brogan <[email protected]> +Date: Tue, 19 Aug 2025 14:47:03 -0500 +Subject: [PATCH] Fix build with abseil-cpp 202508 + +--- a/webrtc/api/audio/audio_processing.h ++++ b/webrtc/api/audio/audio_processing.h +@@ -28,6 +28,7 @@ + #include <string> + #include <utility> + ++#include "absl/base/config.h" + #include "absl/base/nullability.h" + #include "absl/strings/string_view.h" + #include "api/array_view.h" +@@ -632,6 +633,7 @@ class RTC_EXPORT AudioProcessing : public RefCountInterface { + // return value of true indicates that the file has been + // sucessfully opened, while a value of false indicates that + // opening the file failed. ++#if defined(ABSL_LTS_RELEASE_VERSION) && ABSL_LTS_RELEASE_VERSION < 20250512 + virtual bool CreateAndAttachAecDump( + absl::string_view file_name, + int64_t max_log_size_bytes, +@@ -640,6 +642,16 @@ class RTC_EXPORT AudioProcessing : public RefCountInterface { + absl::Nonnull<FILE*> handle, + int64_t max_log_size_bytes, + absl::Nonnull<TaskQueueBase*> worker_queue) = 0; ++#else ++ virtual bool CreateAndAttachAecDump(absl::string_view file_name, ++ int64_t max_log_size_bytes, ++ TaskQueueBase* absl_nonnull ++ worker_queue) = 0; ++ virtual bool CreateAndAttachAecDump(FILE* absl_nonnull handle, ++ int64_t max_log_size_bytes, ++ TaskQueueBase* absl_nonnull ++ worker_queue) = 0; ++#endif + + // TODO(webrtc:5298) Deprecated variant. + // Attaches provided webrtc::AecDump for recording debugging +--- a/webrtc/api/make_ref_counted.h ++++ b/webrtc/api/make_ref_counted.h +@@ -13,6 +13,7 @@ + #include <type_traits> + #include <utility> + ++#include "absl/base/config.h" + #include "absl/base/nullability.h" + #include "api/ref_count.h" + #include "api/scoped_refptr.h" +@@ -86,7 +87,11 @@ template < + typename std::enable_if<std::is_convertible_v<T*, RefCountInterface*> && + std::is_abstract_v<T>, + T>::type* = nullptr> ++#if defined(ABSL_LTS_RELEASE_VERSION) && ABSL_LTS_RELEASE_VERSION < 20250512 + absl::Nonnull<scoped_refptr<T>> make_ref_counted(Args&&... args) { ++#else ++absl_nonnull scoped_refptr<T> make_ref_counted(Args&&... args) { ++#endif + return scoped_refptr<T>(new RefCountedObject<T>(std::forward<Args>(args)...)); + } + +@@ -99,7 +104,11 @@ template < + !std::is_convertible_v<T*, RefCountInterface*> && + webrtc_make_ref_counted_internal::HasAddRefAndRelease<T>::value, + T>::type* = nullptr> ++#if defined(ABSL_LTS_RELEASE_VERSION) && ABSL_LTS_RELEASE_VERSION < 20250512 + absl::Nonnull<scoped_refptr<T>> make_ref_counted(Args&&... args) { ++#else ++absl_nonnull scoped_refptr<T> make_ref_counted(Args&&... args) { ++#endif + return scoped_refptr<T>(new T(std::forward<Args>(args)...)); + } + +@@ -113,7 +122,11 @@ template < + !webrtc_make_ref_counted_internal::HasAddRefAndRelease<T>::value, + + T>::type* = nullptr> ++#if defined(ABSL_LTS_RELEASE_VERSION) && ABSL_LTS_RELEASE_VERSION < 20250512 + absl::Nonnull<scoped_refptr<FinalRefCountedObject<T>>> make_ref_counted( ++#else ++absl_nonnull scoped_refptr<FinalRefCountedObject<T>> make_ref_counted( ++#endif + Args&&... args) { + return scoped_refptr<FinalRefCountedObject<T>>( + new FinalRefCountedObject<T>(std::forward<Args>(args)...)); +--- a/webrtc/api/scoped_refptr.h ++++ b/webrtc/api/scoped_refptr.h +@@ -66,6 +66,7 @@ + #include <cstddef> + #include <utility> + ++#include "absl/base/config.h" + #include "absl/base/nullability.h" + + namespace webrtc { +@@ -73,13 +74,19 @@ namespace webrtc { + template <class T> + class ABSL_NULLABILITY_COMPATIBLE scoped_refptr { + public: ++#if defined(ABSL_LTS_RELEASE_VERSION) && ABSL_LTS_RELEASE_VERSION < 20250512 + using absl_nullability_compatible = void; ++#endif + using element_type = T; + + scoped_refptr() : ptr_(nullptr) {} + scoped_refptr(std::nullptr_t) : ptr_(nullptr) {} // NOLINT(runtime/explicit) + ++#if defined(ABSL_LTS_RELEASE_VERSION) && ABSL_LTS_RELEASE_VERSION < 20250512 + explicit scoped_refptr(absl::Nullable<T*> p) : ptr_(p) { ++#else ++ explicit scoped_refptr(T* absl_nullable p) : ptr_(p) { ++#endif + if (ptr_) + ptr_->AddRef(); + } +@@ -122,7 +129,11 @@ class ABSL_NULLABILITY_COMPATIBLE scoped_refptr { + return retVal; + } + ++#if defined(ABSL_LTS_RELEASE_VERSION) && ABSL_LTS_RELEASE_VERSION < 20250512 + scoped_refptr<T>& operator=(absl::Nullable<T*> p) { ++#else ++ scoped_refptr<T>& operator=(T* absl_nullable p) { ++#endif + // AddRef first so that self assignment should work + if (p) + p->AddRef(); +@@ -152,7 +163,11 @@ class ABSL_NULLABILITY_COMPATIBLE scoped_refptr { + return *this; + } + ++#if defined(ABSL_LTS_RELEASE_VERSION) && ABSL_LTS_RELEASE_VERSION < 20250512 + void swap(absl::Nonnull<T**> pp) noexcept { ++#else ++ void swap(T** absl_nonnull pp) noexcept { ++#endif + T* p = ptr_; + ptr_ = *pp; + *pp = p; +--- a/webrtc/modules/audio_processing/aec_dump/aec_dump_factory.h ++++ b/webrtc/modules/audio_processing/aec_dump/aec_dump_factory.h +@@ -29,6 +29,7 @@ class RTC_EXPORT AecDumpFactory { + // The AecDump takes responsibility for `handle` and closes it in the + // destructor. A non-null return value indicates that the file has been + // sucessfully opened. ++#if defined(ABSL_LTS_RELEASE_VERSION) && ABSL_LTS_RELEASE_VERSION < 20250512 + static absl::Nullable<std::unique_ptr<AecDump>> Create( + FileWrapper file, + int64_t max_log_size_bytes, +@@ -41,6 +42,20 @@ class RTC_EXPORT AecDumpFactory { + absl::Nonnull<FILE*> handle, + int64_t max_log_size_bytes, + absl::Nonnull<TaskQueueBase*> worker_queue); ++#else ++ static absl_nullable std::unique_ptr<AecDump> Create( ++ FileWrapper file, ++ int64_t max_log_size_bytes, ++ TaskQueueBase* absl_nonnull worker_queue); ++ static absl_nullable std::unique_ptr<AecDump> Create( ++ absl::string_view file_name, ++ int64_t max_log_size_bytes, ++ TaskQueueBase* absl_nonnull worker_queue); ++ static absl_nullable std::unique_ptr<AecDump> Create( ++ FILE* absl_nonnull handle, ++ int64_t max_log_size_bytes, ++ TaskQueueBase* absl_nonnull worker_queue); ++#endif + }; + + } // namespace webrtc +--- a/webrtc/modules/audio_processing/aec_dump/null_aec_dump_factory.cc ++++ b/webrtc/modules/audio_processing/aec_dump/null_aec_dump_factory.cc +@@ -16,6 +16,7 @@ + + namespace webrtc { + ++#if defined(ABSL_LTS_RELEASE_VERSION) && ABSL_LTS_RELEASE_VERSION < 20250512 + absl::Nullable<std::unique_ptr<AecDump>> AecDumpFactory::Create( + FileWrapper file, + int64_t max_log_size_bytes, +@@ -37,3 +38,27 @@ absl::Nullable<std::unique_ptr<AecDump>> AecDumpFactory::Create( + return nullptr; + } + } // namespace webrtc ++#else ++absl_nullable std::unique_ptr<AecDump> AecDumpFactory::Create( ++ FileWrapper file, ++ int64_t max_log_size_bytes, ++ TaskQueueBase* absl_nonnull worker_queue) { ++ return nullptr; ++} ++ ++absl_nullable std::unique_ptr<AecDump> AecDumpFactory::Create( ++ absl::string_view file_name, ++ int64_t max_log_size_bytes, ++ TaskQueueBase* absl_nonnull worker_queue) { ++ return nullptr; ++} ++ ++absl_nullable std::unique_ptr<AecDump> AecDumpFactory::Create( ++ FILE* absl_nonnull handle, ++ int64_t max_log_size_bytes, ++ TaskQueueBase* absl_nonnull worker_queue) { ++ return nullptr; ++} ++} // namespace webrtc ++ ++#endif +--- a/webrtc/modules/audio_processing/audio_processing_impl.cc ++++ b/webrtc/modules/audio_processing/audio_processing_impl.cc +@@ -19,6 +19,7 @@ + #include <type_traits> + #include <utility> + ++#include "absl/base/config.h" + #include "absl/base/nullability.h" + #include "absl/strings/match.h" + #include "absl/strings/string_view.h" +@@ -1787,7 +1788,11 @@ void AudioProcessingImpl::UpdateRecommendedInputVolumeLocked() { + bool AudioProcessingImpl::CreateAndAttachAecDump( + absl::string_view file_name, + int64_t max_log_size_bytes, ++#if defined(ABSL_LTS_RELEASE_VERSION) && ABSL_LTS_RELEASE_VERSION < 20250512 + absl::Nonnull<TaskQueueBase*> worker_queue) { ++#else ++ TaskQueueBase* absl_nonnull worker_queue) { ++#endif + std::unique_ptr<AecDump> aec_dump = + AecDumpFactory::Create(file_name, max_log_size_bytes, worker_queue); + if (!aec_dump) { +@@ -1801,7 +1806,11 @@ bool AudioProcessingImpl::CreateAndAttachAecDump( + bool AudioProcessingImpl::CreateAndAttachAecDump( + FILE* handle, + int64_t max_log_size_bytes, ++#if defined(ABSL_LTS_RELEASE_VERSION) && ABSL_LTS_RELEASE_VERSION < 20250512 + absl::Nonnull<TaskQueueBase*> worker_queue) { ++#else ++ TaskQueueBase* absl_nonnull worker_queue) { ++#endif + std::unique_ptr<AecDump> aec_dump = + AecDumpFactory::Create(handle, max_log_size_bytes, worker_queue); + if (!aec_dump) { +--- a/webrtc/modules/audio_processing/audio_processing_impl.h ++++ b/webrtc/modules/audio_processing/audio_processing_impl.h +@@ -20,6 +20,7 @@ + #include <string> + #include <vector> + ++#include "absl/base/config.h" + #include "absl/base/nullability.h" + #include "absl/strings/string_view.h" + #include "api/array_view.h" +@@ -74,11 +75,19 @@ class AudioProcessingImpl : public AudioProcessing { + bool CreateAndAttachAecDump( + absl::string_view file_name, + int64_t max_log_size_bytes, ++#if defined(ABSL_LTS_RELEASE_VERSION) && ABSL_LTS_RELEASE_VERSION < 20250512 + absl::Nonnull<TaskQueueBase*> worker_queue) override; ++#else ++ TaskQueueBase* absl_nonnull worker_queue) override; ++#endif + bool CreateAndAttachAecDump( + FILE* handle, + int64_t max_log_size_bytes, ++#if defined(ABSL_LTS_RELEASE_VERSION) && ABSL_LTS_RELEASE_VERSION < 20250512 + absl::Nonnull<TaskQueueBase*> worker_queue) override; ++#else ++ TaskQueueBase* absl_nonnull worker_queue) override; ++#endif + // TODO(webrtc:5298) Deprecated variant. + void AttachAecDump(std::unique_ptr<AecDump> aec_dump) override; + void DetachAecDump() override; +-- +GitLab + diff --git a/media-libs/webrtc-audio-processing/files/webrtc-audio-processing-2.1-gcc15-cstdint.patch b/media-libs/webrtc-audio-processing/files/webrtc-audio-processing-2.1-gcc15-cstdint.patch new file mode 100644 index 000000000000..3989d6be02b1 --- /dev/null +++ b/media-libs/webrtc-audio-processing/files/webrtc-audio-processing-2.1-gcc15-cstdint.patch @@ -0,0 +1,42 @@ +https://gitlab.freedesktop.org/pulseaudio/webrtc-audio-processing/-/merge_requests/58 +https://gitlab.freedesktop.org/pulseaudio/webrtc-audio-processing/-/commit/e9c78dc4712fa6362b0c839ad57b6b46dce1ba83 + +From e9c78dc4712fa6362b0c839ad57b6b46dce1ba83 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fran=C3=A7ois=20Laignel?= <[email protected]> +Date: Mon, 14 Apr 2025 16:48:19 +0200 +Subject: [PATCH] Fix compilation with gcc-15 + +This commit fixes compilation errors with gcc-15 (default for Fedora 42). + +From [1]: + +> Common C++ headers (like <memory>) in GCC 15.0.0 (combined with libstdc++) +> don't transitively include uint64_t anymore. + +See also [2]. + +[1]: https://github.com/ROCm/rocm_smi_lib/pull/198 +[2]: https://github.com/root-project/root/issues/17444 +--- a/webrtc/modules/audio_processing/aec3/multi_channel_content_detector.h ++++ b/webrtc/modules/audio_processing/aec3/multi_channel_content_detector.h +@@ -12,6 +12,7 @@ + #define MODULES_AUDIO_PROCESSING_AEC3_MULTI_CHANNEL_CONTENT_DETECTOR_H_ + + #include <stddef.h> ++#include <cstdint> + + #include <memory> + #include <optional> +--- a/webrtc/rtc_base/trace_event.h ++++ b/webrtc/rtc_base/trace_event.h +@@ -28,6 +28,7 @@ + + #if !defined(RTC_USE_PERFETTO) + #include <string> ++#include <cstdint> + + #include "rtc_base/event_tracer.h" + +-- +GitLab + diff --git a/media-libs/webrtc-audio-processing/webrtc-audio-processing-2.1.ebuild b/media-libs/webrtc-audio-processing/webrtc-audio-processing-2.1.ebuild new file mode 100644 index 000000000000..ace53bf49342 --- /dev/null +++ b/media-libs/webrtc-audio-processing/webrtc-audio-processing-2.1.ebuild @@ -0,0 +1,36 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit meson-multilib + +DESCRIPTION="AudioProcessing library from the webrtc.org codebase" +HOMEPAGE="https://www.freedesktop.org/software/pulseaudio/webrtc-audio-processing/" +SRC_URI="https://freedesktop.org/software/pulseaudio/${PN}/${P}.tar.xz" + +LICENSE="BSD" +SLOT="2" +KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86 ~amd64-linux" +IUSE="cpu_flags_arm_neon cpu_flags_x86_sse" + +RDEPEND=">=dev-cpp/abseil-cpp-20240722:=[${MULTILIB_USEDEP}]" +DEPEND="${RDEPEND}" +BDEPEND="virtual/pkgconfig" + +PATCHES=( + # Backport + "${FILESDIR}/${P}-gcc15-cstdint.patch" + # Unmerged + "${FILESDIR}/${PN}-2.1-abseil-cpp-202508.patch" +) + +DOCS=( AUTHORS NEWS README.md ) + +multilib_src_configure() { + local emesonargs=( + $(meson_feature cpu_flags_arm_neon neon) + $(meson_use cpu_flags_x86_sse inline-sse) + ) + meson_src_configure +}
