summary refs log tree commit diff
path: root/pkgs/applications/audio/audacity
diff options
context:
space:
mode:
authorPeter Hoeg <peter@speartail.com>2016-12-30 12:40:28 +0800
committerPeter Hoeg <peter@speartail.com>2017-01-02 20:24:12 +0800
commit858f8f27fa6433a0097fa7d365c55b84fda99439 (patch)
tree0b5b3ff68abaff2a1f4f6837b2330af0c246919f /pkgs/applications/audio/audacity
parentc311871a6d0a3f83a0cec3e6b8804a741b83dcb5 (diff)
downloadnixpkgs-858f8f27fa6433a0097fa7d365c55b84fda99439.tar
nixpkgs-858f8f27fa6433a0097fa7d365c55b84fda99439.tar.gz
nixpkgs-858f8f27fa6433a0097fa7d365c55b84fda99439.tar.bz2
nixpkgs-858f8f27fa6433a0097fa7d365c55b84fda99439.tar.lz
nixpkgs-858f8f27fa6433a0097fa7d365c55b84fda99439.tar.xz
nixpkgs-858f8f27fa6433a0097fa7d365c55b84fda99439.tar.zst
nixpkgs-858f8f27fa6433a0097fa7d365c55b84fda99439.zip
audacity: fix library path using NIX_LDFLAGS
Diffstat (limited to 'pkgs/applications/audio/audacity')
-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 cc96f6dbbb3..f91fc03ec01 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 ];
   };
 }