2021-01-17 00:15:33 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, cmake
|
2022-04-15 01:41:22 +00:00
|
|
|
, makeWrapper
|
2021-01-17 00:15:33 +00:00
|
|
|
, pkg-config
|
|
|
|
, python3
|
|
|
|
, gettext
|
|
|
|
, file
|
|
|
|
, libvorbis
|
|
|
|
, libmad
|
|
|
|
, libjack2
|
|
|
|
, lv2
|
|
|
|
, lilv
|
2022-10-21 18:38:19 +00:00
|
|
|
, mpg123
|
2021-01-17 00:15:33 +00:00
|
|
|
, serd
|
|
|
|
, sord
|
2021-05-20 23:08:51 +00:00
|
|
|
, sqlite
|
2021-01-17 00:15:33 +00:00
|
|
|
, sratom
|
|
|
|
, suil
|
|
|
|
, libsndfile
|
|
|
|
, soxr
|
|
|
|
, flac
|
2022-04-15 01:41:22 +00:00
|
|
|
, lame
|
2021-01-17 00:15:33 +00:00
|
|
|
, twolame
|
|
|
|
, expat
|
|
|
|
, libid3tag
|
|
|
|
, libopus
|
2022-04-15 01:41:22 +00:00
|
|
|
, libuuid
|
2022-02-10 20:34:41 +00:00
|
|
|
, ffmpeg_4
|
2021-01-17 00:15:33 +00:00
|
|
|
, soundtouch
|
2021-12-19 01:06:50 +00:00
|
|
|
, pcre
|
2022-04-15 01:41:22 +00:00
|
|
|
, portaudio # given up fighting their portaudio.patch?
|
|
|
|
, portmidi
|
2021-05-04 21:07:42 +00:00
|
|
|
, linuxHeaders
|
2021-12-19 01:06:50 +00:00
|
|
|
, alsa-lib
|
2021-05-20 23:08:51 +00:00
|
|
|
, at-spi2-core
|
|
|
|
, dbus
|
2021-12-06 16:07:01 +00:00
|
|
|
, libepoxy
|
2021-05-20 23:08:51 +00:00
|
|
|
, libXdmcp
|
|
|
|
, libXtst
|
|
|
|
, libpthreadstubs
|
2022-04-15 01:41:22 +00:00
|
|
|
, libsbsms_2_3_0
|
2021-05-20 23:08:51 +00:00
|
|
|
, libselinux
|
|
|
|
, libsepol
|
|
|
|
, libxkbcommon
|
|
|
|
, util-linux
|
2022-10-21 18:38:19 +00:00
|
|
|
, wavpack
|
|
|
|
, wxGTK32
|
|
|
|
, gtk3
|
2022-04-15 01:41:22 +00:00
|
|
|
, libpng
|
|
|
|
, libjpeg
|
2022-10-21 18:38:19 +00:00
|
|
|
, AppKit
|
|
|
|
, AudioToolbox
|
|
|
|
, AudioUnit
|
|
|
|
, Carbon
|
|
|
|
, CoreAudio
|
|
|
|
, CoreAudioKit
|
|
|
|
, CoreServices
|
2021-01-05 17:05:55 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-17 00:15:33 +00:00
|
|
|
# TODO
|
2022-10-21 18:38:19 +00:00
|
|
|
# 1. detach sbsms
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-04 21:07:42 +00:00
|
|
|
let
|
2021-05-20 23:08:51 +00:00
|
|
|
inherit (lib) optionals;
|
2022-04-15 01:41:22 +00:00
|
|
|
pname = "audacity";
|
2022-10-21 18:38:19 +00:00
|
|
|
version = "3.2.1";
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2022-04-15 01:41:22 +00:00
|
|
|
inherit pname version;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-17 00:15:33 +00:00
|
|
|
src = fetchFromGitHub {
|
2022-04-15 01:41:22 +00:00
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
2021-01-17 00:15:33 +00:00
|
|
|
rev = "Audacity-${version}";
|
2022-10-21 18:38:19 +00:00
|
|
|
sha256 = "sha256-7rfttp9LnfM2LBT5seupPyDckS7LEzWDZoqtLsGgqgI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-01-17 00:15:33 +00:00
|
|
|
postPatch = ''
|
2022-04-15 01:41:22 +00:00
|
|
|
mkdir src/private
|
2021-12-19 01:06:50 +00:00
|
|
|
'' + lib.optionalString stdenv.isLinux ''
|
2022-04-15 01:41:22 +00:00
|
|
|
substituteInPlace libraries/lib-files/FileNames.cpp \
|
2021-05-20 23:08:51 +00:00
|
|
|
--replace /usr/include/linux/magic.h ${linuxHeaders}/include/linux/magic.h
|
2021-05-04 21:07:42 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
gettext
|
|
|
|
pkg-config
|
|
|
|
python3
|
2022-10-21 18:38:19 +00:00
|
|
|
makeWrapper
|
2021-05-20 23:08:51 +00:00
|
|
|
] ++ optionals stdenv.isLinux [
|
2021-05-04 21:07:42 +00:00
|
|
|
linuxHeaders
|
|
|
|
];
|
2021-01-17 00:15:33 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
2021-01-17 00:15:33 +00:00
|
|
|
expat
|
2022-02-10 20:34:41 +00:00
|
|
|
ffmpeg_4
|
2021-01-17 00:15:33 +00:00
|
|
|
file
|
|
|
|
flac
|
2022-10-21 18:38:19 +00:00
|
|
|
gtk3
|
2022-04-15 01:41:22 +00:00
|
|
|
lame
|
2021-01-17 00:15:33 +00:00
|
|
|
libid3tag
|
|
|
|
libjack2
|
|
|
|
libmad
|
|
|
|
libopus
|
2022-04-15 01:41:22 +00:00
|
|
|
libsbsms_2_3_0
|
2021-01-17 00:15:33 +00:00
|
|
|
libsndfile
|
|
|
|
libvorbis
|
|
|
|
lilv
|
|
|
|
lv2
|
2022-10-21 18:38:19 +00:00
|
|
|
mpg123
|
2021-01-17 00:15:33 +00:00
|
|
|
pcre
|
2022-04-15 01:41:22 +00:00
|
|
|
portmidi
|
2021-01-17 00:15:33 +00:00
|
|
|
serd
|
|
|
|
sord
|
|
|
|
soundtouch
|
|
|
|
soxr
|
2021-05-20 23:08:51 +00:00
|
|
|
sqlite
|
2021-01-17 00:15:33 +00:00
|
|
|
sratom
|
|
|
|
suil
|
|
|
|
twolame
|
2022-04-15 01:41:22 +00:00
|
|
|
portaudio
|
2022-10-21 18:38:19 +00:00
|
|
|
wavpack
|
|
|
|
wxGTK32
|
2021-05-20 23:08:51 +00:00
|
|
|
] ++ optionals stdenv.isLinux [
|
2021-12-19 01:06:50 +00:00
|
|
|
alsa-lib # for portaudio
|
2021-01-17 00:15:33 +00:00
|
|
|
at-spi2-core
|
|
|
|
dbus
|
2021-12-06 16:07:01 +00:00
|
|
|
libepoxy
|
2021-01-17 00:15:33 +00:00
|
|
|
libXdmcp
|
|
|
|
libXtst
|
|
|
|
libpthreadstubs
|
|
|
|
libxkbcommon
|
|
|
|
libselinux
|
|
|
|
libsepol
|
2022-04-15 01:41:22 +00:00
|
|
|
libuuid
|
2021-05-20 23:08:51 +00:00
|
|
|
util-linux
|
2021-12-19 01:06:50 +00:00
|
|
|
] ++ optionals stdenv.isDarwin [
|
|
|
|
AppKit
|
|
|
|
CoreAudioKit
|
|
|
|
AudioUnit AudioToolbox CoreAudio CoreServices Carbon # for portaudio
|
2022-04-15 01:41:22 +00:00
|
|
|
libpng
|
|
|
|
libjpeg
|
2021-12-19 01:06:50 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
2022-10-30 15:09:59 +00:00
|
|
|
"-DAUDACITY_BUILD_LEVEL=2"
|
2022-04-15 01:41:22 +00:00
|
|
|
"-DAUDACITY_REV_LONG=nixpkgs"
|
|
|
|
"-DAUDACITY_REV_TIME=nixpkgs"
|
2021-12-19 01:06:50 +00:00
|
|
|
"-DDISABLE_DYNAMIC_LOADING_FFMPEG=ON"
|
2022-04-15 01:41:22 +00:00
|
|
|
"-Daudacity_conan_enabled=Off"
|
|
|
|
"-Daudacity_use_ffmpeg=loaded"
|
2022-10-21 18:38:19 +00:00
|
|
|
"-Daudacity_has_vst3=Off"
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
# RPATH of binary /nix/store/.../bin/... contains a forbidden reference to /build/
|
|
|
|
"-DCMAKE_SKIP_BUILD_RPATH=ON"
|
2021-01-17 00:15:33 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-10-21 18:38:19 +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 = ''
|
|
|
|
export LD_LIBRARY_PATH=$PWD/utils
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
doCheck = false; # Test fails
|
|
|
|
|
2022-04-15 01:41:22 +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-21 18:38:19 +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
|
2022-04-15 01:41:22 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Sound editor with graphical UI";
|
2022-04-15 01:41:22 +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-21 18:38:19 +00:00
|
|
|
maintainers = with maintainers; [ lheckemann veprbl wegank ];
|
2021-12-19 01:06:50 +00:00
|
|
|
platforms = platforms.unix;
|
2022-10-21 18:38:19 +00:00
|
|
|
# error: unknown type name 'NSAppearanceName'
|
|
|
|
broken = stdenv.isDarwin && stdenv.isx86_64;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|