gnu: audacity: Update to 2.4.2.

* gnu/packages/audio.scm (audacity): Update to 2.4.2.
[source]: Add patch.  Don't delete portaudio-v19, since only the bundled copy
can be built.
[build-system]: Switch to cmake-build-system.
[inputs]: Remove portaudio.
[arguments]: Adjust configure flags for CMake.  Remove 'fix-sbsms-check
phase.  Add 'comment-out-revision-ident phase.
* gnu/local.mk (dist_patch_DATA): Register patch.
* gnu/packages/patches/audacity-add-include.patch: New file.
This commit is contained in:
Kei Kebreau 2020-12-09 16:54:26 -05:00
parent fc5f56eaf4
commit 3e6c114241
No known key found for this signature in database
GPG key ID: E6A5EE3C19467A0D
3 changed files with 36 additions and 55 deletions

View file

@ -803,6 +803,7 @@ dist_patch_DATA = \
%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/audacity-build-with-system-portaudio.patch \
%D%/packages/patches/audacity-add-include.patch \
%D%/packages/patches/audiofile-fix-datatypes-in-tests.patch \ %D%/packages/patches/audiofile-fix-datatypes-in-tests.patch \
%D%/packages/patches/audiofile-fix-sign-conversion.patch \ %D%/packages/patches/audiofile-fix-sign-conversion.patch \
%D%/packages/patches/audiofile-CVE-2015-7747.patch \ %D%/packages/patches/audiofile-CVE-2015-7747.patch \

View file

@ -676,7 +676,7 @@ (define-public ardour
(define-public audacity (define-public audacity
(package (package
(name "audacity") (name "audacity")
(version "2.4.1") (version "2.4.2")
(source (source
(origin (origin
(method git-fetch) (method git-fetch)
@ -686,8 +686,9 @@ (define-public audacity
(file-name (git-file-name name version)) (file-name (git-file-name name version))
(sha256 (sha256
(base32 (base32
"1xk0piv72d2xd3p7igr916fhcbrm76fhjr418k1rlqdzzg1hfljn")) "0lklcvqkxrr2gkb9gh3422iadzl2rv9v0a8s76rwq43lj2im7546"))
(patches (search-patches "audacity-build-with-system-portaudio.patch")) (patches (search-patches "audacity-build-with-system-portaudio.patch"
"audacity-add-include.patch"))
(modules '((guix build utils))) (modules '((guix build utils)))
(snippet (snippet
;; Remove bundled libraries. ;; Remove bundled libraries.
@ -697,7 +698,7 @@ (define-public audacity
(delete-file-recursively (string-append "lib-src/" dir))) (delete-file-recursively (string-append "lib-src/" dir)))
'("expat" "ffmpeg" "lame" "libflac" "libid3tag" "libmad" "libogg" '("expat" "ffmpeg" "lame" "libflac" "libid3tag" "libmad" "libogg"
"libsndfile" "libsoxr" "libvamp" "libvorbis" "lv2" "libsndfile" "libsoxr" "libvamp" "libvorbis" "lv2"
"portaudio-v19" "portmidi" "soundtouch" "twolame" "portmidi" "soundtouch" "twolame"
;; FIXME: these libraries have not been packaged yet: ;; FIXME: these libraries have not been packaged yet:
;; "libnyquist" ;; "libnyquist"
;; "libscorealign" ;; "libscorealign"
@ -711,7 +712,7 @@ (define-public audacity
;; "sbsms" ;; "sbsms"
)) ))
#t)))) #t))))
(build-system glib-or-gtk-build-system) (build-system cmake-build-system)
(inputs (inputs
`(("wxwidgets" ,wxwidgets) `(("wxwidgets" ,wxwidgets)
("gtk+" ,gtk+) ("gtk+" ,gtk+)
@ -733,7 +734,6 @@ (define-public audacity
("lv2" ,lv2) ("lv2" ,lv2)
("lilv" ,lilv) ;for lv2 ("lilv" ,lilv) ;for lv2
("suil" ,suil) ;for lv2 ("suil" ,suil) ;for lv2
("portaudio" ,portaudio)
("portmidi" ,portmidi))) ("portmidi" ,portmidi)))
(native-inputs (native-inputs
`(("autoconf" ,autoconf) `(("autoconf" ,autoconf)
@ -745,52 +745,18 @@ (define-public audacity
("which" ,which))) ("which" ,which)))
(arguments (arguments
`(#:configure-flags `(#:configure-flags
(let ((libid3tag (assoc-ref %build-inputs "libid3tag")) (list
(libmad (assoc-ref %build-inputs "libmad")) ;; Loading FFmpeg dynamically is problematic.
(portmidi (assoc-ref %build-inputs "portmidi"))) "-Daudacity_use_ffmpeg=linked"
(list "-Daudacity_use_lame=system"
;; Loading FFmpeg dynamically is problematic. "-Daudacity_use_portsmf=system")
"--disable-dynamic-loading"
;; SSE instructions are available on Intel systems only.
,@(if (any (cute string-prefix? <> (or (%current-target-system)
(%current-system)))
'("x86_64" "i686"))
'()
'("--enable-sse=no"))
;; portmidi, libid3tag and libmad provide no .pc files, so
;; pkg-config fails to find them. Force their inclusion.
(string-append "ID3TAG_CFLAGS=-I" libid3tag "/include")
(string-append "ID3TAG_LIBS=-L" libid3tag "/lib -lid3tag -lz")
(string-append "LIBMAD_CFLAGS=-I" libmad "/include")
(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
(add-after 'unpack 'fix-sbsms-check (add-after 'unpack 'comment-out-revision-ident
(lambda _ (lambda _
;; This check is wrong: there is no 2.2.0 release; not even the (substitute* "src/AboutDialog.cpp"
;; bundled sources match this release string. (("(.*RevisionIdent\\.h.*)" include-line)
(substitute* '("m4/audacity_checklib_libsbsms.m4" (string-append "// " include-line)))))
"configure")
(("sbsms >= 2.2.0") "sbsms >= 2.0.0"))
#t))
(add-after 'unpack 'use-upstream-headers (add-after 'unpack 'use-upstream-headers
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(substitute* '("src/NoteTrack.cpp" (substitute* '("src/NoteTrack.cpp"
@ -800,12 +766,11 @@ (define-public audacity
(("../lib-src/portmidi/pm_common/portmidi.h") "portmidi.h") (("../lib-src/portmidi/pm_common/portmidi.h") "portmidi.h")
(("../lib-src/portmidi/porttime/porttime.h") "porttime.h")) (("../lib-src/portmidi/porttime/porttime.h") "porttime.h"))
(substitute* "src/prefs/MidiIOPrefs.cpp" (substitute* "src/prefs/MidiIOPrefs.cpp"
(("../../lib-src/portmidi/pm_common/portmidi.h") "portmidi.h")) (("../../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/>. #:tests? #f))
#:tests? #f))
(home-page "https://www.audacityteam.org/") (home-page "https://www.audacityteam.org/")
(synopsis "Software for recording and editing sounds") (synopsis "Software for recording and editing sounds")
(description (description

View file

@ -0,0 +1,15 @@
Without <sys/time.h>, gettimeofday is undefined.
diff --git a/src/AudioIO.cpp b/src/AudioIO.cpp
index 0187e3962..e15d55f4c 100644
--- a/src/AudioIO.cpp
+++ b/src/AudioIO.cpp
@@ -479,6 +479,8 @@ time warp info and AudioIOListener and whether the playback is looped.
#include "../lib-src/portmidi/porttime/porttime.h"
#include "../lib-src/header-substitutes/allegro.h"
+#include <sys/time.h>
+
#define MIDI_SLEEP 10 /* milliseconds */
// how long do we think the thread that fills MIDI buffers,
// if it is separate from the portaudio thread,