commit:     f6baa20f72862687508e23181f49972f8e428a50
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue May 16 03:55:13 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue May 16 03:55:13 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f6baa20f

media-libs/speex: fix valgrind build

Closes: https://bugs.gentoo.org/906455
Thanks-to: Andrei Slavoiu <ansla80 <AT> yahoo.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 media-libs/speex/files/speex-1.2.1-valgrind.patch | 53 +++++++++++++++++++++++
 media-libs/speex/speex-1.2.1-r1.ebuild            |  1 +
 media-libs/speex/speex-1.2.1.ebuild               |  5 ++-
 3 files changed, 58 insertions(+), 1 deletion(-)

diff --git a/media-libs/speex/files/speex-1.2.1-valgrind.patch 
b/media-libs/speex/files/speex-1.2.1-valgrind.patch
new file mode 100644
index 000000000000..a9fd9789a127
--- /dev/null
+++ b/media-libs/speex/files/speex-1.2.1-valgrind.patch
@@ -0,0 +1,53 @@
+https://gitlab.xiph.org/xiph/speex/-/merge_requests/13
+
+From b15993fd560c90658ff2e4974e8b3a1afcfcfff2 Mon Sep 17 00:00:00 2001
+From: Andrei Slavoiu <[email protected]>
+Date: Tue, 16 May 2023 04:49:45 +0100
+Subject: [PATCH] Fix --enable-valgrind build
+
+VALGRIND_MAKE_READABLE has been replaced with VALGRIND_MAKE_MEM_DEFINED
+starting with version 3.2 (2006) 
https://valgrind.org/docs/manual/dist.news.old.html.
+
+Bug: https://bugs.gentoo.org/906455
+--- a/libspeex/nb_celp.c
++++ b/libspeex/nb_celp.c
+@@ -172,7 +172,7 @@ void *nb_encoder_init(const SpeexMode *m)
+    st->highpass_enabled = 1;
+ 
+ #ifdef ENABLE_VALGRIND
+-   VALGRIND_MAKE_READABLE(st, NB_ENC_STACK);
++   VALGRIND_MAKE_MEM_DEFINED(st, NB_ENC_STACK);
+ #endif
+    return st;
+ }
+@@ -1113,7 +1113,7 @@ void *nb_decoder_init(const SpeexMode *m)
+    st->highpass_enabled = 1;
+ 
+ #ifdef ENABLE_VALGRIND
+-   VALGRIND_MAKE_READABLE(st, NB_DEC_STACK);
++   VALGRIND_MAKE_MEM_DEFINED(st, NB_DEC_STACK);
+ #endif
+    return st;
+ }
+--- a/libspeex/sb_celp.c
++++ b/libspeex/sb_celp.c
+@@ -223,7 +223,7 @@ void *sb_encoder_init(const SpeexMode *m)
+    speex_encoder_ctl(st->st_low, SPEEX_GET_SAMPLING_RATE, &st->sampling_rate);
+    st->sampling_rate*=2;
+ #ifdef ENABLE_VALGRIND
+-   VALGRIND_MAKE_READABLE(st, (st->stack-(char*)st));
++   VALGRIND_MAKE_MEM_DEFINED(st, (st->stack-(char*)st));
+ #endif
+    return st;
+ }
+@@ -1017,7 +1017,7 @@ void *sb_decoder_init(const SpeexMode *m)
+    st->seed = 1000;
+ 
+ #ifdef ENABLE_VALGRIND
+-   VALGRIND_MAKE_READABLE(st, (st->stack-(char*)st));
++   VALGRIND_MAKE_MEM_DEFINED(st, (st->stack-(char*)st));
+ #endif
+    return st;
+ }
+-- 
+GitLab

diff --git a/media-libs/speex/speex-1.2.1-r1.ebuild 
b/media-libs/speex/speex-1.2.1-r1.ebuild
index c966d61c2a6e..f84f46069fda 100644
--- a/media-libs/speex/speex-1.2.1-r1.ebuild
+++ b/media-libs/speex/speex-1.2.1-r1.ebuild
@@ -33,6 +33,7 @@ S="${WORKDIR}/${MY_P}"
 PATCHES=(
        "${FILESDIR}"/${PN}-1.2.0-configure.patch
        "${FILESDIR}"/${P}-vla-detection.patch
+       "${FILESDIR}"/${PN}-1.2.1-valgrind.patch
 )
 
 src_prepare() {

diff --git a/media-libs/speex/speex-1.2.1.ebuild 
b/media-libs/speex/speex-1.2.1.ebuild
index eecc7ebf0031..a79308db25b2 100644
--- a/media-libs/speex/speex-1.2.1.ebuild
+++ b/media-libs/speex/speex-1.2.1.ebuild
@@ -30,7 +30,10 @@ BDEPEND="virtual/pkgconfig"
 
 S="${WORKDIR}/${MY_P}"
 
-PATCHES=( "${FILESDIR}"/${PN}-1.2.0-configure.patch )
+PATCHES=(
+       "${FILESDIR}"/${PN}-1.2.0-configure.patch
+       "${FILESDIR}"/${PN}-1.2.1-valgrind.patch
+)
 
 src_prepare() {
        default

Reply via email to