2020-09-07 15:48:50 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
2021-05-04 02:06:51 +00:00
|
|
|
, fetchpatch
|
2020-09-07 15:48:50 +00:00
|
|
|
, cmake
|
2021-12-26 20:24:29 +00:00
|
|
|
, makeWrapper
|
2022-11-09 01:31:26 +00:00
|
|
|
, wrapGAppsHook
|
2020-09-07 15:48:50 +00:00
|
|
|
, pkg-config
|
|
|
|
, python3
|
|
|
|
, gettext
|
|
|
|
, file
|
|
|
|
, libvorbis
|
|
|
|
, libmad
|
|
|
|
, libjack2
|
|
|
|
, lv2
|
|
|
|
, lilv
|
2022-10-09 10:45:44 +00:00
|
|
|
, mpg123
|
2020-09-07 15:48:50 +00:00
|
|
|
, serd
|
|
|
|
, sord
|
2021-05-07 11:38:50 +00:00
|
|
|
, sqlite
|
2020-09-07 15:48:50 +00:00
|
|
|
, sratom
|
|
|
|
, suil
|
|
|
|
, libsndfile
|
|
|
|
, soxr
|
|
|
|
, flac
|
2021-12-26 20:24:29 +00:00
|
|
|
, lame
|
2020-09-07 15:48:50 +00:00
|
|
|
, twolame
|
|
|
|
, expat
|
|
|
|
, libid3tag
|
|
|
|
, libopus
|
2021-12-26 20:24:29 +00:00
|
|
|
, libuuid
|
2022-02-05 06:09:51 +00:00
|
|
|
, ffmpeg_4
|
2020-09-07 15:48:50 +00:00
|
|
|
, soundtouch
|
2021-12-15 22:51:50 +00:00
|
|
|
, pcre
|
2021-12-26 20:24:29 +00:00
|
|
|
, portaudio # given up fighting their portaudio.patch?
|
|
|
|
, portmidi
|
2021-05-04 03:00:47 +00:00
|
|
|
, linuxHeaders
|
2021-12-15 22:51:50 +00:00
|
|
|
, alsa-lib
|
2021-05-05 11:04:07 +00:00
|
|
|
, at-spi2-core
|
|
|
|
, dbus
|
2021-11-11 04:35:34 +00:00
|
|
|
, libepoxy
|
2021-05-05 11:04:07 +00:00
|
|
|
, libXdmcp
|
|
|
|
, libXtst
|
|
|
|
, libpthreadstubs
|
2021-12-26 20:24:29 +00:00
|
|
|
, 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
|
2021-12-26 20:24:29 +00:00
|
|
|
, libpng
|
|
|
|
, libjpeg
|
2022-10-09 10:45:44 +00:00
|
|
|
, AppKit
|
|
|
|
, CoreAudioKit
|
2020-12-23 11:55:58 +00:00
|
|
|
}:
|
2007-10-29 10:52:04 +00:00
|
|
|
|
2020-09-07 15:48:50 +00:00
|
|
|
# TODO
|
2022-10-09 10:46:50 +00:00
|
|
|
# 1. detach sbsms
|
2016-12-30 04:40:28 +00:00
|
|
|
|
2022-10-09 10:45:44 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2022-12-29 00:39:47 +00:00
|
|
|
pname = "audacity";
|
2023-05-06 19:19:39 +00:00
|
|
|
version = "3.3.2";
|
2009-03-30 07:33:31 +00:00
|
|
|
|
2020-09-07 15:48:50 +00:00
|
|
|
src = fetchFromGitHub {
|
2021-12-26 20:24:29 +00:00
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
2020-09-07 15:48:50 +00:00
|
|
|
rev = "Audacity-${version}";
|
2023-05-06 19:19:39 +00:00
|
|
|
hash = "sha256-/DjTmanPzkShNoMFNbnQzzwEzk/a2uUYvVW9dsvl5uY=";
|
2009-03-30 07:33:31 +00:00
|
|
|
};
|
2013-06-04 09:35:33 +00:00
|
|
|
|
2021-05-04 02:06:51 +00:00
|
|
|
postPatch = ''
|
2021-12-26 20:24:29 +00:00
|
|
|
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 ''
|
2021-12-26 20:24:29 +00:00
|
|
|
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
|
2023-03-28 13:44:47 +00:00
|
|
|
'' + lib.optionalString (stdenv.isDarwin && lib.versionOlder stdenv.targetPlatform.darwinMinVersion "11.0") ''
|
|
|
|
sed -z -i "s/NSAppearanceName.*systemAppearance//" src/AudacityApp.mm
|
2021-05-04 03:00:47 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
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 [
|
2021-05-04 03:00:47 +00:00
|
|
|
linuxHeaders
|
|
|
|
];
|
2020-09-07 15:48:50 +00:00
|
|
|
|
2013-06-04 09:35:33 +00:00
|
|
|
buildInputs = [
|
2020-09-07 15:48:50 +00:00
|
|
|
expat
|
2022-02-05 06:09:51 +00:00
|
|
|
ffmpeg_4
|
2020-09-07 15:48:50 +00:00
|
|
|
file
|
|
|
|
flac
|
2022-10-09 10:46:50 +00:00
|
|
|
gtk3
|
2021-12-26 20:24:29 +00:00
|
|
|
lame
|
2020-09-07 15:48:50 +00:00
|
|
|
libid3tag
|
|
|
|
libjack2
|
|
|
|
libmad
|
|
|
|
libopus
|
2021-12-26 20:24:29 +00:00
|
|
|
libsbsms_2_3_0
|
2020-09-07 15:48:50 +00:00
|
|
|
libsndfile
|
|
|
|
libvorbis
|
|
|
|
lilv
|
|
|
|
lv2
|
2022-10-09 10:45:44 +00:00
|
|
|
mpg123
|
2020-09-07 15:48:50 +00:00
|
|
|
pcre
|
2021-12-26 20:24:29 +00:00
|
|
|
portmidi
|
2020-09-07 15:48:50 +00:00
|
|
|
serd
|
|
|
|
sord
|
|
|
|
soundtouch
|
|
|
|
soxr
|
2021-05-07 11:38:50 +00:00
|
|
|
sqlite
|
2020-09-07 15:48:50 +00:00
|
|
|
sratom
|
|
|
|
suil
|
|
|
|
twolame
|
2021-12-26 20:24:29 +00:00
|
|
|
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
|
2020-09-07 15:48:50 +00:00
|
|
|
at-spi2-core
|
|
|
|
dbus
|
2021-11-11 04:35:34 +00:00
|
|
|
libepoxy
|
2020-09-07 15:48:50 +00:00
|
|
|
libXdmcp
|
|
|
|
libXtst
|
|
|
|
libpthreadstubs
|
|
|
|
libxkbcommon
|
|
|
|
libselinux
|
|
|
|
libsepol
|
2021-12-26 20:24:29 +00:00
|
|
|
libuuid
|
2021-05-05 11:04:07 +00:00
|
|
|
util-linux
|
2022-12-29 00:39:47 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
2023-03-28 13:44:47 +00:00
|
|
|
AppKit
|
2022-12-29 00:39:47 +00:00
|
|
|
CoreAudioKit # for portaudio
|
2021-12-26 20:24:29 +00:00
|
|
|
libpng
|
|
|
|
libjpeg
|
2020-09-07 15:48:50 +00:00
|
|
|
];
|
2011-01-02 17:13:34 +00:00
|
|
|
|
2021-12-15 23:14:53 +00:00
|
|
|
cmakeFlags = [
|
2022-10-29 16:23:00 +00:00
|
|
|
"-DAUDACITY_BUILD_LEVEL=2"
|
2021-12-26 20:24:29 +00:00
|
|
|
"-DAUDACITY_REV_LONG=nixpkgs"
|
|
|
|
"-DAUDACITY_REV_TIME=nixpkgs"
|
2021-12-15 23:14:53 +00:00
|
|
|
"-DDISABLE_DYNAMIC_LOADING_FFMPEG=ON"
|
2021-12-26 20:24:29 +00:00
|
|
|
"-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"
|
2021-12-15 23:14:53 +00:00
|
|
|
];
|
|
|
|
|
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
|
|
|
'';
|
|
|
|
|
2015-08-14 17:44:19 +00:00
|
|
|
doCheck = false; # Test fails
|
2011-01-02 17:13:34 +00:00
|
|
|
|
2021-12-26 20:24:29 +00:00
|
|
|
# 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 ''
|
|
|
|
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"
|
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
|
2021-12-26 20:24:29 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2009-03-30 07:33:31 +00:00
|
|
|
description = "Sound editor with graphical UI";
|
2021-12-26 20:24:29 +00:00
|
|
|
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;
|
2007-10-29 10:52:04 +00:00
|
|
|
};
|
|
|
|
}
|