36 , portaudio # given up fighting their portaudio.patch?
63 stdenv.mkDerivation rec {
67 src = fetchFromGitHub {
70 rev = "Audacity-${version}";
71 hash = "sha256-vJhCONoEC4Bdd1ZOLLobjNgLb/DT6auuMGk8L9lj6TU=";
76 substituteInPlace scripts/build/macOS/fix_bundle.py \
77 --replace "path.startswith('/usr/lib/')" "path.startswith('${builtins.storeDir}')"
78 '' + lib.optionalString stdenv.isLinux ''
79 substituteInPlace libraries/lib-files/FileNames.cpp \
80 --replace /usr/include/linux/magic.h ${linuxHeaders}/include/linux/magic.h
81 '' + lib.optionalString (stdenv.isDarwin && lib.versionOlder stdenv.hostPlatform.darwinMinVersion "11.0") ''
82 sed -z -i "s/NSAppearanceName.*systemAppearance//" src/AudacityApp.mm
92 ] ++ lib.optionals stdenv.isLinux [
128 ] ++ lib.optionals stdenv.isLinux [
129 alsa-lib # for portaudio
141 ] ++ lib.optionals stdenv.isDarwin [
143 CoreAudioKit # for portaudio
149 "-DAUDACITY_BUILD_LEVEL=2"
150 "-DAUDACITY_REV_LONG=nixpkgs"
151 "-DAUDACITY_REV_TIME=nixpkgs"
152 "-DDISABLE_DYNAMIC_LOADING_FFMPEG=ON"
153 "-Daudacity_conan_enabled=Off"
154 "-Daudacity_use_ffmpeg=loaded"
155 "-Daudacity_has_vst3=Off"
156 "-Daudacity_has_crashreports=Off"
158 # RPATH of binary /nix/store/.../bin/... contains a forbidden reference to /build/
159 "-DCMAKE_SKIP_BUILD_RPATH=ON"
161 # Fix duplicate store paths
162 "-DCMAKE_INSTALL_LIBDIR=lib"
165 # [ 57%] Generating LightThemeAsCeeCode.h...
166 # ../../utils/image-compiler: error while loading shared libraries:
167 # lib-theme.so: cannot open shared object file: No such file or directory
169 export LD_LIBRARY_PATH=$PWD/Release/lib/audacity
172 doCheck = false; # Test fails
174 dontWrapGApps = true;
176 # Replace audacity's wrapper, to:
177 # - put it in the right place, it shouldn't be in "$out/audacity"
178 # - Add the ffmpeg dynamic dependency
179 postFixup = lib.optionalString stdenv.isLinux ''
180 wrapProgram "$out/bin/audacity" \
181 "''${gappsWrapperArgs[@]}" \
182 --prefix LD_LIBRARY_PATH : "$out/lib/audacity":${lib.makeLibraryPath [ ffmpeg_6 ]} \
183 --suffix AUDACITY_MODULES_PATH : "$out/lib/audacity/modules" \
184 --suffix AUDACITY_PATH : "$out/share/audacity"
185 '' + lib.optionalString stdenv.isDarwin ''
186 mkdir -p $out/{Applications,bin}
187 mv $out/Audacity.app $out/Applications/
188 makeWrapper $out/Applications/Audacity.app/Contents/MacOS/Audacity $out/bin/audacity
192 description = "Sound editor with graphical UI";
193 mainProgram = "audacity";
194 homepage = "https://www.audacityteam.org";
195 changelog = "https://github.com/audacity/audacity/releases";
196 license = with licenses; [
198 # Must be GPL3 when building with "technologies that require it,
199 # such as the VST3 audio plugin interface".
200 # https://github.com/audacity/audacity/discussions/2142.
205 maintainers = with maintainers; [ lheckemann veprbl wegank ];
206 platforms = platforms.unix;