37 portaudio, # given up fighting their portaudio.patch?
63 stdenv.mkDerivation (finalAttrs: {
67 src = fetchFromGitHub {
70 rev = "Audacity-${finalAttrs.version}";
71 hash = "sha256-jwsn/L9e1ViWLOh8Xc4lTS9FhanD4GK0BllCwtPamZc=";
77 substituteInPlace scripts/build/macOS/fix_bundle.py \
78 --replace-fail "path.startswith('/usr/lib/')" "path.startswith('${builtins.storeDir}')"
80 + lib.optionalString stdenv.hostPlatform.isLinux ''
81 substituteInPlace libraries/lib-files/FileNames.cpp \
82 --replace-fail /usr/include/linux/magic.h ${linuxHeaders}/include/linux/magic.h
94 ++ lib.optionals stdenv.hostPlatform.isLinux [
132 ++ lib.optionals stdenv.hostPlatform.isLinux [
133 alsa-lib # for portaudio
146 ++ lib.optionals stdenv.hostPlatform.isDarwin [
153 "-DAUDACITY_BUILD_LEVEL=2"
154 "-DAUDACITY_REV_LONG=nixpkgs"
155 "-DAUDACITY_REV_TIME=nixpkgs"
156 "-DDISABLE_DYNAMIC_LOADING_FFMPEG=ON"
157 "-Daudacity_conan_enabled=Off"
158 "-Daudacity_use_ffmpeg=loaded"
159 "-Daudacity_has_vst3=Off"
160 "-Daudacity_has_crashreports=Off"
162 # RPATH of binary /nix/store/.../bin/... contains a forbidden reference to /build/
163 "-DCMAKE_SKIP_BUILD_RPATH=ON"
165 # Fix duplicate store paths
166 "-DCMAKE_INSTALL_LIBDIR=lib"
169 # [ 57%] Generating LightThemeAsCeeCode.h...
170 # ../../utils/image-compiler: error while loading shared libraries:
171 # lib-theme.so: cannot open shared object file: No such file or directory
173 export LD_LIBRARY_PATH=$PWD/Release/lib/audacity
176 doCheck = false; # Test fails
178 dontWrapGApps = true;
180 # Replace audacity's wrapper, to:
181 # - put it in the right place, it shouldn't be in "$out/audacity"
182 # - Add the ffmpeg dynamic dependency
184 lib.optionalString stdenv.hostPlatform.isLinux ''
185 wrapProgram "$out/bin/audacity" \
186 "''${gappsWrapperArgs[@]}" \
187 --prefix LD_LIBRARY_PATH : "$out/lib/audacity":${lib.makeLibraryPath [ ffmpeg ]} \
188 --suffix AUDACITY_MODULES_PATH : "$out/lib/audacity/modules" \
189 --suffix AUDACITY_PATH : "$out/share/audacity"
191 + lib.optionalString stdenv.hostPlatform.isDarwin ''
192 mkdir -p $out/{Applications,bin}
193 mv $out/Audacity.app $out/Applications/
194 makeWrapper $out/Applications/Audacity.app/Contents/MacOS/Audacity $out/bin/audacity
198 description = "Sound editor with graphical UI";
199 mainProgram = "audacity";
200 homepage = "https://www.audacityteam.org";
201 changelog = "https://github.com/audacity/audacity/releases";
202 license = with lib.licenses; [
204 # Must be GPL3 when building with "technologies that require it,
205 # such as the VST3 audio plugin interface".
206 # https://github.com/audacity/audacity/discussions/2142.
211 maintainers = with lib.maintainers; [
215 platforms = lib.platforms.unix;