Skip to content
Permalink
Browse files

audacity: 2.4.1 -> 2.4.2

A few other things:
 - use cmake instead of (the super slow) autotools
 - 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 (upstream has an open PR) that makes audacity follow XDG for file locations
  • Loading branch information
peterhoeg committed Sep 10, 2020
1 parent 6152513 commit 23b1062272d87dc059546a52a16ffd7d685dc704
Showing with 39 additions and 30 deletions.
  1. +38 −29 pkgs/applications/audio/audacity/default.nix
  2. +1 −1 pkgs/top-level/all-packages.nix
@@ -1,36 +1,41 @@
{ 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 */
autoconf, automake, libtool
}:
{ stdenv, lib, fetchFromGitHub, fetchpatch, cmake, wxGTK, pkgconfig, python3, gettext
, libvorbis, libmad, libjack2, lv2, lilv, serd, sord, sratom, suil, alsaLib, libsndfile, soxr, flac, twolame
, expat, libid3tag, 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=";
};

preConfigure = /* we prefer system-wide libs */ ''
autoreconf -vi # use system libraries
patches = [
(fetchpatch {
url = "https://github.com/audacity/audacity/commit/a070b5d8a8ba10fb86edba6aeb8fdab0f66ba408.patch";
sha256 = "sha256-8UZupGcN+/tytAhyy5T1P0nufvsQPeyLgOUMGt7l8Oc=";
name = "audacity_xdg_paths.patch"; })
];

# we will get a (possibly harmless) warning during configure without this
substituteInPlace configure \
--replace /usr/bin/file ${file}/bin/file
# this file *should* be generated by cmake but as of 2.4.2 isn't yet
postPatch = ''
touch src/RevisionIdent.h
'';

configureFlags = [
"--with-libsamplerate"
];
# 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 lame and ffmpeg at runtime, so we need to link them in manually
# audacity only looks for ffmpeg at runtime, so we need to link it in manually
NIX_LDFLAGS = toString [
# LAME
"-lmp3lame"
# ffmpeg
"-lavcodec"
"-lavdevice"
@@ -43,19 +48,23 @@ stdenv.mkDerivation rec {
"-lswscale"
];

nativeBuildInputs = [ pkgconfig autoconf automake libtool ];
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
nativeBuildInputs = [ cmake gettext pkgconfig python3 ];

enableParallelBuilding = true;
buildInputs = [
wxGTK wxGTK.gtk expat alsaLib
libsndfile soxr libid3tag libjack2 lv2 lilv serd sord sratom suil
ffmpeg libmad twolame libvorbis flac soundtouch pcre
] ++ lib.optionals stdenv.isLinux [
at-spi2-core dbus epoxy
libXdmcp libXtst libpthreadstubs libxkbcommon
libselinux libsepol utillinux
];

dontDisableStatic = true;

doCheck = false; # Test fails

meta = with stdenv.lib; {
meta = with lib; {
description = "Sound editor with graphical UI";
homepage = "https://www.audacityteam.org/";
license = licenses.gpl2Plus;
audacious = libsForQt5.callPackage ../applications/audio/audacious { };
audaciousQt5 = audacious;

audacity = callPackage ../applications/audio/audacity { };
audacity = callPackage ../applications/audio/audacity { wxGTK = wxGTK31-gtk2; };

audio-recorder = callPackage ../applications/audio/audio-recorder { };

0 comments on commit 23b1062

Please sign in to comment.
You can’t perform that action at this time.