summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiroslav Šulc <fordfrog@gentoo.org>2021-05-09 09:39:55 +0200
committerMiroslav Šulc <fordfrog@gentoo.org>2021-05-09 09:40:44 +0200
commit11e0450192ef7c21d6bb78507ff26d63d8076be2 (patch)
tree727700a4caef0951c593b755777a3bc9980fa483
parentmedia-video/ffmpeg: shift phase order (multilib_src_test) (diff)
downloadgentoo-11e0450192ef7c21d6bb78507ff26d63d8076be2.tar.gz
gentoo-11e0450192ef7c21d6bb78507ff26d63d8076be2.tar.bz2
gentoo-11e0450192ef7c21d6bb78507ff26d63d8076be2.zip
media-sound/jack_capture: fixed conflicting asprintf
thanks to Kevin Thomas <me@kevinthomas.dev> for helping with the fix Closes: https://bugs.gentoo.org/713388 Package-Manager: Portage-3.0.18, Repoman-3.0.3 Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>
-rw-r--r--media-sound/jack_capture/files/jack_capture-0.9.73-avoid-custom-asprintf.patch68
-rw-r--r--media-sound/jack_capture/jack_capture-0.9.73-r1.ebuild3
2 files changed, 70 insertions, 1 deletions
diff --git a/media-sound/jack_capture/files/jack_capture-0.9.73-avoid-custom-asprintf.patch b/media-sound/jack_capture/files/jack_capture-0.9.73-avoid-custom-asprintf.patch
new file mode 100644
index 000000000000..6c4d32985b6e
--- /dev/null
+++ b/media-sound/jack_capture/files/jack_capture-0.9.73-avoid-custom-asprintf.patch
@@ -0,0 +1,68 @@
+diff --git a/jack_capture.c b/jack_capture.c
+index b2d15a1..ccbfa5c 100644
+--- a/jack_capture.c
++++ b/jack_capture.c
+@@ -20,6 +20,8 @@
+
+ #include "das_config.h"
+
++#define _GNU_SOURCE 1
++
+ #include <signal.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+@@ -900,54 +902,6 @@ static void stop_helper_thread(void){
+ /////////////////////////////////////////////////////////////////////
+
+
+-#ifndef __USE_GNU
+-/* This code has been derived from an example in the glibc2 documentation.
+- * "asprintf() implementation for braindamaged operating systems"
+- * Copyright (C) 1991, 1994-1999, 2000, 2001 Free Software Foundation, Inc.
+- */
+-#ifdef _WIN32
+-#define vsnprintf _vsnprintf
+-#endif
+-#ifndef __APPLE__
+-int asprintf(char **buffer, char *fmt, ...) {
+- /* Guess we need no more than 200 chars of space. */
+- int size = 200;
+- int nchars;
+- va_list ap;
+-
+- *buffer = (char*)malloc(size);
+- if (*buffer == NULL) return -1;
+-
+- /* Try to print in the allocated space. */
+- va_start(ap, fmt);
+- nchars = vsnprintf(*buffer, size, fmt, ap);
+- va_end(ap);
+-
+- if (nchars >= size)
+- {
+- char *tmpbuff;
+- /* Reallocate buffer now that we know how much space is needed. */
+- size = nchars+1;
+- tmpbuff = (char*)realloc(*buffer, size);
+-
+- if (tmpbuff == NULL) { /* we need to free it*/
+- free(*buffer);
+- return -1;
+- }
+-
+- *buffer=tmpbuff;
+- /* Try again. */
+- va_start(ap, fmt);
+- nchars = vsnprintf(*buffer, size, fmt, ap);
+- va_end(ap);
+- }
+-
+- if (nchars < 0) return nchars;
+- return size;
+-}
+-#endif
+-#endif
+-
+ #define ARGS_ADD_ARGV(FMT,ARG) \
+ argv=(char**) realloc((void*)argv, (argc+2)*sizeof(char*)); \
+ asprintf(&argv[argc++], FMT, ARG); argv[argc] = 0;
diff --git a/media-sound/jack_capture/jack_capture-0.9.73-r1.ebuild b/media-sound/jack_capture/jack_capture-0.9.73-r1.ebuild
index 17e85197eb3d..d8ddd678eb88 100644
--- a/media-sound/jack_capture/jack_capture-0.9.73-r1.ebuild
+++ b/media-sound/jack_capture/jack_capture-0.9.73-r1.ebuild
@@ -25,7 +25,8 @@ DEPEND="${RDEPEND}"
BDEPEND="virtual/pkgconfig"
PATCHES=(
- "${FILESDIR}"/${P}-Makefile.patch
+ "${FILESDIR}/${P}-Makefile.patch"
+ "${FILESDIR}/${P}-avoid-custom-asprintf.patch"
)
DOCS=( README config )