commit:     350cf9e5ff41a6a589a8ed40b69154eed7adbed7
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Feb  7 04:32:24 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Feb  7 04:33:37 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=350cf9e5

media-libs/codec2: add upstream -Os patch

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

 media-libs/codec2/codec2-1.0.3.ebuild                 |  9 +++++----
 .../codec2/files/codec2-1.0.3-fix-build-with-Os.patch | 19 +++++++++++++++++++
 2 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/media-libs/codec2/codec2-1.0.3.ebuild 
b/media-libs/codec2/codec2-1.0.3.ebuild
index 3f50389d58e9..e9d3f48e1237 100644
--- a/media-libs/codec2/codec2-1.0.3.ebuild
+++ b/media-libs/codec2/codec2-1.0.3.ebuild
@@ -4,7 +4,7 @@
 EAPI=8
 
 CMAKE_ECLASS=cmake
-inherit cmake-multilib flag-o-matic
+inherit cmake-multilib
 
 MY_PV="${PV%.*}${PV##*.}"
 DESCRIPTION="Low bit rate speech codec"
@@ -24,10 +24,11 @@ RESTRICT="test"
 
 #BDEPEND="test? ( sci-mathematics/octave )"
 
-multilib_src_configure() {
-       # bug #817437
-       replace-flags -Os -O2
+PATCHES=(
+       "${FILESDIR}"/${P}-fix-build-with-Os.patch
+)
 
+multilib_src_configure() {
        local mycmakeargs=(
                -DUNITTEST=$(usex test)
                -DINSTALL_EXAMPLES=$(usex examples)

diff --git a/media-libs/codec2/files/codec2-1.0.3-fix-build-with-Os.patch 
b/media-libs/codec2/files/codec2-1.0.3-fix-build-with-Os.patch
new file mode 100644
index 000000000000..4f3f30661421
--- /dev/null
+++ b/media-libs/codec2/files/codec2-1.0.3-fix-build-with-Os.patch
@@ -0,0 +1,19 @@
+https://github.com/drowe67/codec2/commit/a8d4226859548ceb050619160af562e0b43bb05c
+https://github.com/drowe67/codec2/issues/293#issuecomment-1025665342
+
+From: drowe67 <[email protected]>
+Date: Tue, 1 Feb 2022 07:20:50 +1030
+Subject: [PATCH] change required to build with -Os
+
+--- a/src/cohpsk.c
++++ b/src/cohpsk.c
+@@ -816,7 +816,7 @@ typedef float float4 __attribute__ ((vector_size (16)));
+ 
+ 
\*---------------------------------------------------------------------------*/
+ 
+-inline void rx_filter_coh(COMP rx_filt[COHPSK_NC*COHPSK_ND][P+1], int Nc, 
COMP rx_baseband[COHPSK_NC*COHPSK_ND][COHPSK_M+COHPSK_M/P], COMP 
rx_filter_memory[COHPSK_NC*COHPSK_ND][COHPSK_NFILTER], int nin)
++inline extern void rx_filter_coh(COMP rx_filt[COHPSK_NC*COHPSK_ND][P+1], int 
Nc, COMP rx_baseband[COHPSK_NC*COHPSK_ND][COHPSK_M+COHPSK_M/P], COMP 
rx_filter_memory[COHPSK_NC*COHPSK_ND][COHPSK_NFILTER], int nin)
+ {
+     int c,i,j,k,l;
+     int n=COHPSK_M/P;
+

Reply via email to