[gentoo-commits] repo/gentoo:master commit in: media-libs/opus/files/, media-libs/opus/

2023-04-25 Thread Sam James
commit: 95eafe73daf6e7017a525075c01bf2aef2b9c69e
Author: Sam James  gentoo  org>
AuthorDate: Tue Apr 25 19:48:01 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Tue Apr 25 19:48:45 2023 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=95eafe73

media-libs/opus: fix build on arm64

Closes: https://bugs.gentoo.org/904739
Signed-off-by: Sam James  gentoo.org>

 media-libs/opus/files/opus-1.4-arm64-neon.patch | 24 
 media-libs/opus/opus-1.4.ebuild |  1 +
 2 files changed, 25 insertions(+)

diff --git a/media-libs/opus/files/opus-1.4-arm64-neon.patch 
b/media-libs/opus/files/opus-1.4-arm64-neon.patch
new file mode 100644
index ..544d480505ea
--- /dev/null
+++ b/media-libs/opus/files/opus-1.4-arm64-neon.patch
@@ -0,0 +1,24 @@
+https://bugs.gentoo.org/904739
+https://github.com/xiph/opus/issues/273
+https://github.com/xiph/opus/pull/267
+
+From d94583359bcf8f1b52cc93b7ca6ced9664fb2a7e Mon Sep 17 00:00:00 2001
+From: Vilius 
+Date: Sun, 27 Nov 2022 03:13:09 +0200
+Subject: [PATCH] Meson: Fix unknown variable have_arm_intrinsics_or_asm
+
+--- a/silk/meson.build
 b/silk/meson.build
+@@ -25,6 +25,11 @@ if host_cpu_family in ['x86', 'x86_64'] and 
opus_conf.has('OPUS_HAVE_RTCD')
+   silk_sources +=  sources['SILK_SOURCES_X86_RTCD']
+ endif
+ 
++have_arm_intrinsics_or_asm = have_arm_ne10
++if (intrinsics_support.length() + asm_optimization.length() + 
inline_optimization.length()) > 0
++  have_arm_intrinsics_or_asm = true
++endif
++
+ if host_cpu_family in ['arm', 'aarch64'] and have_arm_intrinsics_or_asm
+   if opus_conf.has('OPUS_HAVE_RTCD')
+ silk_sources +=  sources['SILK_SOURCES_ARM_RTCD']
+

diff --git a/media-libs/opus/opus-1.4.ebuild b/media-libs/opus/opus-1.4.ebuild
index 5c116f4d9edc..5468589c3ad0 100644
--- a/media-libs/opus/opus-1.4.ebuild
+++ b/media-libs/opus/opus-1.4.ebuild
@@ -27,6 +27,7 @@ BDEPEND="
 
 PATCHES=(
"${FILESDIR}"/${PN}-1.3.1-libdir-macro.patch
+   "${FILESDIR}"/${PN}-1.4-arm64-neon.patch
 )
 
 multilib_src_configure() {



[gentoo-commits] repo/gentoo:master commit in: media-libs/opus/files/, media-libs/opus/

2022-11-22 Thread Sam James
commit: 21423d7c709202944aea111afd18ec1fecb2013a
Author: Sam James  gentoo  org>
AuthorDate: Wed Nov 23 03:22:01 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Nov 23 03:22:01 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=21423d7c

media-libs/opus: EAPI 8, fix -Wstrict-prototypes in configure

We may well have people proactively trying to use it and it's cheap to fix & 
build.

Signed-off-by: Sam James  gentoo.org>

 .../files/opus-1.3.1-macro-wstrict-prototypes.patch  | 20 
 .../{opus-1.3.1-r3.ebuild => opus-1.3.1-r4.ebuild}   |  3 ++-
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/media-libs/opus/files/opus-1.3.1-macro-wstrict-prototypes.patch 
b/media-libs/opus/files/opus-1.3.1-macro-wstrict-prototypes.patch
new file mode 100644
index ..34edb539b29c
--- /dev/null
+++ b/media-libs/opus/files/opus-1.3.1-macro-wstrict-prototypes.patch
@@ -0,0 +1,20 @@
+https://gitlab.xiph.org/xiph/opus/-/merge_requests/56
+
+From 402615a38851f7180c3ac01e246fcbc7de9fd451 Mon Sep 17 00:00:00 2001
+From: Sam James 
+Date: Wed, 23 Nov 2022 03:19:54 +
+Subject: [PATCH] opus.m4: fix -Wstrict-prototypes
+
+Signed-off-by: Sam James 
+--- a/opus.m4
 b/opus.m4
+@@ -63,7 +63,7 @@ dnl
+ #include 
+ #include 
+ 
+-int main ()
++int main (void)
+ {
+   system("touch conf.opustest");
+   return 0;
+GitLab

diff --git a/media-libs/opus/opus-1.3.1-r3.ebuild 
b/media-libs/opus/opus-1.3.1-r4.ebuild
similarity index 95%
rename from media-libs/opus/opus-1.3.1-r3.ebuild
rename to media-libs/opus/opus-1.3.1-r4.ebuild
index 591e14778028..f0cf24b1ed2b 100644
--- a/media-libs/opus/opus-1.3.1-r3.ebuild
+++ b/media-libs/opus/opus-1.3.1-r4.ebuild
@@ -1,7 +1,7 @@
 # Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=7
+EAPI=8
 
 inherit flag-o-matic multilib-minimal
 
@@ -24,6 +24,7 @@ BDEPEND="
 
 PATCHES=(
"${FILESDIR}"/${PN}-1.3.1-libdir-macro.patch
+   "${FILESDIR}"/${PN}-1.3.1-macro-wstrict-prototypes.patch
 )
 
 multilib_src_configure() {



[gentoo-commits] repo/gentoo:master commit in: media-libs/opus/files/, media-libs/opus/

2021-05-28 Thread David Seifert
commit: 72a8f02430736c23ef9b60a47dd83ee945578d9b
Author: Sam James  gentoo  org>
AuthorDate: Fri May 28 15:37:07 2021 +
Commit: David Seifert  gentoo  org>
CommitDate: Fri May 28 15:37:07 2021 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=72a8f024

media-libs/opus: fix libdir in installed M4 macro

Most consumers seem to work around this fine nowdays,
but we should still fix the macro.

Signed-off-by: Sam James  gentoo.org>
Signed-off-by: David Seifert  gentoo.org>

 media-libs/opus/files/opus-1.3.1-libdir-macro.patch | 11 +++
 media-libs/opus/opus-1.3.1-r2.ebuild|  6 +-
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/media-libs/opus/files/opus-1.3.1-libdir-macro.patch 
b/media-libs/opus/files/opus-1.3.1-libdir-macro.patch
new file mode 100644
index 000..4f57e54ddf0
--- /dev/null
+++ b/media-libs/opus/files/opus-1.3.1-libdir-macro.patch
@@ -0,0 +1,11 @@
+--- a/opus.m4
 b/opus.m4
+@@ -22,7 +22,7 @@ 
AC_ARG_ENABLE(opustest,AC_HELP_STRING([--disable-opustest],[Do not try to compil
+   elif test "x$opus_prefix" != "x" ; then
+ OPUS_LIBS="-L$opus_prefix/lib"
+   elif test "x$prefix" != "xNONE" ; then
+-OPUS_LIBS="-L$prefix/lib"
++OPUS_LIBS="-L${libdir}"
+   fi
+ 
+   if test "x$opus_prefix" != "xno" ; then

diff --git a/media-libs/opus/opus-1.3.1-r2.ebuild 
b/media-libs/opus/opus-1.3.1-r2.ebuild
index 08cffd6f0a3..ce65edada36 100644
--- a/media-libs/opus/opus-1.3.1-r2.ebuild
+++ b/media-libs/opus/opus-1.3.1-r2.ebuild
@@ -20,6 +20,10 @@ BDEPEND="doc? (
media-gfx/graphviz
)"
 
+PATCHES=(
+   "${FILESDIR}"/${PN}-1.3.1-libdir-macro.patch
+)
+
 multilib_src_configure() {
local myeconfargs=(
$(use_enable custom-modes)
@@ -33,7 +37,7 @@ multilib_src_configure() {
# bug #752069
for i in "${INTRINSIC_FLAGS}" ; do
use ${i} && myeconfargs+=( --enable-intrinsics ) && break
-   done ||  myeconfargs+=( --disable-intrinsics )
+   done || myeconfargs+=( --disable-intrinsics )
 
if is-flagq -ffast-math || is-flagq -Ofast; then
myeconfargs+=( "--enable-float-approx" )



[gentoo-commits] repo/gentoo:master commit in: media-libs/opus/files/, media-libs/opus/

2017-01-20 Thread David Seifert
commit: fedc905f2f73265c4108e2a4b359846d10dee66d
Author: David Seifert  gentoo  org>
AuthorDate: Fri Jan 20 18:53:40 2017 +
Commit: David Seifert  gentoo  org>
CommitDate: Fri Jan 20 18:56:27 2017 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fedc905f

media-libs/opus: Add patch for CVE-2017-0381

Gentoo-bug: 605894

Package-Manager: Portage-2.3.3, Repoman-2.3.1

 .../opus/files/opus-1.1.3-CVE-2017-0381.patch  | 24 +
 media-libs/opus/opus-1.1.3-r1.ebuild   | 42 ++
 2 files changed, 66 insertions(+)

diff --git a/media-libs/opus/files/opus-1.1.3-CVE-2017-0381.patch 
b/media-libs/opus/files/opus-1.1.3-CVE-2017-0381.patch
new file mode 100644
index ..621236b
--- /dev/null
+++ b/media-libs/opus/files/opus-1.1.3-CVE-2017-0381.patch
@@ -0,0 +1,24 @@
+From 79e8f527b0344b0897a65be35e77f7885bd99409 Mon Sep 17 00:00:00 2001
+From: Felicia Lim 
+Date: Thu, 28 Jul 2016 15:21:19 +0200
+Subject: [PATCH] Ensure that NLSF cannot be negative when computing a min
+ distance between them
+
+Signed-off-by: Jean-Marc Valin 
+---
+ silk/NLSF_stabilize.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/silk/NLSF_stabilize.c b/silk/NLSF_stabilize.c
+index 1fa1ea3..8f3426b 100644
+--- a/silk/NLSF_stabilize.c
 b/silk/NLSF_stabilize.c
+@@ -130,7 +130,7 @@ void silk_NLSF_stabilize(
+ 
+ /* Keep delta_min distance between the NLSFs */
+ for( i = 1; i < L; i++ )
+-NLSF_Q15[i] = silk_max_int( NLSF_Q15[i], NLSF_Q15[i-1] + 
NDeltaMin_Q15[i] );
++NLSF_Q15[i] = silk_max_int( NLSF_Q15[i], silk_ADD_SAT16( 
NLSF_Q15[i-1], NDeltaMin_Q15[i] ) );
+ 
+ /* Last NLSF should be no higher than 1 - NDeltaMin[L] */
+ NLSF_Q15[L-1] = silk_min_int( NLSF_Q15[L-1], (1<<15) - 
NDeltaMin_Q15[L] );

diff --git a/media-libs/opus/opus-1.1.3-r1.ebuild 
b/media-libs/opus/opus-1.1.3-r1.ebuild
new file mode 100644
index ..cfe478a
--- /dev/null
+++ b/media-libs/opus/opus-1.1.3-r1.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+inherit multilib-minimal
+
+if [[ ${PV} == * ]] ; then
+   inherit git-2
+   EGIT_REPO_URI="git://git.opus-codec.org/opus.git"
+else
+   SRC_URI="http://downloads.xiph.org/releases/${PN}/${P}.tar.gz;
+   KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 
~amd64-fbsd"
+fi
+
+DESCRIPTION="Open codec designed for internet transmission of interactive 
speech and audio"
+HOMEPAGE="http://opus-codec.org/;
+SRC_URI="http://downloads.xiph.org/releases/opus/${P}.tar.gz;
+
+LICENSE="BSD-2"
+SLOT="0"
+INTRINSIC_FLAGS="cpu_flags_x86_sse neon"
+IUSE="ambisonics custom-modes doc static-libs ${INTRINSIC_FLAGS}"
+
+DEPEND="doc? ( app-doc/doxygen )"
+
+PATCHES=(
+   "${FILESDIR}"/${PN}-1.1.3-CVE-2017-0381.patch
+)
+
+multilib_src_configure() {
+   local myeconfargs=(
+   $(use_enable custom-modes)
+   $(use_enable ambisonics)
+   $(use_enable doc)
+   )
+   for i in ${INTRINSIC_FLAGS} ; do
+   use ${i} && myeconfargs+=( --enable-intrinsics )
+   done
+   ECONF_SOURCE="${S}" \
+   econf "${myeconfargs[@]}"
+}