all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] gnu: Add audacity.
@ 2015-02-22  0:13 Taylan Ulrich Bayırlı/Kammer
  2015-02-27 16:01 ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Taylan Ulrich Bayırlı/Kammer @ 2015-02-22  0:13 UTC (permalink / raw
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1096 bytes --]

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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 5670 bytes --]

From 82e8a7f2a708201ea7fd538580485546849347a3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?=
 <taylanbayirli@gmail.com>
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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] gnu: Add audacity.
  2015-02-22  0:13 [PATCH] gnu: Add audacity Taylan Ulrich Bayırlı/Kammer
@ 2015-02-27 16:01 ` Ludovic Courtès
  2015-03-03 13:10   ` Taylan Ulrich Bayırlı/Kammer
  0 siblings, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2015-02-27 16:01 UTC (permalink / raw
  To: Taylan Ulrich "Bayırlı/Kammer"; +Cc: guix-devel

taylanbayirli@gmail.com (Taylan Ulrich "Bayırlı/Kammer") skribis:

> 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.

That would be surprising.  Perhaps the Audacity developers were using a
distro that adds .pc files for these two libs?

> - 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.

Could you try to find out what the story of this function is?  It would
be best to avoid using the bundled PortAudio.

> - 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.

OK.

> - 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.

Perhaps that problem would magically vanish when using system’s
PortAudio because headers would be in $CPATH.

> From 82e8a7f2a708201ea7fd538580485546849347a3 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?=
>  <taylanbayirli@gmail.com>
> 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.

The rest of the patch looks good to me; just the PortAudio issue needs
to be resolved.

Perhaps Ricardo has an opinion?

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] gnu: Add audacity.
  2015-02-27 16:01 ` Ludovic Courtès
@ 2015-03-03 13:10   ` Taylan Ulrich Bayırlı/Kammer
  2015-03-03 20:37     ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Taylan Ulrich Bayırlı/Kammer @ 2015-03-03 13:10 UTC (permalink / raw
  To: Ludovic Courtès; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 2567 bytes --]

ludo@gnu.org (Ludovic Courtès) writes:

>> - 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.
>
> That would be surprising.  Perhaps the Audacity developers were using a
> distro that adds .pc files for these two libs?

Apparently Debian indeed adds .pc files.  I added patches to them to do
the same.

>> - 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.
>
> Could you try to find out what the story of this function is?  It would
> be best to avoid using the bundled PortAudio.

Apparently it's from a patch that has been waiting forever to be merged
into PortAudio and it's questionable whether it ever will.  I applied it
to our PortAudio package.

>> - 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.
>
> OK.

By the way this came out to be a known problem among Audacity folks.

>> - 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.
>
> Perhaps that problem would magically vanish when using system’s
> PortAudio because headers would be in $CPATH.

Indeed.  Sadly the test suite seems to have other issues, and I've been
told it isn't "well exercised" so I disabled it for now.  (FWIW it also
fails in the upcoming Audacity 2.1.0 which is now entering RC2 phase and
will be released soon.)

> The rest of the patch looks good to me; just the PortAudio issue needs
> to be resolved.

Updated patches below.

Note also it's in audacity.scm now and not audio.scm, because it depends
on ffmpeg, which is in video.scm, which now imports audio.scm, so
audio.scm cannot import video.scm.

We might want to just wait for 2.1.0 to be released by the way, since it
should be out in a couple days.  The FFmpeg dynamic loading and test
suite issues aren't resolved, so the only difference will be the
version; feel free to review this patch as if it were for 2.1.0.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch1 --]
[-- Type: text/x-diff, Size: 5022 bytes --]

From 3853b807f69fbd4b0cfe8116cc0d934c941df6aa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?=
 <taylanbayirli@gmail.com>
Date: Sun, 1 Mar 2015 21:52:23 +0100
Subject: [PATCH 1/3] gnu: mp3: Add .pc files to libmad and libid3tag.

* gnu/packages/mp3.scm (libmad, libid3tag): Add .pc files to installations.
* gnu/packages/patches/libid3tag-add-pc-file.patch: New file.
* gnu/packages/patches/libmad-add-pc-file.patch: New file.
* gnu-system.am (dist_patch_DATA): Add them.
---
 gnu-system.am                                    |  2 ++
 gnu/packages/mp3.scm                             | 25 +++++++++++++++++++++---
 gnu/packages/patches/libid3tag-add-pc-file.patch | 16 +++++++++++++++
 gnu/packages/patches/libmad-add-pc-file.patch    | 16 +++++++++++++++
 4 files changed, 56 insertions(+), 3 deletions(-)
 create mode 100644 gnu/packages/patches/libid3tag-add-pc-file.patch
 create mode 100644 gnu/packages/patches/libmad-add-pc-file.patch

diff --git a/gnu-system.am b/gnu-system.am
index da19b9b..7e9d06a 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -450,6 +450,8 @@ dist_patch_DATA =						\
   gnu/packages/patches/libcanberra-sound-theme-freedesktop.patch \
   gnu/packages/patches/libevent-dns-tests.patch			\
   gnu/packages/patches/liboop-mips64-deplibs-fix.patch		\
+  gnu/packages/patches/libid3tag-add-pc-file.patch		\
+  gnu/packages/patches/libmad-add-pc-file.patch			\
   gnu/packages/patches/libmad-mips-newgcc.patch			\
   gnu/packages/patches/librep-rules.mk.patch			\
   gnu/packages/patches/libtheora-config-guess.patch		\
diff --git a/gnu/packages/mp3.scm b/gnu/packages/mp3.scm
index 55ab4b4..229edc5 100644
--- a/gnu/packages/mp3.scm
+++ b/gnu/packages/mp3.scm
@@ -50,7 +50,8 @@
             (sha256
              (base32
               "14460zhacxhswnzb36qfpd1f2wbk10qvksvm6wyq5hpvdgnw7ymv"))
-            (patches (list (search-patch "libmad-mips-newgcc.patch")))))
+            (patches (list (search-patch "libmad-mips-newgcc.patch")
+                           (search-patch "libmad-add-pc-file.patch")))))
    (build-system gnu-build-system)
    (arguments
     `(#:phases
@@ -59,7 +60,14 @@
         (lambda _
           ;; remove option that is not supported by gcc any more
           (substitute* "configure" ((" -fforce-mem") "")))
-       %standard-phases)))
+        (alist-cons-after
+         'install 'install-pc-file
+         (lambda* (#:key outputs #:allow-other-keys)
+           (let* ((out (assoc-ref outputs "out"))
+                  (pc-dir (string-append out "/lib/pkgconfig")))
+             (mkdir-p pc-dir)
+             (copy-file "mad.pc" (string-append pc-dir "/mad.pc"))))
+         %standard-phases))))
    (synopsis "MPEG audio decoder")
    (description
     "MAD (MPEG Audio Decoder) supports MPEG-1 and the MPEG-2 extension to
@@ -82,9 +90,20 @@ This package contains the library.")
                                 version ".tar.gz"))
             (sha256
              (base32
-              "0lb1w883dc46dajbdvnia5870brl5lvnlk7g7y58y9wpg5p4znk3"))))
+              "0lb1w883dc46dajbdvnia5870brl5lvnlk7g7y58y9wpg5p4znk3"))
+            (patches (list (search-patch "libid3tag-add-pc-file.patch")))))
    (build-system gnu-build-system)
    (inputs `(("zlib" ,zlib)))
+   (arguments
+    '(#:phases
+      (alist-cons-after
+       'install 'install-pc-file
+       (lambda* (#:key outputs #:allow-other-keys)
+         (let* ((out (assoc-ref outputs "out"))
+                (pc-dir (string-append out "/lib/pkgconfig")))
+           (mkdir-p pc-dir)
+           (copy-file "id3tag.pc" (string-append pc-dir "/id3tag.pc"))))
+       %standard-phases)))
    (synopsis "Library for reading ID3 tags")
    (description
     "Libid3tag is a library for reading ID3 tags, both ID3v1 and the various
diff --git a/gnu/packages/patches/libid3tag-add-pc-file.patch b/gnu/packages/patches/libid3tag-add-pc-file.patch
new file mode 100644
index 0000000..4d23ba1
--- /dev/null
+++ b/gnu/packages/patches/libid3tag-add-pc-file.patch
@@ -0,0 +1,16 @@
+Notably, Audacity's ./configure script locates this library via pkg-config(1).
+
+--- a/id3tag.pc
++++ b/id3tag.pc
+@@ -0,0 +1,11 @@
++prefix=/usr
++exec_prefix=${prefix}
++libdir=${exec_prefix}/lib
++includedir=${prefix}/include
++
++Name: id3tag
++Description: ID3 tag reading library
++Requires:
++Version: 0.15.0b
++Libs: -L${libdir} -lid3tag -lz
++Cflags: -I${includedir}
diff --git a/gnu/packages/patches/libmad-add-pc-file.patch b/gnu/packages/patches/libmad-add-pc-file.patch
new file mode 100644
index 0000000..8a824f8
--- /dev/null
+++ b/gnu/packages/patches/libmad-add-pc-file.patch
@@ -0,0 +1,16 @@
+Notably, Audacity's ./configure script locates this library via pkg-config(1).
+
+--- a/mad.pc
++++ b/mad.pc
+@@ -0,0 +1,11 @@
++prefix=/usr
++exec_prefix=${prefix}
++libdir=${exec_prefix}/lib
++includedir=${prefix}/include
++
++Name: mad
++Description: MPEG Audio Decoder
++Requires:
++Version: 0.15.0b
++Libs: -L${libdir} -lmad
++Cflags: -I${includedir}
-- 
2.2.1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: patch2 --]
[-- Type: text/x-diff, Size: 13004 bytes --]

From fe095e3aebcaaa9e88587610832db3f65f7ec015 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?=
 <taylanbayirli@gmail.com>
Date: Mon, 2 Mar 2015 01:06:35 +0100
Subject: [PATCH 2/3] gnu: portaudio: Patch for Audacity compatibility.

* gnu/packages/audio.scm (portaudio): Add a patch for Audacity compatibility.
* gnu/packages/patches/portaudio-audacity-compat.patch: New file.
* gnu-system.am (dist_patch_DATA): Add it.
---
 gnu-system.am                                      |   1 +
 gnu/packages/audio.scm                             |  19 +-
 .../patches/portaudio-audacity-compat.patch        | 322 +++++++++++++++++++++
 3 files changed, 339 insertions(+), 3 deletions(-)
 create mode 100644 gnu/packages/patches/portaudio-audacity-compat.patch

diff --git a/gnu-system.am b/gnu-system.am
index 7e9d06a..6008897 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -495,6 +495,7 @@ dist_patch_DATA =						\
   gnu/packages/patches/pingus-sdl-libs-config.patch		\
   gnu/packages/patches/plotutils-libpng-jmpbuf.patch		\
   gnu/packages/patches/polkit-drop-test.patch			\
+  gnu/packages/patches/portaudio-audacity-compat.patch		\
   gnu/packages/patches/procps-make-3.82.patch			\
   gnu/packages/patches/pulseaudio-CVE-2014-3970.patch		\
   gnu/packages/patches/pulseaudio-fix-mult-test.patch		\
diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm
index 5a23618..bda173e 100644
--- a/gnu/packages/audio.scm
+++ b/gnu/packages/audio.scm
@@ -1005,15 +1005,28 @@ portions of LAME.")
              (string-map (lambda (c) (if (char=? c #\.) #\_ c)) version)
              ".tgz"))
        (sha256
-        (base32 "0mwddk4qzybaf85wqfhxqlf0c5im9il8z03rd4n127k8y2jj9q4g"))))
+        (base32 "0mwddk4qzybaf85wqfhxqlf0c5im9il8z03rd4n127k8y2jj9q4g"))
+       (patches (list (search-patch "portaudio-audacity-compat.patch")))))
     (build-system gnu-build-system)
     (inputs
      ;; TODO: Add ASIHPI.
      `(("alsa-lib" ,alsa-lib)
        ("jack" ,jack-2)))
     (native-inputs
-     `(("pkg-config" ,pkg-config)))
-    (arguments '(#:tests? #f))          ;no 'check' target
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("pkg-config" ,pkg-config)))
+    (arguments
+     '(#:phases
+       ;; Autoreconf is necessary because the audacity-compat patch modifies
+       ;; .in files.
+       (alist-cons-after
+        'unpack 'autoreconf
+        (lambda _
+          (zero? (system* "autoreconf" "-vif")))
+        %standard-phases)
+       #:tests? #f))                    ;no 'check' target
     (home-page "http://www.portaudio.com/")
     (synopsis "Audio I/O library")
     (description
diff --git a/gnu/packages/patches/portaudio-audacity-compat.patch b/gnu/packages/patches/portaudio-audacity-compat.patch
new file mode 100644
index 0000000..d864b44
--- /dev/null
+++ b/gnu/packages/patches/portaudio-audacity-compat.patch
@@ -0,0 +1,322 @@
+Description: Add features needed to make portmixer work with audacity.
+Author: Audacity Team
+Last-Update: 2011-12-07
+
+--- a/include/pa_win_ds.h
++++ b/include/pa_win_ds.h
+@@ -89,6 +89,21 @@
+ 
+ }PaWinDirectSoundStreamInfo;
+ 
++/** Retrieve the GUID of the input device.
++
++ @param stream The stream to query.
++
++ @return A pointer to the GUID, or NULL if none.
++*/
++LPGUID PaWinDS_GetStreamInputGUID( PaStream* s );
++
++/** Retrieve the GUID of the output device.
++
++ @param stream The stream to query.
++
++ @return A pointer to the GUID, or NULL if none.
++*/
++LPGUID PaWinDS_GetStreamOutputGUID( PaStream* s );
+ 
+ 
+ #ifdef __cplusplus
+--- a/include/portaudio.h
++++ b/include/portaudio.h
+@@ -1146,6 +1146,15 @@
+ signed long Pa_GetStreamWriteAvailable( PaStream* stream );
+ 
+ 
++/** Retrieve the host type handling an open stream.
++
++ @return Returns a non-negative value representing the host API type
++ handling an open stream or, a PaErrorCode (which are always negative)
++ if PortAudio is not initialized or an error is encountered.
++*/
++PaHostApiTypeId Pa_GetStreamHostApiType( PaStream* stream );
++
++
+ /* Miscellaneous utilities */
+ 
+ 
+--- /dev/null
++++ b/include/pa_unix_oss.h
+@@ -0,0 +1,104 @@
++#ifndef PA_UNIX_OSS_H
++#define PA_UNIX_OSS_H
++
++/*
++ * $Id: portaudio.patch,v 1.10 2009-06-30 04:52:59 llucius Exp $
++ * PortAudio Portable Real-Time Audio Library
++ * OSS-specific extensions
++ *
++ * Copyright (c) 1999-2000 Ross Bencina and Phil Burk
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining
++ * a copy of this software and associated documentation files
++ * (the "Software"), to deal in the Software without restriction,
++ * including without limitation the rights to use, copy, modify, merge,
++ * publish, distribute, sublicense, and/or sell copies of the Software,
++ * and to permit persons to whom the Software is furnished to do so,
++ * subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be
++ * included in all copies or substantial portions of the Software.
++ *
++ * Any person wishing to distribute modifications to the Software is
++ * requested to send the modifications to the original developer so that
++ * they can be incorporated into the canonical version.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
++ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
++ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
++ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++ *
++ */
++
++/** @file
++ * OSS-specific PortAudio API extension header file.
++ */
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++const char *PaOSS_GetStreamInputDevice( PaStream *s );
++
++const char *PaOSS_GetStreamOutputDevice( PaStream *s );
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif
++#ifndef PA_UNIX_OSS_H
++#define PA_UNIX_OSS_H
++
++/*
++ * $Id: portaudio.patch,v 1.10 2009-06-30 04:52:59 llucius Exp $
++ * PortAudio Portable Real-Time Audio Library
++ * OSS-specific extensions
++ *
++ * Copyright (c) 1999-2000 Ross Bencina and Phil Burk
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining
++ * a copy of this software and associated documentation files
++ * (the "Software"), to deal in the Software without restriction,
++ * including without limitation the rights to use, copy, modify, merge,
++ * publish, distribute, sublicense, and/or sell copies of the Software,
++ * and to permit persons to whom the Software is furnished to do so,
++ * subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be
++ * included in all copies or substantial portions of the Software.
++ *
++ * Any person wishing to distribute modifications to the Software is
++ * requested to send the modifications to the original developer so that
++ * they can be incorporated into the canonical version.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
++ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
++ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
++ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++ *
++ */
++
++/** @file
++ * OSS-specific PortAudio API extension header file.
++ */
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++const char *PaOSS_GetStreamInputDevice( PaStream *s );
++
++const char *PaOSS_GetStreamOutputDevice( PaStream *s );
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif
+--- a/src/common/pa_front.c
++++ b/src/common/pa_front.c
+@@ -1216,8 +1216,10 @@
+                                   hostApiInputParametersPtr, hostApiOutputParametersPtr,
+                                   sampleRate, framesPerBuffer, streamFlags, streamCallback, userData );
+ 
+-    if( result == paNoError )
++    if( result == paNoError ) {
+         AddOpenStream( *stream );
++        PA_STREAM_REP(*stream)->hostApiType = hostApi->info.type;
++    }
+ 
+ 
+     PA_LOGAPI(("Pa_OpenStream returned:\n" ));
+@@ -1729,6 +1731,32 @@
+     return result;
+ }
+ 
++PaHostApiTypeId Pa_GetStreamHostApiType( PaStream* stream )
++{
++    PaError error = PaUtil_ValidateStreamPointer( stream );
++    PaHostApiTypeId result;
++
++#ifdef PA_LOG_API_CALLS
++    PaUtil_DebugPrint("Pa_GetStreamHostApiType called:\n" );
++    PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream );
++#endif
++
++    if( error == paNoError )
++    {
++        result = PA_STREAM_REP(stream)->hostApiType;
++    }
++    else
++    {
++        result = (PaHostApiTypeId) error;
++    }
++
++#ifdef PA_LOG_API_CALLS
++    PaUtil_DebugPrint("Pa_GetStreamHostApiType returned:\n" );
++    PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) );
++#endif
++
++    return result;
++}
+ 
+ PaError Pa_GetSampleSize( PaSampleFormat format )
+ {
+--- a/src/common/pa_stream.c
++++ b/src/common/pa_stream.c
+@@ -93,6 +93,8 @@
+     streamRepresentation->streamInfo.inputLatency = 0.;
+     streamRepresentation->streamInfo.outputLatency = 0.;
+     streamRepresentation->streamInfo.sampleRate = 0.;
++
++    streamRepresentation->hostApiType = 0;
+ }
+ 
+ 
+--- a/src/common/pa_stream.h
++++ b/src/common/pa_stream.h
+@@ -152,6 +152,7 @@
+     PaStreamFinishedCallback *streamFinishedCallback;
+     void *userData;
+     PaStreamInfo streamInfo;
++    PaHostApiTypeId hostApiType;
+ } PaUtilStreamRepresentation;
+ 
+ 
+--- a/src/hostapi/coreaudio/pa_mac_core_blocking.c
++++ b/src/hostapi/coreaudio/pa_mac_core_blocking.c
+@@ -66,6 +66,9 @@
+ #ifdef MOSX_USE_NON_ATOMIC_FLAG_BITS
+ # define OSAtomicOr32( a, b ) ( (*(b)) |= (a) )
+ # define OSAtomicAnd32( a, b ) ( (*(b)) &= (a) )
++#elif MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_3
++# define OSAtomicOr32( a, b ) BitOrAtomic( a, (UInt32 *) b )
++# define OSAtomicAnd32( a, b ) BitAndAtomic( a, (UInt32 *) b )
+ #else
+ # include <libkern/OSAtomic.h>
+ #endif
+--- a/src/hostapi/alsa/pa_linux_alsa.c
++++ b/src/hostapi/alsa/pa_linux_alsa.c
+@@ -611,6 +611,7 @@
+     StreamDirection streamDir;
+ 
+     snd_pcm_channel_area_t *channelAreas;  /* Needed for channel adaption */
++    int card;
+ } PaAlsaStreamComponent;
+ 
+ /* Implementation specific stream structure */
+@@ -1806,6 +1807,7 @@
+ {
+     PaError result = paNoError;
+     PaSampleFormat userSampleFormat = params->sampleFormat, hostSampleFormat = paNoError;
++    snd_pcm_info_t* pcmInfo;
+     assert( params->channelCount > 0 );
+ 
+     /* Make sure things have an initial value */
+@@ -1826,6 +1828,9 @@
+     self->device = params->device;
+ 
+     PA_ENSURE( AlsaOpen( &alsaApi->baseHostApiRep, params, streamDir, &self->pcm ) );
++
++    snd_pcm_info_alloca( &pcmInfo );
++    self->card = snd_pcm_info_get_card( pcmInfo );
+     self->nfds = alsa_snd_pcm_poll_descriptors_count( self->pcm );
+ 
+     PA_ENSURE( hostSampleFormat = PaUtil_SelectClosestAvailableFormat( GetAvailableFormats( self->pcm ), userSampleFormat ) );
+@@ -4519,9 +4524,7 @@
+     /* XXX: More descriptive error? */
+     PA_UNLESS( stream->capture.pcm, paDeviceUnavailable );
+ 
+-    alsa_snd_pcm_info_alloca( &pcmInfo );
+-    PA_ENSURE( alsa_snd_pcm_info( stream->capture.pcm, pcmInfo ) );
+-    *card = alsa_snd_pcm_info_get_card( pcmInfo );
++    *card = stream->capture.card;
+ 
+ error:
+     return result;
+@@ -4537,9 +4540,7 @@
+     /* XXX: More descriptive error? */
+     PA_UNLESS( stream->playback.pcm, paDeviceUnavailable );
+ 
+-    alsa_snd_pcm_info_alloca( &pcmInfo );
+-    PA_ENSURE( alsa_snd_pcm_info( stream->playback.pcm, pcmInfo ) );
+-    *card = alsa_snd_pcm_info_get_card( pcmInfo );
++    *card = stream->playback.card;
+ 
+ error:
+     return result;
+--- a/src/hostapi/oss/pa_unix_oss.c
++++ b/src/hostapi/oss/pa_unix_oss.c
+@@ -2028,3 +2028,26 @@
+ #endif
+ }
+ 
++const char *PaOSS_GetStreamInputDevice( PaStream* s )
++{
++    PaOssStream *stream = (PaOssStream*)s;
++
++    if( stream->capture )
++    {
++      return stream->capture->devName;
++    }
++
++   return NULL;
++}
++
++const char *PaOSS_GetStreamOutputDevice( PaStream* s )
++{
++    PaOssStream *stream = (PaOssStream*)s;
++
++    if( stream->playback )
++    {
++      return stream->playback->devName;
++    }
++
++   return NULL;
++}
+--- a/configure.in
++++ b/configure.in
+@@ -365,6 +365,7 @@
+                    DLL_LIBS="$DLL_LIBS -lossaudio"
+                    LIBS="$LIBS -lossaudio"
+            fi
++           INCLUDES="$INCLUDES pa_unix_oss.h"
+            AC_DEFINE(PA_USE_OSS,1)
+         fi
+ 
-- 
2.2.1


[-- Attachment #4: patch3 --]
[-- Type: text/x-diff, Size: 6780 bytes --]

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

* gnu/packages/audacity.scm: New file.
* gnu-system.am (GNU_SYSTEM_MODULES): Add it.
* gnu/packages/patches/audacity-fix-ffmpeg-binding.patch: New file.
* gnu-system.am (dist_patch_DATA): Add it.
---
 gnu-system.am                                      |  2 +
 gnu/packages/audacity.scm                          | 92 ++++++++++++++++++++++
 .../patches/audacity-fix-ffmpeg-binding.patch      | 32 ++++++++
 3 files changed, 126 insertions(+)
 create mode 100644 gnu/packages/audacity.scm
 create mode 100644 gnu/packages/patches/audacity-fix-ffmpeg-binding.patch

diff --git a/gnu-system.am b/gnu-system.am
index 6008897..19e620c 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -38,6 +38,7 @@ GNU_SYSTEM_MODULES =				\
   gnu/packages/asciidoc.scm			\
   gnu/packages/aspell.scm			\
   gnu/packages/attr.scm				\
+  gnu/packages/audacity.scm			\
   gnu/packages/audio.scm			\
   gnu/packages/autogen.scm			\
   gnu/packages/autotools.scm			\
@@ -357,6 +358,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/audacity.scm b/gnu/packages/audacity.scm
new file mode 100644
index 0000000..ef62eb9
--- /dev/null
+++ b/gnu/packages/audacity.scm
@@ -0,0 +1,92 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages audacity)
+  #:use-module (guix packages)
+  #:use-module (guix download)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix build-system gnu)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages audio)
+  #:use-module (gnu packages gtk)
+  #:use-module (gnu packages linux)
+  #:use-module (gnu packages mp3)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages pulseaudio)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages xiph)
+  #:use-module (gnu packages xml)
+  #:use-module (gnu packages video)
+  #:use-module (gnu packages which)
+  #:use-module (gnu packages wxwidgets))
+
+(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 once they're packaged.  In-tree
+     ;; versions shipping with Audacity are used for now.
+     `(("wxwidgets" ,wxwidgets-2)
+       ("gtk" ,gtk+-2)
+       ("alsa-lib" ,alsa-lib)
+       ("jack" ,jack-2)
+       ("expat" ,expat)
+       ("ffmpeg" ,ffmpeg)
+       ("lame" ,lame)
+       ("flac" ,flac)
+       ("libid3tag" ,libid3tag)
+       ("libmad" ,libmad)
+       ("libsbsms" ,libsbsms)
+       ("libsndfile" ,libsndfile)
+       ("soundtouch" ,soundtouch)
+       ("soxr" ,soxr)                   ;replaces libsamplerate
+       ("twolame" ,twolame)
+       ("vamp" ,vamp)
+       ("libvorbis" ,libvorbis)
+       ("lv2" ,lv2)
+       ("lilv" ,lilv)
+       ("portaudio" ,portaudio)))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("python" ,python-2)
+       ("which" ,which)))
+    (arguments
+     ;; Loading FFmpeg dynamically is problematic.
+     '(#:configure-flags '("--disable-dynamic-loading")
+       ;; The test suite is not "well exercised" according to the developers,
+       ;; and fails with various errors.  See
+       ;; <http://sourceforge.net/p/audacity/mailman/message/33524292/>.
+       #: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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] gnu: Add audacity.
  2015-03-03 13:10   ` Taylan Ulrich Bayırlı/Kammer
@ 2015-03-03 20:37     ` Ludovic Courtès
  2015-03-03 22:33       ` Taylan Ulrich Bayırlı/Kammer
  0 siblings, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2015-03-03 20:37 UTC (permalink / raw
  To: Taylan Ulrich "Bayırlı/Kammer"; +Cc: guix-devel

taylanbayirli@gmail.com (Taylan Ulrich "Bayırlı/Kammer") skribis:

> ludo@gnu.org (Ludovic Courtès) writes:
>
>>> - 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.
>>
>> That would be surprising.  Perhaps the Audacity developers were using a
>> distro that adds .pc files for these two libs?
>
> Apparently Debian indeed adds .pc files.  I added patches to them to do
> the same.

Sorry for not being clear: I think we should avoid diverging from
upstream in this way, especially if there’s just one package that makes
the incorrect assumption.  So I would rather not add those .pc files.

If Audacity uses Autoconf and pkg.m4, I guess you could just pass
PKG_CONFIG=true as a configure flag, or {LIBID3TAG,LIBMAD}_{CFLAGS,LIBS}
and it will just work.

>>> - 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.
>>
>> Could you try to find out what the story of this function is?  It would
>> be best to avoid using the bundled PortAudio.
>
> Apparently it's from a patch that has been waiting forever to be merged
> into PortAudio and it's questionable whether it ever will.  I applied it
> to our PortAudio package.

OK.

(I’d normally recommend relying on upstream but in this case, if the
choice is between not having Audacity and adding this patch, I think the
latter makes more sense.)

>>> - 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.
>>
>> Perhaps that problem would magically vanish when using system’s
>> PortAudio because headers would be in $CPATH.
>
> Indeed.  Sadly the test suite seems to have other issues, and I've been
> told it isn't "well exercised" so I disabled it for now.  (FWIW it also
> fails in the upcoming Audacity 2.1.0 which is now entering RC2 phase and
> will be released soon.)

OK.

>> The rest of the patch looks good to me; just the PortAudio issue needs
>> to be resolved.
>
> Updated patches below.
>
> Note also it's in audacity.scm now and not audio.scm, because it depends
> on ffmpeg, which is in video.scm, which now imports audio.scm, so
> audio.scm cannot import video.scm.

It actually can, but it’s fine (and safer) the way you propose.  :-)

> We might want to just wait for 2.1.0 to be released by the way, since it
> should be out in a couple days.  The FFmpeg dynamic loading and test
> suite issues aren't resolved, so the only difference will be the
> version; feel free to review this patch as if it were for 2.1.0.

Your call!

> From 3853b807f69fbd4b0cfe8116cc0d934c941df6aa Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?=
>  <taylanbayirli@gmail.com>
> Date: Sun, 1 Mar 2015 21:52:23 +0100
> Subject: [PATCH 1/3] gnu: mp3: Add .pc files to libmad and libid3tag.
>
> * gnu/packages/mp3.scm (libmad, libid3tag): Add .pc files to installations.
> * gnu/packages/patches/libid3tag-add-pc-file.patch: New file.
> * gnu/packages/patches/libmad-add-pc-file.patch: New file.
> * gnu-system.am (dist_patch_DATA): Add them.

Rather no.

> From fe095e3aebcaaa9e88587610832db3f65f7ec015 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?=
>  <taylanbayirli@gmail.com>
> Date: Mon, 2 Mar 2015 01:06:35 +0100
> Subject: [PATCH 2/3] gnu: portaudio: Patch for Audacity compatibility.
>
> * gnu/packages/audio.scm (portaudio): Add a patch for Audacity compatibility.
> * gnu/packages/patches/portaudio-audacity-compat.patch: New file.
> * gnu-system.am (dist_patch_DATA): Add it.

[...]

> +++ b/gnu/packages/patches/portaudio-audacity-compat.patch
> @@ -0,0 +1,322 @@
> +Description: Add features needed to make portmixer work with audacity.
> +Author: Audacity Team
> +Last-Update: 2011-12-07

Could you add a link to PortAudio’s bug tracker or list?

Other than that OK.

> From b14e4eb8e276a2dd98c189c1edd18b7cc57dcb52 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?=
>  <taylanbayirli@gmail.com>
> Date: Fri, 20 Feb 2015 21:52:21 +0100
> Subject: [PATCH 3/3] gnu: Add audacity.
>
> * gnu/packages/audacity.scm: New file.
> * gnu-system.am (GNU_SYSTEM_MODULES): Add it.
> * gnu/packages/patches/audacity-fix-ffmpeg-binding.patch: New file.
> * gnu-system.am (dist_patch_DATA): Add it.

LGTM!

Apologies for the extra work.

Thank you!

Ludo’.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] gnu: Add audacity.
  2015-03-03 20:37     ` Ludovic Courtès
@ 2015-03-03 22:33       ` Taylan Ulrich Bayırlı/Kammer
  2015-03-04  9:48         ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Taylan Ulrich Bayırlı/Kammer @ 2015-03-03 22:33 UTC (permalink / raw
  To: Ludovic Courtès; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1594 bytes --]

ludo@gnu.org (Ludovic Courtès) writes:

> Sorry for not being clear: I think we should avoid diverging from
> upstream in this way, especially if there’s just one package that makes
> the incorrect assumption.  So I would rather not add those .pc files.

All clear.  (No worries; it was my idea to copy Debian's patches.)

> If Audacity uses Autoconf and pkg.m4, I guess you could just pass
> PKG_CONFIG=true as a configure flag, or {LIBID3TAG,LIBMAD}_{CFLAGS,LIBS}
> and it will just work.

The latter option seems to work.  (I suppose the former was meant to be
"PKG_CONFIG=false"?  That seems to break the whole library search.)
Updated patch is attached; please tell me if the style is correct.

>> Note also it's in audacity.scm now and not audio.scm, because it depends
>> on ffmpeg, which is in video.scm, which now imports audio.scm, so
>> audio.scm cannot import video.scm.
>
> It actually can, but it’s fine (and safer) the way you propose.  :-)

Does Guile support circular imports?  (video.scm imports audio.scm on
the meanwhile, in case I wasn't clear about that, so I think we'll have
to avoid importing video.scm from audio.scm.)

>> +++ b/gnu/packages/patches/portaudio-audacity-compat.patch
>> @@ -0,0 +1,322 @@
>> +Description: Add features needed to make portmixer work with audacity.
>> +Author: Audacity Team
>> +Last-Update: 2011-12-07
>
> Could you add a link to PortAudio’s bug tracker or list?

Added a link to
<http://music.columbia.edu/pipermail/portaudio/2015-March/016611.html>
in the patch header.

Updated patches:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch1 --]
[-- Type: text/x-diff, Size: 13083 bytes --]

From 9d3ae472c1c31400753bfe89ef5d612ba6998cab Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?=
 <taylanbayirli@gmail.com>
Date: Mon, 2 Mar 2015 01:06:35 +0100
Subject: [PATCH 1/2] gnu: portaudio: Patch for Audacity compatibility.

* gnu/packages/audio.scm (portaudio): Add a patch for Audacity compatibility.
* gnu/packages/patches/portaudio-audacity-compat.patch: New file.
* gnu-system.am (dist_patch_DATA): Add it.
---
 gnu-system.am                                      |   1 +
 gnu/packages/audio.scm                             |  19 +-
 .../patches/portaudio-audacity-compat.patch        | 324 +++++++++++++++++++++
 3 files changed, 341 insertions(+), 3 deletions(-)
 create mode 100644 gnu/packages/patches/portaudio-audacity-compat.patch

diff --git a/gnu-system.am b/gnu-system.am
index 0497fe1..33f3ae1 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -494,6 +494,7 @@ dist_patch_DATA =						\
   gnu/packages/patches/pingus-sdl-libs-config.patch		\
   gnu/packages/patches/plotutils-libpng-jmpbuf.patch		\
   gnu/packages/patches/polkit-drop-test.patch			\
+  gnu/packages/patches/portaudio-audacity-compat.patch		\
   gnu/packages/patches/procps-make-3.82.patch			\
   gnu/packages/patches/pulseaudio-CVE-2014-3970.patch		\
   gnu/packages/patches/pulseaudio-fix-mult-test.patch		\
diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm
index 5a23618..bda173e 100644
--- a/gnu/packages/audio.scm
+++ b/gnu/packages/audio.scm
@@ -1005,15 +1005,28 @@ portions of LAME.")
              (string-map (lambda (c) (if (char=? c #\.) #\_ c)) version)
              ".tgz"))
        (sha256
-        (base32 "0mwddk4qzybaf85wqfhxqlf0c5im9il8z03rd4n127k8y2jj9q4g"))))
+        (base32 "0mwddk4qzybaf85wqfhxqlf0c5im9il8z03rd4n127k8y2jj9q4g"))
+       (patches (list (search-patch "portaudio-audacity-compat.patch")))))
     (build-system gnu-build-system)
     (inputs
      ;; TODO: Add ASIHPI.
      `(("alsa-lib" ,alsa-lib)
        ("jack" ,jack-2)))
     (native-inputs
-     `(("pkg-config" ,pkg-config)))
-    (arguments '(#:tests? #f))          ;no 'check' target
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("pkg-config" ,pkg-config)))
+    (arguments
+     '(#:phases
+       ;; Autoreconf is necessary because the audacity-compat patch modifies
+       ;; .in files.
+       (alist-cons-after
+        'unpack 'autoreconf
+        (lambda _
+          (zero? (system* "autoreconf" "-vif")))
+        %standard-phases)
+       #:tests? #f))                    ;no 'check' target
     (home-page "http://www.portaudio.com/")
     (synopsis "Audio I/O library")
     (description
diff --git a/gnu/packages/patches/portaudio-audacity-compat.patch b/gnu/packages/patches/portaudio-audacity-compat.patch
new file mode 100644
index 0000000..9f239ad
--- /dev/null
+++ b/gnu/packages/patches/portaudio-audacity-compat.patch
@@ -0,0 +1,324 @@
+Description: Add features needed to make portmixer work with audacity.
+Author: Audacity Team
+Last-Update: 2011-12-07
+
+See <http://music.columbia.edu/pipermail/portaudio/2015-March/016611.html>.
+
+--- a/include/pa_win_ds.h
++++ b/include/pa_win_ds.h
+@@ -89,6 +89,21 @@
+ 
+ }PaWinDirectSoundStreamInfo;
+ 
++/** Retrieve the GUID of the input device.
++
++ @param stream The stream to query.
++
++ @return A pointer to the GUID, or NULL if none.
++*/
++LPGUID PaWinDS_GetStreamInputGUID( PaStream* s );
++
++/** Retrieve the GUID of the output device.
++
++ @param stream The stream to query.
++
++ @return A pointer to the GUID, or NULL if none.
++*/
++LPGUID PaWinDS_GetStreamOutputGUID( PaStream* s );
+ 
+ 
+ #ifdef __cplusplus
+--- a/include/portaudio.h
++++ b/include/portaudio.h
+@@ -1146,6 +1146,15 @@
+ signed long Pa_GetStreamWriteAvailable( PaStream* stream );
+ 
+ 
++/** Retrieve the host type handling an open stream.
++
++ @return Returns a non-negative value representing the host API type
++ handling an open stream or, a PaErrorCode (which are always negative)
++ if PortAudio is not initialized or an error is encountered.
++*/
++PaHostApiTypeId Pa_GetStreamHostApiType( PaStream* stream );
++
++
+ /* Miscellaneous utilities */
+ 
+ 
+--- /dev/null
++++ b/include/pa_unix_oss.h
+@@ -0,0 +1,104 @@
++#ifndef PA_UNIX_OSS_H
++#define PA_UNIX_OSS_H
++
++/*
++ * $Id: portaudio.patch,v 1.10 2009-06-30 04:52:59 llucius Exp $
++ * PortAudio Portable Real-Time Audio Library
++ * OSS-specific extensions
++ *
++ * Copyright (c) 1999-2000 Ross Bencina and Phil Burk
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining
++ * a copy of this software and associated documentation files
++ * (the "Software"), to deal in the Software without restriction,
++ * including without limitation the rights to use, copy, modify, merge,
++ * publish, distribute, sublicense, and/or sell copies of the Software,
++ * and to permit persons to whom the Software is furnished to do so,
++ * subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be
++ * included in all copies or substantial portions of the Software.
++ *
++ * Any person wishing to distribute modifications to the Software is
++ * requested to send the modifications to the original developer so that
++ * they can be incorporated into the canonical version.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
++ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
++ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
++ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++ *
++ */
++
++/** @file
++ * OSS-specific PortAudio API extension header file.
++ */
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++const char *PaOSS_GetStreamInputDevice( PaStream *s );
++
++const char *PaOSS_GetStreamOutputDevice( PaStream *s );
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif
++#ifndef PA_UNIX_OSS_H
++#define PA_UNIX_OSS_H
++
++/*
++ * $Id: portaudio.patch,v 1.10 2009-06-30 04:52:59 llucius Exp $
++ * PortAudio Portable Real-Time Audio Library
++ * OSS-specific extensions
++ *
++ * Copyright (c) 1999-2000 Ross Bencina and Phil Burk
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining
++ * a copy of this software and associated documentation files
++ * (the "Software"), to deal in the Software without restriction,
++ * including without limitation the rights to use, copy, modify, merge,
++ * publish, distribute, sublicense, and/or sell copies of the Software,
++ * and to permit persons to whom the Software is furnished to do so,
++ * subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be
++ * included in all copies or substantial portions of the Software.
++ *
++ * Any person wishing to distribute modifications to the Software is
++ * requested to send the modifications to the original developer so that
++ * they can be incorporated into the canonical version.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
++ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
++ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
++ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++ *
++ */
++
++/** @file
++ * OSS-specific PortAudio API extension header file.
++ */
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++const char *PaOSS_GetStreamInputDevice( PaStream *s );
++
++const char *PaOSS_GetStreamOutputDevice( PaStream *s );
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif
+--- a/src/common/pa_front.c
++++ b/src/common/pa_front.c
+@@ -1216,8 +1216,10 @@
+                                   hostApiInputParametersPtr, hostApiOutputParametersPtr,
+                                   sampleRate, framesPerBuffer, streamFlags, streamCallback, userData );
+ 
+-    if( result == paNoError )
++    if( result == paNoError ) {
+         AddOpenStream( *stream );
++        PA_STREAM_REP(*stream)->hostApiType = hostApi->info.type;
++    }
+ 
+ 
+     PA_LOGAPI(("Pa_OpenStream returned:\n" ));
+@@ -1729,6 +1731,32 @@
+     return result;
+ }
+ 
++PaHostApiTypeId Pa_GetStreamHostApiType( PaStream* stream )
++{
++    PaError error = PaUtil_ValidateStreamPointer( stream );
++    PaHostApiTypeId result;
++
++#ifdef PA_LOG_API_CALLS
++    PaUtil_DebugPrint("Pa_GetStreamHostApiType called:\n" );
++    PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream );
++#endif
++
++    if( error == paNoError )
++    {
++        result = PA_STREAM_REP(stream)->hostApiType;
++    }
++    else
++    {
++        result = (PaHostApiTypeId) error;
++    }
++
++#ifdef PA_LOG_API_CALLS
++    PaUtil_DebugPrint("Pa_GetStreamHostApiType returned:\n" );
++    PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) );
++#endif
++
++    return result;
++}
+ 
+ PaError Pa_GetSampleSize( PaSampleFormat format )
+ {
+--- a/src/common/pa_stream.c
++++ b/src/common/pa_stream.c
+@@ -93,6 +93,8 @@
+     streamRepresentation->streamInfo.inputLatency = 0.;
+     streamRepresentation->streamInfo.outputLatency = 0.;
+     streamRepresentation->streamInfo.sampleRate = 0.;
++
++    streamRepresentation->hostApiType = 0;
+ }
+ 
+ 
+--- a/src/common/pa_stream.h
++++ b/src/common/pa_stream.h
+@@ -152,6 +152,7 @@
+     PaStreamFinishedCallback *streamFinishedCallback;
+     void *userData;
+     PaStreamInfo streamInfo;
++    PaHostApiTypeId hostApiType;
+ } PaUtilStreamRepresentation;
+ 
+ 
+--- a/src/hostapi/coreaudio/pa_mac_core_blocking.c
++++ b/src/hostapi/coreaudio/pa_mac_core_blocking.c
+@@ -66,6 +66,9 @@
+ #ifdef MOSX_USE_NON_ATOMIC_FLAG_BITS
+ # define OSAtomicOr32( a, b ) ( (*(b)) |= (a) )
+ # define OSAtomicAnd32( a, b ) ( (*(b)) &= (a) )
++#elif MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_3
++# define OSAtomicOr32( a, b ) BitOrAtomic( a, (UInt32 *) b )
++# define OSAtomicAnd32( a, b ) BitAndAtomic( a, (UInt32 *) b )
+ #else
+ # include <libkern/OSAtomic.h>
+ #endif
+--- a/src/hostapi/alsa/pa_linux_alsa.c
++++ b/src/hostapi/alsa/pa_linux_alsa.c
+@@ -611,6 +611,7 @@
+     StreamDirection streamDir;
+ 
+     snd_pcm_channel_area_t *channelAreas;  /* Needed for channel adaption */
++    int card;
+ } PaAlsaStreamComponent;
+ 
+ /* Implementation specific stream structure */
+@@ -1806,6 +1807,7 @@
+ {
+     PaError result = paNoError;
+     PaSampleFormat userSampleFormat = params->sampleFormat, hostSampleFormat = paNoError;
++    snd_pcm_info_t* pcmInfo;
+     assert( params->channelCount > 0 );
+ 
+     /* Make sure things have an initial value */
+@@ -1826,6 +1828,9 @@
+     self->device = params->device;
+ 
+     PA_ENSURE( AlsaOpen( &alsaApi->baseHostApiRep, params, streamDir, &self->pcm ) );
++
++    snd_pcm_info_alloca( &pcmInfo );
++    self->card = snd_pcm_info_get_card( pcmInfo );
+     self->nfds = alsa_snd_pcm_poll_descriptors_count( self->pcm );
+ 
+     PA_ENSURE( hostSampleFormat = PaUtil_SelectClosestAvailableFormat( GetAvailableFormats( self->pcm ), userSampleFormat ) );
+@@ -4519,9 +4524,7 @@
+     /* XXX: More descriptive error? */
+     PA_UNLESS( stream->capture.pcm, paDeviceUnavailable );
+ 
+-    alsa_snd_pcm_info_alloca( &pcmInfo );
+-    PA_ENSURE( alsa_snd_pcm_info( stream->capture.pcm, pcmInfo ) );
+-    *card = alsa_snd_pcm_info_get_card( pcmInfo );
++    *card = stream->capture.card;
+ 
+ error:
+     return result;
+@@ -4537,9 +4540,7 @@
+     /* XXX: More descriptive error? */
+     PA_UNLESS( stream->playback.pcm, paDeviceUnavailable );
+ 
+-    alsa_snd_pcm_info_alloca( &pcmInfo );
+-    PA_ENSURE( alsa_snd_pcm_info( stream->playback.pcm, pcmInfo ) );
+-    *card = alsa_snd_pcm_info_get_card( pcmInfo );
++    *card = stream->playback.card;
+ 
+ error:
+     return result;
+--- a/src/hostapi/oss/pa_unix_oss.c
++++ b/src/hostapi/oss/pa_unix_oss.c
+@@ -2028,3 +2028,26 @@
+ #endif
+ }
+ 
++const char *PaOSS_GetStreamInputDevice( PaStream* s )
++{
++    PaOssStream *stream = (PaOssStream*)s;
++
++    if( stream->capture )
++    {
++      return stream->capture->devName;
++    }
++
++   return NULL;
++}
++
++const char *PaOSS_GetStreamOutputDevice( PaStream* s )
++{
++    PaOssStream *stream = (PaOssStream*)s;
++
++    if( stream->playback )
++    {
++      return stream->playback->devName;
++    }
++
++   return NULL;
++}
+--- a/configure.in
++++ b/configure.in
+@@ -365,6 +365,7 @@
+                    DLL_LIBS="$DLL_LIBS -lossaudio"
+                    LIBS="$LIBS -lossaudio"
+            fi
++           INCLUDES="$INCLUDES pa_unix_oss.h"
+            AC_DEFINE(PA_USE_OSS,1)
+         fi
+ 
-- 
2.2.1


[-- Attachment #3: patch2 --]
[-- Type: text/x-diff, Size: 7344 bytes --]

From 0fd1fcb065342aae81411dc62ca78fb0bc7e3afb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?=
 <taylanbayirli@gmail.com>
Date: Fri, 20 Feb 2015 21:52:21 +0100
Subject: [PATCH 2/2] gnu: Add audacity.

* gnu/packages/audacity.scm: New file.
* gnu-system.am (GNU_SYSTEM_MODULES): Add it.
* gnu/packages/patches/audacity-fix-ffmpeg-binding.patch: New file.
* gnu-system.am (dist_patch_DATA): Add it.
---
 gnu-system.am                                      |   2 +
 gnu/packages/audacity.scm                          | 102 +++++++++++++++++++++
 .../patches/audacity-fix-ffmpeg-binding.patch      |  32 +++++++
 3 files changed, 136 insertions(+)
 create mode 100644 gnu/packages/audacity.scm
 create mode 100644 gnu/packages/patches/audacity-fix-ffmpeg-binding.patch

diff --git a/gnu-system.am b/gnu-system.am
index 33f3ae1..eb5bba9 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -38,6 +38,7 @@ GNU_SYSTEM_MODULES =				\
   gnu/packages/asciidoc.scm			\
   gnu/packages/aspell.scm			\
   gnu/packages/attr.scm				\
+  gnu/packages/audacity.scm			\
   gnu/packages/audio.scm			\
   gnu/packages/autogen.scm			\
   gnu/packages/autotools.scm			\
@@ -358,6 +359,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/audacity.scm b/gnu/packages/audacity.scm
new file mode 100644
index 0000000..f12a2e8
--- /dev/null
+++ b/gnu/packages/audacity.scm
@@ -0,0 +1,102 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages audacity)
+  #:use-module (guix packages)
+  #:use-module (guix download)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix build-system gnu)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages audio)
+  #:use-module (gnu packages gtk)
+  #:use-module (gnu packages linux)
+  #:use-module (gnu packages mp3)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages pulseaudio)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages xiph)
+  #:use-module (gnu packages xml)
+  #:use-module (gnu packages video)
+  #:use-module (gnu packages which)
+  #:use-module (gnu packages wxwidgets))
+
+(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 once they're packaged.  In-tree
+     ;; versions shipping with Audacity are used for now.
+     `(("wxwidgets" ,wxwidgets-2)
+       ("gtk" ,gtk+-2)
+       ("alsa-lib" ,alsa-lib)
+       ("jack" ,jack-2)
+       ("expat" ,expat)
+       ("ffmpeg" ,ffmpeg)
+       ("lame" ,lame)
+       ("flac" ,flac)
+       ("libid3tag" ,libid3tag)
+       ("libmad" ,libmad)
+       ("libsbsms" ,libsbsms)
+       ("libsndfile" ,libsndfile)
+       ("soundtouch" ,soundtouch)
+       ("soxr" ,soxr)                   ;replaces libsamplerate
+       ("twolame" ,twolame)
+       ("vamp" ,vamp)
+       ("libvorbis" ,libvorbis)
+       ("lv2" ,lv2)
+       ("lilv" ,lilv)
+       ("portaudio" ,portaudio)))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("python" ,python-2)
+       ("which" ,which)))
+    (arguments
+     '(#:configure-flags
+       (let ((libid3tag (assoc-ref %build-inputs "libid3tag"))
+             (libmad (assoc-ref %build-inputs "libmad")))
+         (list
+          ;; Loading FFmpeg dynamically is problematic.
+          "--disable-dynamic-loading"
+          ;; 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")))
+       ;; The test suite is not "well exercised" according to the developers,
+       ;; and fails with various errors.  See
+       ;; <http://sourceforge.net/p/audacity/mailman/message/33524292/>.
+       #: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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] gnu: Add audacity.
  2015-03-03 22:33       ` Taylan Ulrich Bayırlı/Kammer
@ 2015-03-04  9:48         ` Ludovic Courtès
  0 siblings, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2015-03-04  9:48 UTC (permalink / raw
  To: Taylan Ulrich "Bayırlı/Kammer"; +Cc: guix-devel

taylanbayirli@gmail.com (Taylan Ulrich "Bayırlı/Kammer") skribis:

> ludo@gnu.org (Ludovic Courtès) writes:

[...]

>> If Audacity uses Autoconf and pkg.m4, I guess you could just pass
>> PKG_CONFIG=true as a configure flag, or {LIBID3TAG,LIBMAD}_{CFLAGS,LIBS}
>> and it will just work.
>
> The latter option seems to work.  (I suppose the former was meant to be
> "PKG_CONFIG=false"?  That seems to break the whole library search.)

I mean ‘true’ but there were chances of breakage as you noticed.

>>> Note also it's in audacity.scm now and not audio.scm, because it depends
>>> on ffmpeg, which is in video.scm, which now imports audio.scm, so
>>> audio.scm cannot import video.scm.
>>
>> It actually can, but it’s fine (and safer) the way you propose.  :-)
>
> Does Guile support circular imports?  (video.scm imports audio.scm on
> the meanwhile, in case I wasn't clear about that, so I think we'll have
> to avoid importing video.scm from audio.scm.)

Modules A and B can import each other iff:

  1. no top-level expressions from one module refer to bindings of the
     other module;

  2. neither A nor B #:selects bindings from the other.

> From 9d3ae472c1c31400753bfe89ef5d612ba6998cab Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?=
>  <taylanbayirli@gmail.com>
> Date: Mon, 2 Mar 2015 01:06:35 +0100
> Subject: [PATCH 1/2] gnu: portaudio: Patch for Audacity compatibility.
>
> * gnu/packages/audio.scm (portaudio): Add a patch for Audacity compatibility.
> * gnu/packages/patches/portaudio-audacity-compat.patch: New file.
> * gnu-system.am (dist_patch_DATA): Add it.

OK.

> From 0fd1fcb065342aae81411dc62ca78fb0bc7e3afb Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?=
>  <taylanbayirli@gmail.com>
> Date: Fri, 20 Feb 2015 21:52:21 +0100
> Subject: [PATCH 2/2] gnu: Add audacity.
>
> * gnu/packages/audacity.scm: New file.
> * gnu-system.am (GNU_SYSTEM_MODULES): Add it.
> * gnu/packages/patches/audacity-fix-ffmpeg-binding.patch: New file.
> * gnu-system.am (dist_patch_DATA): Add it.

OK as well.

Thank you!

Ludo’.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-03-04  9:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-22  0:13 [PATCH] gnu: Add audacity Taylan Ulrich Bayırlı/Kammer
2015-02-27 16:01 ` Ludovic Courtès
2015-03-03 13:10   ` Taylan Ulrich Bayırlı/Kammer
2015-03-03 20:37     ` Ludovic Courtès
2015-03-03 22:33       ` Taylan Ulrich Bayırlı/Kammer
2015-03-04  9:48         ` Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.