aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/audacity-build-with-system-portaudio.patch
blob: 05325a14937d3dd08d4966183e0ddc3782f26904 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
Downloaded from here:
https://sourceforge.net/p/audacity/mailman/message/36106562/

Modified for use on later versions of audacity.

>From 5f9482a191359f2c477763a36d2c865c5f186602 Mon Sep 17 00:00:00 2001
From: Antonio Ospite <ao2@ao2.it>
Date: Tue, 7 Nov 2017 13:06:33 +0100
Subject: [PATCH] Fix building against the system portaudio library

Building against the system portaudio results in this error:

./src/AudioIO.cpp:983: undefined reference to `PaUtil_GetTime'
audacity-AudioIO.o: In function `audacityAudioCallback(void const*, void*,
unsigned long, PaStreamCallbackTimeInfo const*, unsigned long, void*)':
./src/AudioIO.cpp:4630: undefined reference to `PaUtil_GetTime'
collect2: error: ld returned 1 exit status
Makefile:2349: recipe for target 'audacity' failed
make[3]: *** [audacity] Error 1

This is because PaUtil_GetTime is declared as a C symbol in pa_util.h
but is resolved as a C++ symbol at link time.

Audacity fixes this in the local tree with this change:
https://github.com/audacity/audacity/commit/38fd97b8e26060332ab3e9e000a8882326a70ba7

However this is not general enough for the portaudio debian package.

Since PaUtil_GetTime() is the only function causing problems, just copy
over the code where it's used.
---
 src/AudioIO.cpp | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/src/AudioIO.cpp b/src/AudioIO.cpp
index 48715869c..bb4bf472c 100644
--- a/src/AudioIO.cpp
+++ b/src/AudioIO.cpp
@@ -480,9 +480,22 @@ time warp info and AudioIOListener and whether the playback is looped.
    #define ROUND(x) (int) ((x)+0.5)
    //#include <string.h>
 //   #include "../lib-src/portmidi/pm_common/portmidi.h"
-   #include "../lib-src/portaudio-v19/src/common/pa_util.h"
    #include "NoteTrack.h"
 #endif
+PaTime PaUtil_GetTime( void )
+{
+#ifdef HAVE_MACH_ABSOLUTE_TIME
+    return mach_absolute_time() * machSecondsConversionScaler_;
+#elif defined(HAVE_CLOCK_GETTIME)
+    struct timespec tp;
+    clock_gettime(CLOCK_REALTIME, &tp);
+    return (PaTime)(tp.tv_sec + tp.tv_nsec * 1e-9);
+#else
+    struct timeval tv;
+    gettimeofday( &tv, NULL );
+    return (PaTime) tv.tv_usec * 1e-6 + tv.tv_sec;
+#endif
+}
 
 #ifdef EXPERIMENTAL_AUTOMATED_INPUT_LEVEL_ADJUSTMENT
    #define LOWER_BOUND 0.0
gnu/packages/vim.scm, gnu/packages/virtualization.scm, gnu/packages/vlang.scm, gnu/packages/vnc.scm, gnu/packages/vpn.scm, gnu/packages/web-browsers.scm, gnu/packages/web.scm, gnu/packages/wireservice.scm, gnu/packages/wm.scm, gnu/packages/wxwidgets.scm, gnu/packages/xdisorg.scm, gnu/packages/xml.scm, gnu/packages/xorg.scm, tests/lint.scm: Remove trailing ".git" from 'git-reference' URL. Ludovic Courtès 2019-11-10gnu: Add 'file-name' where appropriate....* gnu/packages/admin.scm (detox, neofetch), gnu/packages/algebra.scm (python-fpylll), gnu/packages/bioinformatics.scm (tbsp, genrich), gnu/packages/crypto.scm (hpenc), gnu/packages/digest.scm (xxhash), gnu/packages/emacs-xyz.scm (emacs-tiny, emacs-ergoemacs-mode, emacs-make-it-so, emacs-poet-theme, emacs-deft, emacs-scribble-mode, emacs-helm-mu, emacs-unidecode, emacs-diff-hl, emacs-helm-exwm, emacs-gif-screencast, emacs-exec-path-from-shell), gnu/packages/engineering.scm (gpx), gnu/packages/freedesktop.scm (waylandpp), gnu/packages/golang.scm (go-github-com-sirupsen-logrus, go-github-com-shirou-gopsutil), gnu/packages/guile-xyz.scm (guile-studio, guile-picture-language, jupyter-guile-kernel), gnu/packages/image-viewers.scm (qview), gnu/packages/java-maths.scm (java-jblas), gnu/packages/llvm.scm (libclc), gnu/packages/logging.scm (spdlog), gnu/packages/ocaml.scm (ocaml-cstruct, ocaml-zarith), gnu/packages/terminals.scm (libtsm), gnu/packages/tigervnc.scm (tigervnc-client), gnu/packages/xdisorg.scm (xcalib, xbanish) [source]: Add file-name. Efraim Flashner 2019-03-04gnu: Add java-jblas....* gnu/packages/java-maths.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. Ricardo Wurmus