gnu: audacity: Update to 2.2.0.

* gnu/packages/patches/audacity-build-with-system-portaudio.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/audio.scm (audacity): Update to 2.2.0.
[source]: Add patch to build with system portaudio; add snippet to remove most
bundled libraries.
[inputs]: Replace "gtk+-2" with "gtk+", replace "wxwidgets-gtk2" with
"wxwidgets"; remove "libsbsms"; add "suil" and "portmidi".
[arguments]: Adjust configure flags to avoid using bundled libraries; remove
phase "autoreconf"; add phases "fix-sbsms-check" and "use-upstream-headers".
This commit is contained in:
Ricardo Wurmus 2017-11-18 14:49:29 +01:00
parent 218d1ddef8
commit 3182a1d2f1
No known key found for this signature in database
GPG key ID: 197A5888235FACAC
3 changed files with 139 additions and 16 deletions

View file

@ -542,6 +542,7 @@ dist_patch_DATA = \
%D%/packages/patches/ath9k-htc-firmware-binutils.patch \ %D%/packages/patches/ath9k-htc-firmware-binutils.patch \
%D%/packages/patches/ath9k-htc-firmware-gcc.patch \ %D%/packages/patches/ath9k-htc-firmware-gcc.patch \
%D%/packages/patches/ath9k-htc-firmware-objcopy.patch \ %D%/packages/patches/ath9k-htc-firmware-objcopy.patch \
%D%/packages/patches/audacity-build-with-system-portaudio.patch \
%D%/packages/patches/automake-skip-amhello-tests.patch \ %D%/packages/patches/automake-skip-amhello-tests.patch \
%D%/packages/patches/automake-regexp-syntax.patch \ %D%/packages/patches/automake-regexp-syntax.patch \
%D%/packages/patches/automake-test-gzip-warning.patch \ %D%/packages/patches/automake-test-gzip-warning.patch \

View file

@ -82,6 +82,7 @@ (define-module (gnu packages audio)
#:use-module (gnu packages xorg) #:use-module (gnu packages xorg)
#:use-module (gnu packages maths) #:use-module (gnu packages maths)
#:use-module (gnu packages multiprecision) #:use-module (gnu packages multiprecision)
#:use-module (gnu packages music)
#:use-module (srfi srfi-1)) #:use-module (srfi srfi-1))
(define-public alsa-modular-synth (define-public alsa-modular-synth
@ -275,20 +276,42 @@ (define-public ardour
(define-public audacity (define-public audacity
(package (package
(name "audacity") (name "audacity")
(version "2.1.3") (version "2.2.0")
(source (source
(origin (origin
(method url-fetch) (method url-fetch)
(uri (string-append "https://github.com/audacity/audacity/archive" (uri (string-append "https://github.com/audacity/audacity/archive"
"/Audacity-" version ".tar.gz")) "/Audacity-" version ".tar.gz"))
(sha256 (sha256
(base32 "11mx7gb4dbqrgfp7hm0154x3m76ddnmhf2675q5zkxn7jc5qfc6b")))) (base32 "09xpr4bjnainz1xmc35v3qg3dadjr9wv8bmn1p4y91aqyihnhjry"))
(patches (search-patches "audacity-build-with-system-portaudio.patch"))
(modules '((guix build utils)))
(snippet
;; Remove bundled libraries.
'(begin
(for-each
(lambda (dir)
(delete-file-recursively (string-append "lib-src/" dir)))
'("expat" "ffmpeg" "libflac" "libid3tag" "libmad" "libogg"
"libsndfile" "libsoxr" "libvamp" "libvorbis" "lv2"
"portaudio-v19" "portmidi" "soundtouch" "twolame"
;; FIXME: these libraries have not been packaged yet:
;; "libnyquist"
;; "libscorealign"
;; "libwidgetextra"
;; "portburn"
;; "portsmf"
;; "portmixer"
;; FIXME: we have this library, but it differs in that the Slide
;; class does not have a member "getInverseStretchedTime".
;; "sbsms"
))
#t))))
(build-system gnu-build-system) (build-system gnu-build-system)
(inputs (inputs
;; TODO: Add portSMF and libwidgetextra once they're packaged. In-tree `(("wxwidgets" ,wxwidgets)
;; versions shipping with Audacity are used for now. ("gtk" ,gtk+)
`(("wxwidgets" ,wxwidgets-gtk2)
("gtk" ,gtk+-2)
("alsa-lib" ,alsa-lib) ("alsa-lib" ,alsa-lib)
("jack" ,jack-1) ("jack" ,jack-1)
("expat" ,expat) ("expat" ,expat)
@ -297,7 +320,7 @@ (define-public audacity
("flac" ,flac) ("flac" ,flac)
("libid3tag" ,libid3tag) ("libid3tag" ,libid3tag)
("libmad" ,libmad) ("libmad" ,libmad)
("libsbsms" ,libsbsms) ;;("libsbsms" ,libsbsms) ;bundled version is modified
("libsndfile" ,libsndfile) ("libsndfile" ,libsndfile)
("soundtouch" ,soundtouch) ("soundtouch" ,soundtouch)
("soxr" ,soxr) ;replaces libsamplerate ("soxr" ,soxr) ;replaces libsamplerate
@ -305,8 +328,10 @@ (define-public audacity
("vamp" ,vamp) ("vamp" ,vamp)
("libvorbis" ,libvorbis) ("libvorbis" ,libvorbis)
("lv2" ,lv2) ("lv2" ,lv2)
("lilv" ,lilv) ("lilv" ,lilv) ;for lv2
("portaudio" ,portaudio))) ("suil" ,suil) ;for lv2
("portaudio" ,portaudio)
("portmidi" ,portmidi)))
(native-inputs (native-inputs
`(("autoconf" ,autoconf) `(("autoconf" ,autoconf)
("automake" ,automake) ("automake" ,automake)
@ -318,22 +343,55 @@ (define-public audacity
(arguments (arguments
'(#:configure-flags '(#:configure-flags
(let ((libid3tag (assoc-ref %build-inputs "libid3tag")) (let ((libid3tag (assoc-ref %build-inputs "libid3tag"))
(libmad (assoc-ref %build-inputs "libmad"))) (libmad (assoc-ref %build-inputs "libmad"))
(portmidi (assoc-ref %build-inputs "portmidi")))
(list (list
;; Loading FFmpeg dynamically is problematic. ;; Loading FFmpeg dynamically is problematic.
"--disable-dynamic-loading" "--disable-dynamic-loading"
;; libid3tag and libmad provide no .pc files, so pkg-config fails to ;; portmidi, libid3tag and libmad provide no .pc files, so
;; find them. Force their inclusion. ;; pkg-config fails to find them. Force their inclusion.
(string-append "ID3TAG_CFLAGS=-I" libid3tag "/include") (string-append "ID3TAG_CFLAGS=-I" libid3tag "/include")
(string-append "ID3TAG_LIBS=-L" libid3tag "/lib -lid3tag -lz") (string-append "ID3TAG_LIBS=-L" libid3tag "/lib -lid3tag -lz")
(string-append "LIBMAD_CFLAGS=-I" libmad "/include") (string-append "LIBMAD_CFLAGS=-I" libmad "/include")
(string-append "LIBMAD_LIBS=-L" libmad "/lib -lmad"))) (string-append "LIBMAD_LIBS=-L" libmad "/lib -lmad")
(string-append "PORTMIDI_CFLAGS=-I" portmidi "/include")
(string-append "PORTMIDI_LIBS=-L" portmidi "/lib -lportmidi")
"EXPAT_USE_SYSTEM=yes"
"FFMPEG_USE_SYSTEM=yes"
"LAME_USE_SYSTEM=yes"
"LIBFLAC_USE_SYSTEM=yes"
"LIBID3TAG_USE_SYSTEM=yes"
"LIBMAD_USE_SYSTEM=yes"
"USE_LOCAL_LIBNYQUIST=" ;not packaged yet
;;"LIBSBSMS_USE_SYSTEM=yes" ;bundled version is patched
"LIBSNDFILE_USE_SYSTEM=yes"
"LIBSOUNDTOUCH_USE_SYSTEM=yes"
"LIBSOXR_USE_SYSTEM=yes"
"LIBTWOLAME_USE_SYSTEM=yes"
"LIBVAMP_USE_SYSTEM=yes"
"LIBVORBIS_USE_SYSTEM=yes"
"LV2_USE_SYSTEM=yes"
"PORTAUDIO_USE_SYSTEM=yes"))
#:phases #:phases
(modify-phases %standard-phases (modify-phases %standard-phases
;; FFmpeg is only detected if autoreconf runs. (add-after 'unpack 'fix-sbsms-check
(add-after 'unpack 'autoreconf
(lambda _ (lambda _
(zero? (system* "autoreconf" "-vfi"))))) ;; This check is wrong: there is no 2.2.0 release; not even the
;; bundled sources match this release string.
(substitute* '("m4/audacity_checklib_libsbsms.m4"
"configure")
(("sbsms >= 2.2.0") "sbsms >= 2.0.0"))
#t))
(add-after 'unpack 'use-upstream-headers
(lambda* (#:key inputs #:allow-other-keys)
(substitute* '("src/NoteTrack.cpp"
"src/AudioIO.cpp"
"src/AudioIO.h")
(("../lib-src/portmidi/pm_common/portmidi.h") "portmidi.h")
(("../lib-src/portmidi/porttime/porttime.h") "porttime.h"))
(substitute* "src/prefs/MidiIOPrefs.cpp"
(("../../lib-src/portmidi/pm_common/portmidi.h") "portmidi.h"))
#t)))
;; The test suite is not "well exercised" according to the developers, ;; The test suite is not "well exercised" according to the developers,
;; and fails with various errors. See ;; and fails with various errors. See
;; <http://sourceforge.net/p/audacity/mailman/message/33524292/>. ;; <http://sourceforge.net/p/audacity/mailman/message/33524292/>.

View file

@ -0,0 +1,64 @@
Downloaded from here:
https://sourceforge.net/p/audacity/mailman/message/36106562/
>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 a78bd1cab..d5481838d 100644
--- a/src/AudioIO.cpp
+++ b/src/AudioIO.cpp
@@ -452,8 +452,23 @@ writing audio.
#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"
+
+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
+}
+
#endif
#ifdef EXPERIMENTAL_AUTOMATED_INPUT_LEVEL_ADJUSTMENT
--
2.15.0