summary refs log tree commit diff
path: root/pkgs/applications/audio/audacity
diff options
context:
space:
mode:
authorPeter Hoeg <peter@hoeg.com>2020-09-07 23:48:50 +0800
committerPeter Hoeg <peter@hoeg.com>2021-01-16 18:27:31 +0800
commit249db9f8a74ed32f93b25ba5dd17503e4ca96fb2 (patch)
tree6cf9eb1442513ad0d28b3762e47569fd58c81712 /pkgs/applications/audio/audacity
parentd3afdf90dbb2883fa891476435e45981643efed3 (diff)
downloadnixpkgs-249db9f8a74ed32f93b25ba5dd17503e4ca96fb2.tar
nixpkgs-249db9f8a74ed32f93b25ba5dd17503e4ca96fb2.tar.gz
nixpkgs-249db9f8a74ed32f93b25ba5dd17503e4ca96fb2.tar.bz2
nixpkgs-249db9f8a74ed32f93b25ba5dd17503e4ca96fb2.tar.lz
nixpkgs-249db9f8a74ed32f93b25ba5dd17503e4ca96fb2.tar.xz
nixpkgs-249db9f8a74ed32f93b25ba5dd17503e4ca96fb2.tar.zst
nixpkgs-249db9f8a74ed32f93b25ba5dd17503e4ca96fb2.zip
audacity: 2.4.1 -> 2.4.2
A few other things:
 - prep for transition to gtk3 when audacity recommends it
 - we drop the runtime linking with lame as audacity is picking it up on
   its own
 - on linux, add a number of missing dependencies.
 - use a newer (recommended) wxwidgets
 - add a patch (merged upstream) that makes audacity follow XDG for file locations
Diffstat (limited to 'pkgs/applications/audio/audacity')
-rw-r--r--pkgs/applications/audio/audacity/default.nix122
1 files changed, 102 insertions, 20 deletions
diff --git a/pkgs/applications/audio/audacity/default.nix b/pkgs/applications/audio/audacity/default.nix
index 1f5468f7db3..c3daee55fc4 100644
--- a/pkgs/applications/audio/audacity/default.nix
+++ b/pkgs/applications/audio/audacity/default.nix
@@ -1,28 +1,79 @@
-{ lib, stdenv, fetchzip, wxGTK30, pkgconfig, file, gettext,
-  libvorbis, libmad, libjack2, lv2, lilv, serd, sord, sratom, suil, alsaLib, libsndfile, soxr, flac, lame,
-  expat, libid3tag, ffmpeg_3, soundtouch, /*, portaudio - given up fighting their portaudio.patch */
-  cmake
+{ stdenv
+, lib
+, fetchFromGitHub
+, fetchpatch
+, cmake
+, wxGTK
+, pkg-config
+, python3
+, gettext
+, file
+, libvorbis
+, libmad
+, libjack2
+, lv2
+, lilv
+, serd
+, sord
+, sratom
+, suil
+, alsaLib
+, libsndfile
+, soxr
+, flac
+, twolame
+, expat
+, libid3tag
+, libopus
+, ffmpeg
+, soundtouch
+, pcre /*, portaudio - given up fighting their portaudio.patch */
+, at-spi2-core ? null
+, dbus ? null
+, epoxy ? null
+, libXdmcp ? null
+, libXtst ? null
+, libpthreadstubs ? null
+, libselinux ? null
+, libsepol ? null
+, libxkbcommon ? null
+, utillinux ? null
 }:
 
-with stdenv.lib;
+# TODO
+# - as of 2.4.2, GTK2 is still the recommended version ref https://www.audacityteam.org/download/source/ check if that changes in future versions
+# - detach sbsms
 
 stdenv.mkDerivation rec {
-  version = "2.4.1";
   pname = "audacity";
+  version = "2.4.2";
 
-  src = fetchzip {
-    url = "https://github.com/audacity/audacity/archive/Audacity-${version}.tar.gz";
-    sha256 = "1xk0piv72d2xd3p7igr916fhcbrm76fhjr418k1rlqdzzg1hfljn";
+  src = fetchFromGitHub {
+    owner = "audacity";
+    repo = "audacity";
+    rev = "Audacity-${version}";
+    sha256 = "sha256-hpRTo5B0EMyzORopsNPOgv6mohBkwJfWfCLnPvFmdFI=";
   };
 
-  cmakeFlags = [
-    "-DCMAKE_BUILD_TYPE=Release"
+  patches = [
+    (fetchpatch {
+      url = "https://github.com/audacity/audacity/commit/a070b5d8a8ba10fb86edba6aeb8fdab0f66ba408.patch";
+      sha256 = "sha256-8UZupGcN+/tytAhyy5T1P0nufvsQPeyLgOUMGt7l8Oc=";
+      name = "audacity_xdg_paths.patch";
+    })
   ];
 
-  # audacity only looks for lame and ffmpeg at runtime, so we need to link them in manually
+  # this file *should* be generated by cmake but as of 2.4.2 isn't yet
+  postPatch = ''
+    touch src/RevisionIdent.h
+  '';
+
+  # workaround for a broken cmake. Drop it with a later version to see if it works.
+  # https://github.com/NixOS/nixpkgs/issues/94905
+  cmakeFlags = lib.optional stdenv.isLinux "-DCMAKE_OSX_ARCHITECTURES=";
+
+  # audacity only looks for ffmpeg at runtime, so we need to link it in manually
   NIX_LDFLAGS = toString [
-    # LAME
-    "-lmp3lame"
     # ffmpeg
     "-lavcodec"
     "-lavdevice"
@@ -35,14 +86,45 @@ stdenv.mkDerivation rec {
     "-lswscale"
   ];
 
-  nativeBuildInputs = [ pkgconfig cmake ];
+  nativeBuildInputs = [ cmake gettext pkg-config python3 ];
+
   buildInputs = [
-    file gettext wxGTK30 expat alsaLib
-    libsndfile soxr libid3tag libjack2 lv2 lilv serd sord sratom suil wxGTK30.gtk
-    ffmpeg_3 libmad lame libvorbis flac soundtouch
-  ]; #ToDo: detach sbsms
+    alsaLib
+    expat
+    ffmpeg
+    file
+    flac
+    libid3tag
+    libjack2
+    libmad
+    libopus
+    libsndfile
+    libvorbis
+    lilv
+    lv2
+    pcre
+    serd
+    sord
+    soundtouch
+    soxr
+    sratom
+    suil
+    twolame
+    wxGTK
+    wxGTK.gtk
+  ] ++ lib.optionals stdenv.isLinux [
+    at-spi2-core
+    dbus
+    epoxy
+    libXdmcp
+    libXtst
+    libpthreadstubs
+    libxkbcommon
+    libselinux
+    libsepol
+    utillinux
+  ];
 
-  dontDisableStatic = true;
   doCheck = false; # Test fails
 
   meta = with lib; {