guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] gnu: Add audacity.


From: Taylan Ulrich Bayırlı/Kammer
Subject: [PATCH] gnu: Add audacity.
Date: Sun, 22 Feb 2015 01:13:57 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Several weird issues with this one:

- It tries to find libid3tag and libmad via pkg-config even though they
  don't install .pc files.  Perhaps we can generate them manually in the
  install phase of those packages, or maybe they just don't get
  installed due to a bug.  Perhaps they just need 'pkg-config' as an
  input?  I might try that next.

- Audacity apparently uses PortAudio version 19, but the in-tree one has
  a function which the upstream one doesn't.  It would be strange if
  they had an API change without changing the version, so no idea what's
  going on there.

- Dynamic loading of FFmpeg fails and I couldn't figure out why (it
  didn't print any errors when I ran Audacity and normally it's pretty
  verbose) so I just passed --disable-dynamic-loading and it was fine.

- The test suite fails due to some missing portaudio.h file.  I didn't
  come far trying to figure out why this happens so I just disabled the
  test suite.

I might try looking into all these further, but they aren't critical to
Audacity's working.  Decoding MP3 works fine without libmad/libid3tag.

>From 82e8a7f2a708201ea7fd538580485546849347a3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?=
 <address@hidden>
Date: Fri, 20 Feb 2015 21:52:21 +0100
Subject: [PATCH 9/9] gnu: Add audacity.

* gnu/packages/audio.scm (audacity): New variable.
* gnu/packages/patches/audacity-fix-ffmpeg-binding.patch: New file.
* gnu-system.am (dist_patch_DATA): Add it.
---
 gnu-system.am                                      |  1 +
 gnu/packages/audio.scm                             | 71 ++++++++++++++++++++++
 .../patches/audacity-fix-ffmpeg-binding.patch      | 32 ++++++++++
 3 files changed, 104 insertions(+)
 create mode 100644 gnu/packages/patches/audacity-fix-ffmpeg-binding.patch

diff --git a/gnu-system.am b/gnu-system.am
index 3eb7893..78e235f 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -355,6 +355,7 @@ dist_patch_DATA =                                           
\
   gnu/packages/patches/ath9k-htc-firmware-binutils.patch       \
   gnu/packages/patches/ath9k-htc-firmware-gcc.patch            \
   gnu/packages/patches/ath9k-htc-firmware-objcopy.patch                \
+  gnu/packages/patches/audacity-fix-ffmpeg-binding.patch       \
   gnu/packages/patches/automake-skip-amhello-tests.patch       \
   gnu/packages/patches/avahi-localstatedir.patch               \
   gnu/packages/patches/avrdude-fix-libusb.patch                        \
diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm
index 9e24dc8..917ffa9 100644
--- a/gnu/packages/audio.scm
+++ b/gnu/packages/audio.scm
@@ -47,6 +47,8 @@
   #:use-module (gnu packages file)
   #:use-module (gnu packages cmake)
   #:use-module (gnu packages which)
+  #:use-module (gnu packages wxwidgets)
+  #:use-module (gnu packages video)
   #:use-module (srfi srfi-1))
 
 (define-public aubio
@@ -817,3 +819,72 @@ portions of LAME.")
 to record and/or play sound using a callback function or a blocking read/write
 interface.")
     (license license:expat)))
+
+(define-public audacity
+  (package
+    (name "audacity")
+    (version "2.0.6")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append
+         "mirror://sourceforge/audacity/audacity-minsrc-" version ".tar.xz"))
+       (sha256
+        (base32 "0yvxlfgjwdn7rvjrkr2wdg6xlwn5j3lwcdhsjs1ddq3qws8c301h"))
+       (patches (list (search-patch "audacity-fix-ffmpeg-binding.patch")))))
+    (build-system gnu-build-system)
+    (inputs
+     ;; TODO: Add portSMF and libwidgetextra.  (In-tree versions of these are
+     ;; used when an external version isn't found.)
+     `(("wxwidgets" ,wxwidgets-2)
+       ("gtk" ,gtk+-2)
+       ("alsa-lib" ,alsa-lib)
+       ("jack" ,jack-2)
+       ("expat" ,expat)
+       ("ffmpeg" ,ffmpeg)
+       ("lame" ,lame)
+       ("flac" ,flac)
+       ;; XXX These two aren't detected by ./configure because they don't
+       ;; install .pc files.
+       ;; ("libid3tag" ,libid3tag)
+       ;; ("libmad" ,libmad)
+       ("libsbsms" ,libsbsms)
+       ("libsndfile" ,libsndfile)
+       ("soundtouch" ,soundtouch)
+       ("soxr" ,soxr)                   ;replaces libsamplerate
+       ("twolame" ,twolame)
+       ("vamp" ,vamp)
+       ("libvorbis" ,libvorbis)
+       ("lv2" ,lv2)
+       ("lilv" ,lilv)
+       ;; XXX ./configure rejects this because it can't find
+       ;; `Pa_GetStreamHostApiType' in it.  An in-tree version is used though.
+       ;; ("portaudio" ,portaudio)
+       ))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("python" ,python-2)
+       ("which" ,which)))
+    (arguments
+     '(#:phases
+       (alist-cons-before
+        'check 'fix-missing-check-target
+        (lambda _
+          (substitute* '("lib-src/portaudio-v19/Makefile")
+            ;; Just put the line somewhere suitable.
+            (("^install: " all)
+             (string-append "check:\n\n" all))))
+        %standard-phases)
+       ;; Loading FFmpeg dynamically fails for some reason.
+       #:configure-flags '("--disable-dynamic-loading")
+       ;; XXX Tests fail with "portaudio.h: No such file or directory" even
+       ;; though the in-tree portaudio version is used.
+       #:tests? #f))
+    (home-page "http://audacity.sourceforge.net/";)
+    (synopsis "Software for recording and editing sounds")
+    (description
+     "Audacity is a multi-track audio editor designed for recording, playing
+and editing digital audio.  It features digital effects and spectrum analysis
+tools.")
+    (license license:gpl2+)))
diff --git a/gnu/packages/patches/audacity-fix-ffmpeg-binding.patch 
b/gnu/packages/patches/audacity-fix-ffmpeg-binding.patch
new file mode 100644
index 0000000..d6d6533
--- /dev/null
+++ b/gnu/packages/patches/audacity-fix-ffmpeg-binding.patch
@@ -0,0 +1,32 @@
+This resolves some "declaration of C function conflicts with previous
+declaration" errors during compilation.
+
+--- a/src/FFmpeg.h     2015-02-21 00:33:33.853857529 +0100
++++ b/src/FFmpeg.h     2015-02-21 00:35:09.626497205 +0100
+@@ -688,7 +688,7 @@
+    FFMPEG_FUNCTION_WITH_RETURN(
+       AVOutputFormat*,
+       av_oformat_next,
+-      (AVOutputFormat *f),
++      (const AVOutputFormat *f),
+       (f)
+    );
+    FFMPEG_FUNCTION_WITH_RETURN(
+@@ -755,7 +755,7 @@
+    FFMPEG_FUNCTION_WITH_RETURN(
+       int,
+       av_fifo_size,
+-      (AVFifoBuffer *f),
++      (const AVFifoBuffer *f),
+       (f)
+    );
+    FFMPEG_FUNCTION_WITH_RETURN(
+@@ -801,7 +801,7 @@
+    FFMPEG_FUNCTION_WITH_RETURN(
+       AVDictionaryEntry *,
+       av_dict_get,
+-      (AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int 
flags),
++      (const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, 
int flags),
+       (m, key, prev, flags)
+    );
+    FFMPEG_FUNCTION_WITH_RETURN(
-- 
2.2.1


reply via email to

[Prev in Thread] Current Thread [Next in Thread]