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

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

104 lines
2.7 KiB
Nix
Raw Normal View History

{ lib
, stdenv
, fetchFromGitHub
, alsa-lib
, file
, fluidsynth
, jack2
, liblo
, libpulseaudio
, libsndfile
, pkg-config
, python3Packages
, which
, gtk2 ? null
, gtk3 ? null
, qtbase ? null
, withFrontend ? true
, withGtk2 ? true
, withGtk3 ? true
, withQt ? true
, wrapQtAppsHook ? null
}:
2019-05-23 22:41:51 +00:00
assert withQt -> qtbase != null;
assert withQt -> wrapQtAppsHook != null;
2019-05-23 22:41:51 +00:00
stdenv.mkDerivation rec {
pname = "carla";
2023-03-23 04:34:33 +00:00
version = "2.5.4";
2019-05-23 22:41:51 +00:00
src = fetchFromGitHub {
owner = "falkTX";
repo = pname;
rev = "v${version}";
2023-03-23 04:34:33 +00:00
hash = "sha256-St0+avF9/UzQj8T1eZq5HSmxnaK9+BXSuufyX0NJYbU=";
2019-05-23 22:41:51 +00:00
};
nativeBuildInputs = [
python3Packages.wrapPython pkg-config which wrapQtAppsHook
];
2019-05-23 22:41:51 +00:00
pythonPath = with python3Packages; [
rdflib pyliblo
] ++ lib.optional withFrontend pyqt5;
2019-05-23 22:41:51 +00:00
buildInputs = [
file liblo alsa-lib fluidsynth jack2 libpulseaudio libsndfile
] ++ lib.optional withQt qtbase
++ lib.optional withGtk2 gtk2
++ lib.optional withGtk3 gtk3;
2019-05-23 22:41:51 +00:00
propagatedBuildInputs = pythonPath;
2019-09-14 14:13:41 +00:00
enableParallelBuilding = true;
2019-05-23 22:41:51 +00:00
installFlags = [ "PREFIX=$(out)" ];
postPatch = ''
# --with-appname="$0" is evaluated with $0=.carla-wrapped instead of carla. Fix that.
for file in $(grep -rl -- '--with-appname="$0"'); do
filename="$(basename -- "$file")"
substituteInPlace "$file" --replace '--with-appname="$0"' "--with-appname=\"$filename\""
done
'';
dontWrapQtApps = true;
2019-05-23 22:41:51 +00:00
postFixup = ''
# Also sets program_PYTHONPATH and program_PATH variables
wrapPythonPrograms
wrapPythonProgramsIn "$out/share/carla/resources" "$out $pythonPath"
2019-05-23 22:41:51 +00:00
find "$out/share/carla" -maxdepth 1 -type f -not -name "*.py" -print0 | while read -d "" f; do
patchPythonScript "$f"
done
patchPythonScript "$out/share/carla/carla_settings.py"
for program in $out/bin/*; do
wrapQtApp "$program" \
2019-05-23 22:41:51 +00:00
--prefix PATH : "$program_PATH:${which}/bin" \
--set PYTHONNOUSERSITE true
2019-05-23 22:41:51 +00:00
done
find "$out/share/carla/resources" -maxdepth 1 -type f -not -name "*.py" -print0 | while read -d "" f; do
wrapQtApp "$f" \
--prefix PATH : "$program_PATH:${which}/bin" \
--set PYTHONNOUSERSITE true
done
2019-05-23 22:41:51 +00:00
'';
meta = with lib; {
homepage = "https://kx.studio/Applications:Carla";
2019-05-23 22:41:51 +00:00
description = "An audio plugin host";
longDescription = ''
It currently supports LADSPA (including LRDF), DSSI, LV2, VST2/3
and AU plugin formats, plus GIG, SF2 and SFZ file support.
It uses JACK as the default and preferred audio driver but also
supports native drivers like ALSA, DirectSound or CoreAudio.
'';
license = licenses.gpl2Plus;
maintainers = [ maintainers.minijackson ];
platforms = platforms.linux;
};
}