Re: [PATCH] gnu: Add audacity.

2015-03-04 Thread Ludovic Courtès
taylanbayi...@gmail.com (Taylan Ulrich "Bayırlı/Kammer") skribis:

> l...@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?=
>  
> 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?=
>  
> 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’.



Re: [PATCH] gnu: Add audacity.

2015-03-03 Thread Taylan Ulrich Bayırlı/Kammer
l...@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

in the patch header.

Updated patches:

>From 9d3ae472c1c31400753bfe89ef5d612ba6998cab Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?=
 
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 000..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 .
+
+--- 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

Re: [PATCH] gnu: Add audacity.

2015-03-03 Thread Ludovic Courtès
taylanbayi...@gmail.com (Taylan Ulrich "Bayırlı/Kammer") skribis:

> l...@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?=
>  
> 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?=
>  
> 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?=
>  
> 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’.



Re: [PATCH] gnu: Add audacity.

2015-03-03 Thread Taylan Ulrich Bayırlı/Kammer
l...@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.

>From 3853b807f69fbd4b0cfe8116cc0d934c941df6aa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?=
 
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"))
+  

Re: [PATCH] gnu: Add audacity.

2015-02-27 Thread Ludovic Courtès
taylanbayi...@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?=
>  
> 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’.