public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: media-libs/webrtc-audio-processing/files/, media-libs/webrtc-audio-processing/
@ 2023-09-15  9:16 Sam James
  0 siblings, 0 replies; 3+ messages in thread
From: Sam James @ 2023-09-15  9:16 UTC (permalink / raw
  To: gentoo-commits

commit:     1869e5c50ca0705e8bb2bbe144273ea272215946
Author:     Niccolò Belli <niccolo.belli <AT> linuxsystems <DOT> it>
AuthorDate: Thu Feb 23 09:13:27 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Sep 15 09:15:56 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1869e5c5

media-libs/webrtc-audio-processing: add big-endian patches, keyword 0.3.1 for ~ppc64

Signed-off-by: Niccolò Belli <niccolo.belli <AT> linuxsystems.it>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...ric-byte-order-and-pointer-size-detection.patch |  35 +++++++
 ...c-audio-processing-0.3-big-endian-support.patch | 103 +++++++++++++++++++++
 .../webrtc-audio-processing-0.3.1-r1.ebuild        |  36 +++++++
 3 files changed, 174 insertions(+)

diff --git a/media-libs/webrtc-audio-processing/files/webrtc-audio-processing-0.3-Add-generic-byte-order-and-pointer-size-detection.patch b/media-libs/webrtc-audio-processing/files/webrtc-audio-processing-0.3-Add-generic-byte-order-and-pointer-size-detection.patch
new file mode 100644
index 000000000000..0c4508986e4b
--- /dev/null
+++ b/media-libs/webrtc-audio-processing/files/webrtc-audio-processing-0.3-Add-generic-byte-order-and-pointer-size-detection.patch
@@ -0,0 +1,35 @@
+From: Than <than@redhat.com>
+Date: Wed, 8 Jun 2016 19:10:08 -0400
+Subject: Add generic byte order and pointer size detection
+
+https://sources.debian.org/patches/webrtc-audio-processing/0.3-1/Add-generic-byte-order-and-pointer-size-detection.patch/
+https://bugs.freedesktop.org/show_bug.cgi?id=95738
+---
+ webrtc/typedefs.h | 14 +++++++++++++-
+ 1 file changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/webrtc/typedefs.h b/webrtc/typedefs.h
+index d875490..dc074f1 100644
+--- a/webrtc/typedefs.h
++++ b/webrtc/typedefs.h
+@@ -48,7 +48,19 @@
+ #define WEBRTC_ARCH_32_BITS
+ #define WEBRTC_ARCH_LITTLE_ENDIAN
+ #else
+-#error Please add support for your architecture in typedefs.h
++/* instead of failing, use typical unix defines... */
++#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
++#define WEBRTC_ARCH_LITTLE_ENDIAN
++#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
++#define WEBRTC_ARCH_BIG_ENDIAN
++#else
++#error __BYTE_ORDER__ is not defined
++#endif
++#if defined(__LP64__)
++#define WEBRTC_ARCH_64_BITS
++#else
++#define WEBRTC_ARCH_32_BITS
++#endif
+ #endif
+ 
+ #if !(defined(WEBRTC_ARCH_LITTLE_ENDIAN) ^ defined(WEBRTC_ARCH_BIG_ENDIAN))

diff --git a/media-libs/webrtc-audio-processing/files/webrtc-audio-processing-0.3-big-endian-support.patch b/media-libs/webrtc-audio-processing/files/webrtc-audio-processing-0.3-big-endian-support.patch
new file mode 100644
index 000000000000..34f27dd70484
--- /dev/null
+++ b/media-libs/webrtc-audio-processing/files/webrtc-audio-processing-0.3-big-endian-support.patch
@@ -0,0 +1,103 @@
+From: Than <than@redhat.com>
+Date: Mon, 6 Jun 2016 12:08:58 -0400
+Subject: big endian support
+
+https://sources.debian.org/patches/webrtc-audio-processing/0.3-1/big-endian-support.patch/
+https://bugs.freedesktop.org/show_bug.cgi?id=95738
+---
+ webrtc/common_audio/wav_file.cc   | 20 +++++++++++++++-----
+ webrtc/common_audio/wav_header.cc | 34 +++++++++++++++++++++++++++++++++-
+ 2 files changed, 48 insertions(+), 6 deletions(-)
+
+diff --git a/webrtc/common_audio/wav_file.cc b/webrtc/common_audio/wav_file.cc
+index b14b620..05fa052 100644
+--- a/webrtc/common_audio/wav_file.cc
++++ b/webrtc/common_audio/wav_file.cc
+@@ -64,9 +64,6 @@ WavReader::~WavReader() {
+ }
+ 
+ size_t WavReader::ReadSamples(size_t num_samples, int16_t* samples) {
+-#ifndef WEBRTC_ARCH_LITTLE_ENDIAN
+-#error "Need to convert samples to big-endian when reading from WAV file"
+-#endif
+   // There could be metadata after the audio; ensure we don't read it.
+   num_samples = std::min(rtc::checked_cast<uint32_t>(num_samples),
+                          num_samples_remaining_);
+@@ -76,6 +73,12 @@ size_t WavReader::ReadSamples(size_t num_samples, int16_t* samples) {
+   RTC_CHECK(read == num_samples || feof(file_handle_));
+   RTC_CHECK_LE(read, num_samples_remaining_);
+   num_samples_remaining_ -= rtc::checked_cast<uint32_t>(read);
++#ifndef WEBRTC_ARCH_LITTLE_ENDIAN
++  //convert to big-endian
++  for(size_t idx = 0; idx < num_samples; idx++) {
++    samples[idx] = (samples[idx]<<8) | (samples[idx]>>8);
++  }
++#endif
+   return read;
+ }
+ 
+@@ -120,10 +123,17 @@ WavWriter::~WavWriter() {
+ 
+ void WavWriter::WriteSamples(const int16_t* samples, size_t num_samples) {
+ #ifndef WEBRTC_ARCH_LITTLE_ENDIAN
+-#error "Need to convert samples to little-endian when writing to WAV file"
+-#endif
++  int16_t * le_samples = new int16_t[num_samples];
++  for(size_t idx = 0; idx < num_samples; idx++) {
++    le_samples[idx] = (samples[idx]<<8) | (samples[idx]>>8);
++  }
++  const size_t written =
++      fwrite(le_samples, sizeof(*le_samples), num_samples, file_handle_);
++  delete []le_samples;
++#else
+   const size_t written =
+       fwrite(samples, sizeof(*samples), num_samples, file_handle_);
++#endif
+   RTC_CHECK_EQ(num_samples, written);
+   num_samples_ += static_cast<uint32_t>(written);
+   RTC_CHECK(written <= std::numeric_limits<uint32_t>::max() ||
+diff --git a/webrtc/common_audio/wav_header.cc b/webrtc/common_audio/wav_header.cc
+index 61cfffe..53882ff 100644
+--- a/webrtc/common_audio/wav_header.cc
++++ b/webrtc/common_audio/wav_header.cc
+@@ -129,7 +129,39 @@ static inline std::string ReadFourCC(uint32_t x) {
+   return std::string(reinterpret_cast<char*>(&x), 4);
+ }
+ #else
+-#error "Write be-to-le conversion functions"
++static inline void WriteLE16(uint16_t* f, uint16_t x) {
++  *f = ((x << 8) & 0xff00)  | ( ( x >> 8) & 0x00ff);
++}
++
++static inline void WriteLE32(uint32_t* f, uint32_t x) {
++    *f = ( (x & 0x000000ff) << 24 )
++      | ((x & 0x0000ff00) << 8)
++      | ((x & 0x00ff0000) >> 8)
++      | ((x & 0xff000000) >> 24 );
++}
++
++static inline void WriteFourCC(uint32_t* f, char a, char b, char c, char d) {
++    *f = (static_cast<uint32_t>(a) << 24 )
++      |  (static_cast<uint32_t>(b) << 16)
++      |  (static_cast<uint32_t>(c) << 8)
++      |  (static_cast<uint32_t>(d) );
++}
++
++static inline uint16_t ReadLE16(uint16_t x) {
++  return  (( x & 0x00ff) << 8 )| ((x & 0xff00)>>8);
++}
++
++static inline uint32_t ReadLE32(uint32_t x) {
++  return   ( (x & 0x000000ff) << 24 )
++         | ( (x & 0x0000ff00) << 8 )
++         | ( (x & 0x00ff0000) >> 8)
++         | ( (x & 0xff000000) >> 24 );
++}
++
++static inline std::string ReadFourCC(uint32_t x) {
++  x = ReadLE32(x);
++  return std::string(reinterpret_cast<char*>(&x), 4);
++}
+ #endif
+ 
+ static inline uint32_t RiffChunkSize(uint32_t bytes_in_payload) {

diff --git a/media-libs/webrtc-audio-processing/webrtc-audio-processing-0.3.1-r1.ebuild b/media-libs/webrtc-audio-processing/webrtc-audio-processing-0.3.1-r1.ebuild
new file mode 100644
index 000000000000..946115a3b322
--- /dev/null
+++ b/media-libs/webrtc-audio-processing/webrtc-audio-processing-0.3.1-r1.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools multilib-minimal
+
+DESCRIPTION="AudioProcessing library from the webrtc.org code base"
+HOMEPAGE="https://www.freedesktop.org/software/pulseaudio/webrtc-audio-processing/"
+SRC_URI="https://freedesktop.org/software/pulseaudio/${PN}/${P}.tar.xz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86 ~amd64-linux"
+IUSE="static-libs"
+
+DOCS=( AUTHORS NEWS README.md )
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-0.3-proper_detection_cxxabi_execinfo.patch
+	"${FILESDIR}"/${PN}-0.3-Add-generic-byte-order-and-pointer-size-detection.patch
+	"${FILESDIR}"/${PN}-0.3-big-endian-support.patch
+)
+
+src_prepare() {
+	default
+	eautoreconf
+}
+
+multilib_src_configure() {
+	ECONF_SOURCE="${S}" econf $(use_enable static-libs static)
+}
+
+multilib_src_install_all() {
+	find "${ED}" -type f -name "*.la" -delete || die
+}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-libs/webrtc-audio-processing/files/, media-libs/webrtc-audio-processing/
@ 2024-01-02  4:40 Sam James
  0 siblings, 0 replies; 3+ messages in thread
From: Sam James @ 2024-01-02  4:40 UTC (permalink / raw
  To: gentoo-commits

commit:     29cd0e622b574df6adff5704ab4e220709619767
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Jan  2 04:36:56 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jan  2 04:39:17 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=29cd0e62

media-libs/webrtc-audio-processing: fix x86 w/o SSE

Tested with CFLAGS="-O2" CFLAGS_x86="-m32 -O2 -mno-sse -march=i686 -fcf-protection=none" e webrtc-audio-processing-1.3-r3.ebuild clean compile.

Closes: https://bugs.gentoo.org/918668
Closes: https://bugs.gentoo.org/921140
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/webrtc-audio-processing-1.3-musl.patch   | 34 ++++++++++++++++++
 .../webrtc-audio-processing-1.3-x86-no-sse.patch   | 13 +++++++
 .../webrtc-audio-processing-1.3-r3.ebuild          | 40 ++++++++++++++++++++++
 3 files changed, 87 insertions(+)

diff --git a/media-libs/webrtc-audio-processing/files/webrtc-audio-processing-1.3-musl.patch b/media-libs/webrtc-audio-processing/files/webrtc-audio-processing-1.3-musl.patch
new file mode 100644
index 000000000000..01e6e799a62b
--- /dev/null
+++ b/media-libs/webrtc-audio-processing/files/webrtc-audio-processing-1.3-musl.patch
@@ -0,0 +1,34 @@
+https://bugs.gentoo.org/918668
+https://gitlab.freedesktop.org/pulseaudio/webrtc-audio-processing/-/merge_requests/37
+(see also https://gitlab.freedesktop.org/pulseaudio/webrtc-audio-processing/-/merge_requests/38)
+
+From de1b9c444df1ed66d72a4ab3d0e4dd2151037934 Mon Sep 17 00:00:00 2001
+From: Markus Volk <f_l_k@t-online.de>
+Date: Thu, 14 Sep 2023 16:12:32 +0200
+Subject: [PATCH] file_wrapper.h: add missing include for musl
+
+this fixes:
+| In file included from ../webrtc-audio-processing-1.3/webrtc/rtc_base/system/file_wrapper.cc:11:
+| ../webrtc-audio-processing-1.3/webrtc/rtc_base/system/file_wrapper.h:86:21: error: 'int64_t' has not been declared
+
+if built with musl libc
+
+Signed-off-by: Markus Volk <f_l_k@t-online.de>
+---
+ webrtc/rtc_base/system/file_wrapper.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/webrtc/rtc_base/system/file_wrapper.h b/webrtc/rtc_base/system/file_wrapper.h
+index 42c463c..c34d366 100644
+--- a/webrtc/rtc_base/system/file_wrapper.h
++++ b/webrtc/rtc_base/system/file_wrapper.h
+@@ -13,6 +13,7 @@
+ 
+ #include <stddef.h>
+ #include <stdio.h>
++#include <cstdint>
+ 
+ #include <string>
+ 
+-- 
+GitLab

diff --git a/media-libs/webrtc-audio-processing/files/webrtc-audio-processing-1.3-x86-no-sse.patch b/media-libs/webrtc-audio-processing/files/webrtc-audio-processing-1.3-x86-no-sse.patch
new file mode 100644
index 000000000000..c194dd9244e5
--- /dev/null
+++ b/media-libs/webrtc-audio-processing/files/webrtc-audio-processing-1.3-x86-no-sse.patch
@@ -0,0 +1,13 @@
+https://bugs.gentoo.org/921140
+https://gitlab.freedesktop.org/pulseaudio/webrtc-audio-processing/-/issues/5
+--- a/webrtc/rtc_base/system/arch.h
++++ b/webrtc/rtc_base/system/arch.h
+@@ -34,7 +34,7 @@
+ #else
+ #define WEBRTC_ARCH_32_BITS
+ #endif
+-#elif defined(_M_IX86) || defined(__i386__)
++#elif defined(__SSE__) && (defined(_M_IX86) || defined(__i386__))
+ #define WEBRTC_ARCH_X86_FAMILY
+ #define WEBRTC_ARCH_X86
+ #define WEBRTC_ARCH_32_BITS

diff --git a/media-libs/webrtc-audio-processing/webrtc-audio-processing-1.3-r3.ebuild b/media-libs/webrtc-audio-processing/webrtc-audio-processing-1.3-r3.ebuild
new file mode 100644
index 000000000000..33bf26456380
--- /dev/null
+++ b/media-libs/webrtc-audio-processing/webrtc-audio-processing-1.3-r3.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+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.gz"
+
+LICENSE="BSD"
+SLOT="1"
+KEYWORDS="~amd64 ~ppc64 ~x86 ~amd64-linux"
+IUSE="cpu_flags_arm_neon"
+
+RDEPEND="dev-cpp/abseil-cpp:=[${MULTILIB_USEDEP}]"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+	"${FILESDIR}/${PN}-1.3-Add-generic-byte-order-and-pointer-size-detection.patch"
+	"${FILESDIR}/${PN}-1.3-big-endian-support.patch"
+	"${FILESDIR}/${PN}-1.3-x86-no-sse.patch"
+	"${FILESDIR}/${PN}-1.3-musl.patch"
+)
+
+DOCS=( AUTHORS NEWS README.md )
+
+multilib_src_configure() {
+	if [[ ${ABI} == x86 ]] ; then
+		# bug #921140
+		local -x CPPFLAGS="${CPPFLAGS} -DPFFFT_SIMD_DISABLE"
+	fi
+
+	local emesonargs=(
+		-Dneon=$(usex cpu_flags_arm_neon yes no)
+	)
+	meson_src_configure
+}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-libs/webrtc-audio-processing/files/, media-libs/webrtc-audio-processing/
@ 2024-08-06 11:32 Sam James
  0 siblings, 0 replies; 3+ messages in thread
From: Sam James @ 2024-08-06 11:32 UTC (permalink / raw
  To: gentoo-commits

commit:     bb9cdfdb5f4411cd1ba17e0f6a23ea7cb5acf20d
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Aug  6 11:22:50 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Aug  6 11:22:50 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bb9cdfdb

media-libs/webrtc-audio-processing: fix build w/ gcc-15

Closes: https://bugs.gentoo.org/937417
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...webrtc-audio-processing-1.3-gcc15-cstdint.patch | 32 ++++++++++++++++++++++
 .../webrtc-audio-processing-1.3-r3.ebuild          |  1 +
 2 files changed, 33 insertions(+)

diff --git a/media-libs/webrtc-audio-processing/files/webrtc-audio-processing-1.3-gcc15-cstdint.patch b/media-libs/webrtc-audio-processing/files/webrtc-audio-processing-1.3-gcc15-cstdint.patch
new file mode 100644
index 000000000000..1888fd964972
--- /dev/null
+++ b/media-libs/webrtc-audio-processing/files/webrtc-audio-processing-1.3-gcc15-cstdint.patch
@@ -0,0 +1,32 @@
+https://bugs.gentoo.org/937417
+https://gitlab.freedesktop.org/pulseaudio/webrtc-audio-processing/-/merge_requests/41
+
+From 1d58a17f18bf81bde00ac7d206976fa3c11e66dc Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyich@gmail.com>
+Date: Sat, 3 Aug 2024 06:48:30 +0100
+Subject: [PATCH] webrtc/api/task_queue/task_queue_base.h: add missing
+ <stdint.h> include
+
+Without the change the build fails on upcoming `gcc-15` as:
+
+    FAILED: webrtc/rtc_base/liblibbase.a.p/platform_thread.cc.o
+        g++ -Iwebrtc/rtc_base/liblibbase.a.p -Iwebrtc/rtc_base -I../webrtc/rtc_base -Iwebrtc -I../webrtc -I/nix/store/w2k6x9126cffd3db93bs4435krsbsz90-abseil-cpp-20240116.2/include -fdiagnostics-color=always -D_GLIBCXX_ASSERTIONS=1 -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c++17 -fPIC -DNOMINMAX -pthread -DWEBRTC_LIBRARY_IMPL -DWEBRTC_ENABLE_SYMBOL_EXPORT -DNDEBUG -DWEBRTC_POSIX -DWEBRTC_LINUX -DWEBRTC_THREAD_RR -DWEBRTC_ENABLE_AVX2 -MD -MQ webrtc/rtc_base/liblibbase.a.p/platform_thread.cc.o -MF webrtc/rtc_base/liblibbase.a.p/platform_thread.cc.o.d -o webrtc/rtc_base/liblibbase.a.p/platform_thread.cc.o -c ../webrtc/rtc_base/platform_thread.cc
+        In file included from ../webrtc/rtc_base/synchronization/sequence_checker.h:15,
+                         from ../webrtc/rtc_base/thread_checker.h:17,
+                         from ../webrtc/rtc_base/platform_thread.h:22,
+                         from ../webrtc/rtc_base/platform_thread.cc:11:
+        ../webrtc/api/task_queue/task_queue_base.h:53:32: error: 'uint32_t' has not been declared
+           53 |                                uint32_t milliseconds) = 0;
+              |                                ^~~~~~~~
+--- a/webrtc/api/task_queue/task_queue_base.h
++++ b/webrtc/api/task_queue/task_queue_base.h
+@@ -11,6 +11,7 @@
+ #define API_TASK_QUEUE_TASK_QUEUE_BASE_H_
+ 
+ #include <memory>
++#include <stdint.h>
+ 
+ #include "api/task_queue/queued_task.h"
+ #include "rtc_base/system/rtc_export.h"
+-- 
+GitLab

diff --git a/media-libs/webrtc-audio-processing/webrtc-audio-processing-1.3-r3.ebuild b/media-libs/webrtc-audio-processing/webrtc-audio-processing-1.3-r3.ebuild
index 3c89d5d4bc21..fecb72dc5eec 100644
--- a/media-libs/webrtc-audio-processing/webrtc-audio-processing-1.3-r3.ebuild
+++ b/media-libs/webrtc-audio-processing/webrtc-audio-processing-1.3-r3.ebuild
@@ -23,6 +23,7 @@ PATCHES=(
 	"${FILESDIR}/${PN}-1.3-big-endian-support.patch"
 	"${FILESDIR}/${PN}-1.3-x86-no-sse.patch"
 	"${FILESDIR}/${PN}-1.3-musl.patch"
+	"${FILESDIR}/${PN}-1.3-gcc15-cstdint.patch"
 )
 
 DOCS=( AUTHORS NEWS README.md )


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-08-06 11:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-06 11:32 [gentoo-commits] repo/gentoo:master commit in: media-libs/webrtc-audio-processing/files/, media-libs/webrtc-audio-processing/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2024-01-02  4:40 Sam James
2023-09-15  9:16 Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox