Unverified Commit 8abe0270 authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

Merge pull request #194937 from wegank/audacity-3.2.1

parents f5802f49 4836d085
Loading
Loading
Loading
Loading
+36 −42
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@
, libjack2
, lv2
, lilv
, mpg123
, serd
, sord
, sqlite
@@ -45,52 +46,36 @@
, libsepol
, libxkbcommon
, util-linux
, wxGTK
, wavpack
, wxGTK32
, gtk3
, libpng
, libjpeg
, AppKit ? null
, AudioToolbox ? null
, AudioUnit ? null
, Carbon ? null
, Cocoa ? null
, CoreAudio ? null
, CoreAudioKit ? null
, CoreServices ? null
, wxmac
, AppKit
, AudioToolbox
, AudioUnit
, Carbon
, CoreAudio
, CoreAudioKit
, CoreServices
}:

# TODO
# 1. as of 3.0.2, GTK2 is still the recommended version ref https://www.audacityteam.org/download/source/ check if that changes in future versions
# 2. detach sbsms
# 1. detach sbsms

let
  inherit (lib) optionals;
  pname = "audacity";
  version = "3.1.3";

  wxWidgets_src = fetchFromGitHub {
    owner = pname;
    repo = "wxWidgets";
    rev = "v${version}-${pname}";
    sha256 = "sha256-KrmYYv23DHBYKIuxMYBioCQ2e4KWdgmuREnimtm0XNU=";
    fetchSubmodules = true;
  };

  wxGTK' = wxGTK.overrideAttrs (oldAttrs: rec {
    src = wxWidgets_src;
  });

  wxmac' = wxmac.overrideAttrs (oldAttrs: rec {
    src = wxWidgets_src;
  });
in stdenv.mkDerivation rec {
  version = "3.2.1";
in
stdenv.mkDerivation rec {
  inherit pname version;

  src = fetchFromGitHub {
    owner = pname;
    repo = pname;
    rev = "Audacity-${version}";
    sha256 = "sha256-sdI4paxIHDZgoWTCekjrkFR4JFpQC6OatcnJdVXCCZk=";
    sha256 = "sha256-7rfttp9LnfM2LBT5seupPyDckS7LEzWDZoqtLsGgqgI=";
  };

  postPatch = ''
@@ -105,9 +90,9 @@ in stdenv.mkDerivation rec {
    gettext
    pkg-config
    python3
    makeWrapper
  ] ++ optionals stdenv.isLinux [
    linuxHeaders
    makeWrapper
  ];

  buildInputs = [
@@ -115,6 +100,7 @@ in stdenv.mkDerivation rec {
    ffmpeg_4
    file
    flac
    gtk3
    lame
    libid3tag
    libjack2
@@ -125,6 +111,7 @@ in stdenv.mkDerivation rec {
    libvorbis
    lilv
    lv2
    mpg123
    pcre
    portmidi
    serd
@@ -136,6 +123,8 @@ in stdenv.mkDerivation rec {
    suil
    twolame
    portaudio
    wavpack
    wxGTK32
  ] ++ optionals stdenv.isLinux [
    alsa-lib # for portaudio
    at-spi2-core
@@ -149,12 +138,8 @@ in stdenv.mkDerivation rec {
    libsepol
    libuuid
    util-linux
    wxGTK'
    wxGTK'.gtk
  ] ++ optionals stdenv.isDarwin [
    wxmac'
    AppKit
    Cocoa
    CoreAudioKit
    AudioUnit AudioToolbox CoreAudio CoreServices Carbon # for portaudio
    libpng
@@ -167,22 +152,33 @@ in stdenv.mkDerivation rec {
    "-DDISABLE_DYNAMIC_LOADING_FFMPEG=ON"
    "-Daudacity_conan_enabled=Off"
    "-Daudacity_use_ffmpeg=loaded"
    "-Daudacity_has_vst3=Off"

    # RPATH of binary /nix/store/.../bin/... contains a forbidden reference to /build/
    "-DCMAKE_SKIP_BUILD_RPATH=ON"
  ];

  # [ 57%] Generating LightThemeAsCeeCode.h...
  # ../../utils/image-compiler: error while loading shared libraries:
  # lib-theme.so: cannot open shared object file: No such file or directory
  preBuild = ''
    export LD_LIBRARY_PATH=$PWD/utils
  '';

  doCheck = false; # Test fails

  # Replace audacity's wrapper, to:
  # - put it in the right place, it shouldn't be in "$out/audacity"
  # - Add the ffmpeg dynamic dependency
  postInstall = lib.optionalString stdenv.isLinux ''
    rm "$out/audacity"
    wrapProgram "$out/bin/audacity" \
      --prefix LD_LIBRARY_PATH : "$out/lib/audacity":${lib.makeLibraryPath [ ffmpeg_4 ]} \
      --suffix AUDACITY_MODULES_PATH : "$out/lib/audacity/modules" \
      --suffix AUDACITY_PATH : "$out/share/audacity"
  '' + lib.optionalString stdenv.isDarwin ''
    mkdir -p $out/{Applications,bin}
    mv $out/Audacity.app $out/Applications/
    makeWrapper $out/Applications/Audacity.app/Contents/MacOS/Audacity $out/bin/audacity
  '';

  meta = with lib; {
@@ -198,11 +194,9 @@ in stdenv.mkDerivation rec {
      # Documentation.
      cc-by-30
    ];
    maintainers = with maintainers; [ lheckemann veprbl ];
    maintainers = with maintainers; [ lheckemann veprbl wegank ];
    platforms = platforms.unix;
    # darwin-aarch due to qtbase broken for it.
    # darwin-x86_64 due to
    # https://logs.nix.ci/?attempt_id=5cbc4581-09b4-4148-82fe-0326411a56b3&key=nixos%2Fnixpkgs.152273.
    broken = stdenv.isDarwin;
    # error: unknown type name 'NSAppearanceName'
    broken = stdenv.isDarwin && stdenv.isx86_64;
  };
}
+2 −0
Original line number Diff line number Diff line
@@ -87,6 +87,8 @@ mapAliases ({
  asterisk_17 = throw "asterisk_17: Asterisk 17 is end of life and has been removed"; # Added 2022-04-06
  at_spi2_atk = throw "'at_spi2_atk' has been renamed to/replaced by 'at-spi2-atk'"; # Converted to throw 2022-02-22
  at_spi2_core = throw "'at_spi2_core' has been renamed to/replaced by 'at-spi2-core'"; # Converted to throw 2022-02-22
  audacity-gtk2 = throw "'audacity-gtk2' has been removed to/replaced by 'audacity'"; # Added 2022-10-09
  audacity-gtk3 = throw "'audacity-gtk3' has been removed to/replaced by 'audacity'"; # Added 2022-10-09
  automoc4 = throw "automoc4 has been removed from nixpkgs"; # Added 2022-05-30
  avldrums-lv2 = throw "'avldrums-lv2' has been renamed to/replaced by 'x42-avldrums'"; # Converted to throw 2022-09-24
  awesome-4-0 = awesome; # Added 2022-05-05
+4 −10
Original line number Diff line number Diff line
@@ -26918,16 +26918,10 @@ with pkgs;
  };
  audaciousQt5 = audacious;
  audacity-gtk2 = callPackage ../applications/audio/audacity { wxGTK = wxGTK31-gtk2; };
  audacity-gtk3 = callPackage ../applications/audio/audacity { wxGTK = wxGTK31-gtk3; };
  audacity =
    if stdenv.isDarwin then
      callPackage ../applications/audio/audacity {
        inherit (darwin.apple_sdk.frameworks) AppKit AudioToolbox AudioUnit Carbon Cocoa CoreAudio CoreAudioKit CoreServices;
  audacity = callPackage ../applications/audio/audacity {
    inherit (darwin.apple_sdk.frameworks) AppKit AudioToolbox AudioUnit Carbon CoreAudio CoreAudioKit CoreServices;
    suil = suil-qt5;
      }
    else
      audacity-gtk2;
  };
  audio-recorder = callPackage ../applications/audio/audio-recorder { };