From nobody Tue Mar 01 18:54:38 2022 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id AB9CC19EAD30; Tue, 1 Mar 2022 18:54:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4K7RHy4Qdyz4kGN; Tue, 1 Mar 2022 18:54:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646160878; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/pYfejkoBXzSQ6jsfOHI2X4axgOjpRLqYP2hJhlg+nA=; b=wkqqiqYdpXmMAJJPgHs29/Drc+hPGWDEucBstxJmeplUVGHLUTeHlM4cvTEvJBhTeAEBCH ZzGuYOq6iBixlxQxmPBTF6N6eVi+cxn9UP4EuH0LNIV0Z3n8lSqC+LqLk7XbzTsh1FSEQn exoPITusOw93Wjrl0Klz96V7X4fZt167MOeS+cfO0hzVX63yEzqNOtqADhk2m+GOgKGORs 90Te2NJ3xroxhSTbKzhVbyiL1MM/a906pHurUOSSQqsH3OIJgRyCqhrvfxeJDsdqjXU6X+ uBZoORrcMdj4zC6HtSI9IBw1DBmY8iIiPl8ORoC04NkRK41leDoeCSHNBiDNMA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 77E5C1503D; Tue, 1 Mar 2022 18:54:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 221IsccV088230; Tue, 1 Mar 2022 18:54:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 221IscRt088229; Tue, 1 Mar 2022 18:54:38 GMT (envelope-from git) Date: Tue, 1 Mar 2022 18:54:38 GMT Message-Id: <202203011854.221IscRt088229@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Piotr Kubaj Subject: git: c9bdb0ca7d0f - main - audio/webrtc-audio-processing: fix build on powerpc64* List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pkubaj X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c9bdb0ca7d0fc6cec1d815d3d9b8e1d68888083a Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646160878; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/pYfejkoBXzSQ6jsfOHI2X4axgOjpRLqYP2hJhlg+nA=; b=R9K7JNSsbSTX97kXk99GH5UiiMxNnthtnCs0RTFR2aCQZVKqGwmZpm36fazvKNcrOdomYG Es1dPpv6gvHHAeMakJtaJjLgWAHHYzv1kH8yJVLNvGgAOuA/rk+62P6uLIHa75+vvlcXC6 vhyXm7/zTWFQEsMdtv41V2UwEzgKa3Sl2dtMzEuAKB0qDyC2GLAkBIDu1n5WqcK2A/OSv0 0ai4Ujhk2TbXUKP2hNEcZR7gYtVy9Cr+lYgWNPtvWfyUw4svoAvThkg+c4kTbAQeRIctUH Z4zQmSIaoqwb1caXm718GQ3UhOKuYulSOXesfknRPq65tHOqz2LvMzXwhnKqPA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1646160878; a=rsa-sha256; cv=none; b=JTbRyyMJqeeDmyip9JCE8YWTlFJt5EinPS9G+/JcP0fHXs7ehQIdUT1xDnEpcrELNRqBf3 CuBCCSxpcxvIvcl5aULDp7zHkl0Nx0H4/Y7bg5SbH9gRQ6HbWHI7UMgKewILZ8rmrw/gPY UwUr6GTYXKfC4uYQYaRyFXNfRP37k4FFVxhWudSCV0zhaxVop6yfCEOhcA70sc6K+1nQh2 3ZIW9VgT1xGxRm6UTZX/j/5C8IsRcA0WLIyVz0uAquEmkylOT2hYJyE8FMiTUpoSC267ee Zn0E4C08FNtcePuxKGu9aAjMPm83o+Hqu4rkd61QNyRV6f9dRacN+oPSOX9n4A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pkubaj: URL: https://cgit.FreeBSD.org/ports/commit/?id=c9bdb0ca7d0fc6cec1d815d3d9b8e1d68888083a commit c9bdb0ca7d0fc6cec1d815d3d9b8e1d68888083a Author: Piotr Kubaj AuthorDate: 2022-03-01 18:47:03 +0000 Commit: Piotr Kubaj CommitDate: 2022-03-01 18:47:03 +0000 audio/webrtc-audio-processing: fix build on powerpc64* Two patches waiting for approval by upstream + one that needed to be modified for FreeBSD (s/bswap_16/bswap16/) + making pffft include altivec.h. --- audio/webrtc-audio-processing/Makefile | 3 +- audio/webrtc-audio-processing/distinfo | 6 +- .../files/patch-powerpc64.patch | 140 +++++++++++++++++++++ 3 files changed, 147 insertions(+), 2 deletions(-) diff --git a/audio/webrtc-audio-processing/Makefile b/audio/webrtc-audio-processing/Makefile index 9f5242b7e17b..5cb33df236ff 100644 --- a/audio/webrtc-audio-processing/Makefile +++ b/audio/webrtc-audio-processing/Makefile @@ -8,6 +8,8 @@ PATCH_SITES= https://gitlab.freedesktop.org/pulseaudio/${PORTNAME}/-/commit/ PATCHFILES+= 2083c9a5dd34.patch:-p1 # https://gitlab.freedesktop.org/pulseaudio/webrtc-audio-processing/-/merge_requests/6 PATCHFILES+= 3f9907f93d39.patch:-p1 # https://gitlab.freedesktop.org/pulseaudio/webrtc-audio-processing/-/merge_requests/13 PATCHFILES+= b34c1d5746ea.patch:-p1 # https://gitlab.freedesktop.org/pulseaudio/webrtc-audio-processing/-/merge_requests/14 +PATCHFILES+= d49a0855a33b.patch:-p1 # https://gitlab.freedesktop.org/pulseaudio/webrtc-audio-processing/-/merge_requests/17 +PATCHFILES+= f29ff57d6ccd.patch:-p1 # https://gitlab.freedesktop.org/pulseaudio/webrtc-audio-processing/-/merge_requests/17 MAINTAINER= jbeich@FreeBSD.org COMMENT= AudioProcessing module from WebRTC project @@ -16,7 +18,6 @@ LICENSE= BSD3CLAUSE LICENSE_FILE= ${WRKSRC}/COPYING BROKEN_powerpc= fails to compile: ./webrtc/rtc_base/system/arch.h:54:2: Please add support for your architecture in rtc_base/system/arch.h -BROKEN_powerpc64= fails to compile: ./webrtc/rtc_base/system/arch.h:54:2: Please add support for your architecture in rtc_base/system/arch.h BROKEN_riscv64= fails to compile: ./webrtc/rtc_base/system/arch.h:54:2: Please add support for your architecture in rtc_base/system/arch.h BUILD_DEPENDS= cmake:devel/cmake diff --git a/audio/webrtc-audio-processing/distinfo b/audio/webrtc-audio-processing/distinfo index e91b7ec14280..9458f9e257de 100644 --- a/audio/webrtc-audio-processing/distinfo +++ b/audio/webrtc-audio-processing/distinfo @@ -1,4 +1,4 @@ -TIMESTAMP = 1606505453 +TIMESTAMP = 1645899872 SHA256 (webrtc-audio-processing-1.0.tar.gz) = 441a30d2717b2eb4145c6eb96c2d5a270fe0b4bc71aebf76716750c47be1936f SIZE (webrtc-audio-processing-1.0.tar.gz) = 856721 SHA256 (2083c9a5dd34.patch) = 3c34cc248c0292032b26ef67f078505037e51e84b6c7955162cac058aed54360 @@ -7,3 +7,7 @@ SHA256 (3f9907f93d39.patch) = 8e300c0ab9e85463ed0aebc7c69c95c293a14ef2ca0f50c7b7 SIZE (3f9907f93d39.patch) = 2049 SHA256 (b34c1d5746ea.patch) = b50edddb93a5bd4fdcc5110702111fe4ac000867358b7131e2ccce883a4c8dee SIZE (b34c1d5746ea.patch) = 923 +SHA256 (d49a0855a33b.patch) = fe8a4421a664108e7f5223f61278cd5a9096d8d0f33d1d648ac2c952d4c633b4 +SIZE (d49a0855a33b.patch) = 1388 +SHA256 (f29ff57d6ccd.patch) = 9200b95da26ee34ef106cb3f2eed75d95eed7e9911a7632923b3d885409f9406 +SIZE (f29ff57d6ccd.patch) = 858 diff --git a/audio/webrtc-audio-processing/files/patch-powerpc64.patch b/audio/webrtc-audio-processing/files/patch-powerpc64.patch new file mode 100644 index 000000000000..c7eba0e841cd --- /dev/null +++ b/audio/webrtc-audio-processing/files/patch-powerpc64.patch @@ -0,0 +1,140 @@ +Modified https://gitlab.freedesktop.org/pulseaudio/webrtc-audio-processing/-/merge_requests/17/diffs?commit_id=d49a0855a33bb56cc1935642c0d4bf7a3f474fbd for FreeBSD + pffft patch to include altivec.h. +--- webrtc/common_audio/wav_file.cc ++++ webrtc/common_audio/wav_file.cc +@@ -14,6 +14,7 @@ + + #include + #include ++#include + #include + #include + #include +@@ -89,10 +90,6 @@ void WavReader::Reset() { + + size_t WavReader::ReadSamples(const size_t num_samples, + int16_t* const samples) { +-#ifndef WEBRTC_ARCH_LITTLE_ENDIAN +-#error "Need to convert samples to big-endian when reading from WAV file" +-#endif +- + size_t num_samples_left_to_read = num_samples; + size_t next_chunk_start = 0; + while (num_samples_left_to_read > 0 && num_unread_samples_ > 0) { +@@ -124,15 +121,16 @@ size_t WavReader::ReadSamples(const size_t num_samples, + num_unread_samples_ -= num_samples_read; + num_samples_left_to_read -= num_samples_read; + } ++#ifndef WEBRTC_ARCH_LITTLE_ENDIAN ++ for (size_t i = 0; i < num_samples; i++) { ++ samples[i] = bswap16(samples[i]); ++ } ++#endif + + return num_samples - num_samples_left_to_read; + } + + size_t WavReader::ReadSamples(const size_t num_samples, float* const samples) { +-#ifndef WEBRTC_ARCH_LITTLE_ENDIAN +-#error "Need to convert samples to big-endian when reading from WAV file" +-#endif +- + size_t num_samples_left_to_read = num_samples; + size_t next_chunk_start = 0; + while (num_samples_left_to_read > 0 && num_unread_samples_ > 0) { +@@ -170,6 +168,12 @@ size_t WavReader::ReadSamples(const size_t num_samples, float* const samples) { + num_unread_samples_ -= num_samples_read; + num_samples_left_to_read -= num_samples_read; + } ++#ifndef WEBRTC_ARCH_LITTLE_ENDIAN ++ // TODO: is this the right place for this? ++ for (size_t i = 0; i < num_samples; i++) { ++ samples[i] = bswap16(samples[i]); ++ } ++#endif + + return num_samples - num_samples_left_to_read; + } +@@ -213,23 +217,33 @@ WavWriter::WavWriter(FileWrapper file, + } + + 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 +- + for (size_t i = 0; i < num_samples; i += kMaxChunksize) { + const size_t num_remaining_samples = num_samples - i; + const size_t num_samples_to_write = + std::min(kMaxChunksize, num_remaining_samples); + + if (format_ == WavFormat::kWavFormatPcm) { ++#ifndef WEBRTC_ARCH_LITTLE_ENDIAN + RTC_CHECK( + file_.Write(&samples[i], num_samples_to_write * sizeof(samples[0]))); ++#else ++ std::array converted_samples; ++ for (size_t j = 0; j < num_samples_to_write; ++j) { ++ converted_samples[j] = bswap16(samples[i + j]); ++ } ++ RTC_CHECK( ++ file_.Write(converted_samples.data(), ++ num_samples_to_write * sizeof(converted_samples[0]))); ++#endif + } else { + RTC_CHECK_EQ(format_, WavFormat::kWavFormatIeeeFloat); + std::array converted_samples; + for (size_t j = 0; j < num_samples_to_write; ++j) { +- converted_samples[j] = S16ToFloat(samples[i + j]); ++ int16_t sample = samples[i + j]; ++#ifndef WEBRTC_ARCH_LITTLE_ENDIAN ++ sample = bswap16(sample); ++#endif ++ converted_samples[j] = S16ToFloat(sample); + } + RTC_CHECK( + file_.Write(converted_samples.data(), +@@ -243,10 +257,6 @@ void WavWriter::WriteSamples(const int16_t* samples, size_t num_samples) { + } + + void WavWriter::WriteSamples(const float* samples, size_t num_samples) { +-#ifndef WEBRTC_ARCH_LITTLE_ENDIAN +-#error "Need to convert samples to little-endian when writing to WAV file" +-#endif +- + for (size_t i = 0; i < num_samples; i += kMaxChunksize) { + const size_t num_remaining_samples = num_samples - i; + const size_t num_samples_to_write = +@@ -255,7 +265,11 @@ void WavWriter::WriteSamples(const float* samples, size_t num_samples) { + if (format_ == WavFormat::kWavFormatPcm) { + std::array converted_samples; + for (size_t j = 0; j < num_samples_to_write; ++j) { +- converted_samples[j] = FloatS16ToS16(samples[i + j]); ++ int16_t sample = FloatS16ToS16(samples[i + j]); ++#ifndef WEBRTC_ARCH_LITTLE_ENDIAN ++ sample = bswap16(sample); ++#endif ++ converted_samples[j] = sample; + } + RTC_CHECK( + file_.Write(converted_samples.data(), +@@ -264,6 +278,7 @@ void WavWriter::WriteSamples(const float* samples, size_t num_samples) { + RTC_CHECK_EQ(format_, WavFormat::kWavFormatIeeeFloat); + std::array converted_samples; + for (size_t j = 0; j < num_samples_to_write; ++j) { ++ // TODO: is swap needed for big-endian here? + converted_samples[j] = FloatS16ToFloat(samples[i + j]); + } + RTC_CHECK( +-- +GitLab + +--- webrtc/third_party/pffft/src/pffft.c.orig 2022-02-26 18:37:29 UTC ++++ webrtc/third_party/pffft/src/pffft.c +@@ -100,6 +100,7 @@ + Altivec support macros + */ + #if !defined(PFFFT_SIMD_DISABLE) && (defined(__ppc__) || defined(__ppc64__)) ++#include + typedef vector float v4sf; + # define SIMD_SZ 4 + # define VZERO() ((vector float) vec_splat_u8(0))