summary refs log tree commit diff
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2017-01-02 16:33:43 +0400
committerGitHub <noreply@github.com>2017-01-02 16:33:43 +0400
commit202e83585200d2e48a98b8183c178523cb9bf33b (patch)
treebdcaa28e341591267e31e48b022a90ac4a09fce3
parent820fa56ce0f04e638f32b427384fd7efd7d591e5 (diff)
parent858f8f27fa6433a0097fa7d365c55b84fda99439 (diff)
downloadnixlib-202e83585200d2e48a98b8183c178523cb9bf33b.tar
nixlib-202e83585200d2e48a98b8183c178523cb9bf33b.tar.gz
nixlib-202e83585200d2e48a98b8183c178523cb9bf33b.tar.bz2
nixlib-202e83585200d2e48a98b8183c178523cb9bf33b.tar.lz
nixlib-202e83585200d2e48a98b8183c178523cb9bf33b.tar.xz
nixlib-202e83585200d2e48a98b8183c178523cb9bf33b.tar.zst
nixlib-202e83585200d2e48a98b8183c178523cb9bf33b.zip
Merge pull request #21514 from peterhoeg/audacity
audacity: fix library path
-rw-r--r--pkgs/applications/audio/audacity/default.nix38
1 files changed, 31 insertions, 7 deletions
diff --git a/pkgs/applications/audio/audacity/default.nix b/pkgs/applications/audio/audacity/default.nix
index cc96f6dbbb31..f91fc03ec019 100644
--- a/pkgs/applications/audio/audacity/default.nix
+++ b/pkgs/applications/audio/audacity/default.nix
@@ -1,8 +1,10 @@
-{ stdenv, fetchurl, wxGTK30, pkgconfig, gettext, gtk2, glib, zlib, perl, intltool,
+{ stdenv, fetchurl, wxGTK30, pkgconfig, file, gettext, gtk2, glib, zlib, perl, intltool,
   libogg, libvorbis, libmad, libjack2, lv2, lilv, serd, sord, sratom, suil, alsaLib, libsndfile, soxr, flac, lame, fetchpatch,
   expat, libid3tag, ffmpeg, soundtouch /*, portaudio - given up fighting their portaudio.patch */
   }:
 
+with stdenv.lib;
+
 stdenv.mkDerivation rec {
   version = "2.1.2";
   name = "audacity-${version}";
@@ -23,12 +25,34 @@ stdenv.mkDerivation rec {
     mkdir lib-src
     mv lib-src-rm/{Makefile*,lib-widget-extra,portaudio-v19,portmixer,portsmf,FileDialog,sbsms,libnyquist} lib-src/
     rm -r lib-src-rm/
+
+    # we will get a (possibly harmless) warning during configure without this
+    substituteInPlace configure \
+      --replace /usr/bin/file ${file}/bin/file
   '';
 
-  configureFlags = [ "--with-libsamplerate" ];
+  configureFlags = [
+    "--with-libsamplerate"
+  ];
+
+  # audacity only looks for lame and ffmpeg at runtime, so we need to link them in manually
+  NIX_LDFLAGS = [
+    # LAME
+    "-lmp3lame"
+    # ffmpeg
+    "-lavcodec"
+    "-lavdevice"
+    "-lavfilter"
+    "-lavformat"
+    "-lavresample"
+    "-lavutil"
+    "-lpostproc"
+    "-lswresample"
+    "-lswscale"
+  ];
 
   buildInputs = [
-    pkgconfig gettext wxGTK30 expat alsaLib
+    pkgconfig file gettext wxGTK30 expat alsaLib
     libsndfile soxr libid3tag libjack2 lv2 lilv serd sord sratom suil gtk2
     ffmpeg libmad lame libvorbis flac soundtouch
   ]; #ToDo: detach sbsms
@@ -36,11 +60,11 @@ stdenv.mkDerivation rec {
   dontDisableStatic = true;
   doCheck = false; # Test fails
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "Sound editor with graphical UI";
     homepage = http://audacityteam.org/;
-    license = stdenv.lib.licenses.gpl2Plus;
-    platforms = with stdenv.lib.platforms; linux;
-    maintainers = with stdenv.lib.maintainers; [ the-kenny ];
+    license = licenses.gpl2Plus;
+    platforms = with platforms; linux;
+    maintainers = with maintainers; [ the-kenny ];
   };
 }