nixpkgs/pkgs/applications/audio/audacity/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

209 lines
4.4 KiB
Nix
Raw Normal View History

{ stdenv
, lib
, fetchFromGitHub
, cmake
, makeWrapper
2022-11-09 01:31:26 +00:00
, wrapGAppsHook
, pkg-config
, python3
, gettext
, file
, libvorbis
, libmad
, libjack2
, lv2
, lilv
2022-10-09 10:45:44 +00:00
, mpg123
2023-11-10 22:39:12 +00:00
, opusfile
, rapidjson
, serd
, sord
2021-05-07 11:38:50 +00:00
, sqlite
, sratom
, suil
, libsndfile
, soxr
, flac
, lame
, twolame
, expat
, libid3tag
, libopus
, libuuid
2023-11-17 01:15:04 +00:00
, ffmpeg_6
, soundtouch
2021-12-15 22:51:50 +00:00
, pcre
, portaudio # given up fighting their portaudio.patch?
, portmidi
, linuxHeaders
2021-12-15 22:51:50 +00:00
, alsa-lib
2021-05-05 11:04:07 +00:00
, at-spi2-core
, dbus
, libepoxy
2021-05-05 11:04:07 +00:00
, libXdmcp
, libXtst
, libpthreadstubs
, libsbsms_2_3_0
2021-05-05 11:04:07 +00:00
, libselinux
, libsepol
, libxkbcommon
, util-linux
2022-10-09 10:45:44 +00:00
, wavpack
2022-10-09 10:46:50 +00:00
, wxGTK32
, gtk3
, libpng
, libjpeg
2022-10-09 10:45:44 +00:00
, AppKit
, CoreAudioKit
}:
# TODO
2022-10-09 10:46:50 +00:00
# 1. detach sbsms
2022-10-09 10:45:44 +00:00
stdenv.mkDerivation rec {
2022-12-29 00:39:47 +00:00
pname = "audacity";
2024-04-22 15:30:43 +00:00
version = "3.5.0";
src = fetchFromGitHub {
2023-11-10 22:39:12 +00:00
owner = "audacity";
repo = "audacity";
rev = "Audacity-${version}";
2024-04-22 15:30:43 +00:00
hash = "sha256-vJhCONoEC4Bdd1ZOLLobjNgLb/DT6auuMGk8L9lj6TU=";
};
postPatch = ''
mkdir src/private
2023-04-25 12:50:18 +00:00
substituteInPlace scripts/build/macOS/fix_bundle.py \
--replace "path.startswith('/usr/lib/')" "path.startswith('${builtins.storeDir}')"
2021-12-15 22:51:50 +00:00
'' + lib.optionalString stdenv.isLinux ''
substituteInPlace libraries/lib-files/FileNames.cpp \
2021-05-05 11:04:07 +00:00
--replace /usr/include/linux/magic.h ${linuxHeaders}/include/linux/magic.h
'' + lib.optionalString (stdenv.isDarwin && lib.versionOlder stdenv.hostPlatform.darwinMinVersion "11.0") ''
sed -z -i "s/NSAppearanceName.*systemAppearance//" src/AudacityApp.mm
'';
nativeBuildInputs = [
cmake
gettext
pkg-config
python3
2022-10-09 10:45:44 +00:00
makeWrapper
2022-11-09 01:31:26 +00:00
wrapGAppsHook
2022-12-29 00:39:47 +00:00
] ++ lib.optionals stdenv.isLinux [
linuxHeaders
];
buildInputs = [
expat
2023-11-17 01:15:04 +00:00
ffmpeg_6
file
flac
2022-10-09 10:46:50 +00:00
gtk3
lame
libid3tag
libjack2
libmad
libopus
libsbsms_2_3_0
libsndfile
libvorbis
lilv
lv2
2022-10-09 10:45:44 +00:00
mpg123
2023-11-10 22:39:12 +00:00
opusfile
pcre
portmidi
2023-11-10 22:39:12 +00:00
rapidjson
serd
sord
soundtouch
soxr
2021-05-07 11:38:50 +00:00
sqlite
sratom
suil
twolame
portaudio
2022-10-09 10:45:44 +00:00
wavpack
2022-10-09 10:46:50 +00:00
wxGTK32
2022-12-29 00:39:47 +00:00
] ++ lib.optionals stdenv.isLinux [
2021-12-15 22:51:50 +00:00
alsa-lib # for portaudio
at-spi2-core
dbus
libepoxy
libXdmcp
libXtst
libpthreadstubs
libxkbcommon
libselinux
libsepol
libuuid
2021-05-05 11:04:07 +00:00
util-linux
2022-12-29 00:39:47 +00:00
] ++ lib.optionals stdenv.isDarwin [
AppKit
2022-12-29 00:39:47 +00:00
CoreAudioKit # for portaudio
libpng
libjpeg
];
cmakeFlags = [
2022-10-29 16:23:00 +00:00
"-DAUDACITY_BUILD_LEVEL=2"
"-DAUDACITY_REV_LONG=nixpkgs"
"-DAUDACITY_REV_TIME=nixpkgs"
"-DDISABLE_DYNAMIC_LOADING_FFMPEG=ON"
"-Daudacity_conan_enabled=Off"
"-Daudacity_use_ffmpeg=loaded"
2022-10-09 10:45:44 +00:00
"-Daudacity_has_vst3=Off"
2023-04-28 12:27:12 +00:00
"-Daudacity_has_crashreports=Off"
2022-07-17 14:42:15 +00:00
# RPATH of binary /nix/store/.../bin/... contains a forbidden reference to /build/
"-DCMAKE_SKIP_BUILD_RPATH=ON"
2023-04-25 12:50:18 +00:00
# Fix duplicate store paths
"-DCMAKE_INSTALL_LIBDIR=lib"
];
2022-10-09 10:45:44 +00:00
# [ 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 = ''
2023-04-25 12:50:18 +00:00
export LD_LIBRARY_PATH=$PWD/Release/lib/audacity
2022-10-09 10:45:44 +00:00
'';
doCheck = false; # Test fails
2023-11-17 18:10:10 +00:00
dontWrapGApps = true;
# Replace audacity's wrapper, to:
# - put it in the right place, it shouldn't be in "$out/audacity"
# - Add the ffmpeg dynamic dependency
2023-11-17 18:10:10 +00:00
postFixup = lib.optionalString stdenv.isLinux ''
wrapProgram "$out/bin/audacity" \
2023-11-17 18:10:10 +00:00
"''${gappsWrapperArgs[@]}" \
2023-11-17 01:15:04 +00:00
--prefix LD_LIBRARY_PATH : "$out/lib/audacity":${lib.makeLibraryPath [ ffmpeg_6 ]} \
--suffix AUDACITY_MODULES_PATH : "$out/lib/audacity/modules" \
--suffix AUDACITY_PATH : "$out/share/audacity"
2022-10-09 10:45:44 +00:00
'' + 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; {
description = "Sound editor with graphical UI";
mainProgram = "audacity";
homepage = "https://www.audacityteam.org";
changelog = "https://github.com/audacity/audacity/releases";
license = with licenses; [
gpl2Plus
# Must be GPL3 when building with "technologies that require it,
# such as the VST3 audio plugin interface".
# https://github.com/audacity/audacity/discussions/2142.
gpl3
# Documentation.
cc-by-30
];
2022-10-09 10:45:44 +00:00
maintainers = with maintainers; [ lheckemann veprbl wegank ];
2021-12-15 22:51:50 +00:00
platforms = platforms.unix;
};
}