2021-06-10 02:57:09 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, alsa-lib, file, fluidsynth, jack2,
|
2021-01-19 06:50:56 +00:00
|
|
|
liblo, libpulseaudio, libsndfile, pkg-config, python3Packages,
|
2019-05-23 22:41:51 +00:00
|
|
|
which, withFrontend ? true,
|
2019-07-05 15:42:08 +00:00
|
|
|
withQt ? true, qtbase ? null, wrapQtAppsHook ? null,
|
2019-05-23 22:41:51 +00:00
|
|
|
withGtk2 ? true, gtk2 ? null,
|
|
|
|
withGtk3 ? true, gtk3 ? null }:
|
|
|
|
|
|
|
|
assert withFrontend -> python3Packages ? pyqt5;
|
|
|
|
assert withQt -> qtbase != null;
|
2019-07-05 15:42:08 +00:00
|
|
|
assert withQt -> wrapQtAppsHook != null;
|
2019-05-23 22:41:51 +00:00
|
|
|
assert withGtk2 -> gtk2 != null;
|
|
|
|
assert withGtk3 -> gtk3 != null;
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "carla";
|
2022-10-01 09:51:54 +00:00
|
|
|
version = "2.5.1";
|
2019-05-23 22:41:51 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "falkTX";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-10-01 09:51:54 +00:00
|
|
|
sha256 = "sha256-SN+9Q5v0bv+kQcYLBJmSCd9WIGSeQuOZze8LVwF20EA=";
|
2019-05-23 22:41:51 +00:00
|
|
|
};
|
|
|
|
|
2019-07-05 15:42:08 +00:00
|
|
|
nativeBuildInputs = [
|
2021-01-19 06:50:56 +00:00
|
|
|
python3Packages.wrapPython pkg-config which wrapQtAppsHook
|
2019-07-05 15:42:08 +00:00
|
|
|
];
|
2019-05-23 22:41:51 +00:00
|
|
|
|
|
|
|
pythonPath = with python3Packages; [
|
|
|
|
rdflib pyliblo
|
2023-01-21 22:06:40 +00:00
|
|
|
] ++ lib.optional withFrontend pyqt5;
|
2019-05-23 22:41:51 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
2021-06-10 02:57:09 +00:00
|
|
|
file liblo alsa-lib fluidsynth jack2 libpulseaudio libsndfile
|
2023-01-21 22:06:40 +00:00
|
|
|
] ++ lib.optional withQt qtbase
|
|
|
|
++ lib.optional withGtk2 gtk2
|
|
|
|
++ lib.optional withGtk3 gtk3;
|
2019-05-23 22:41:51 +00:00
|
|
|
|
2021-01-31 22:17:13 +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)" ];
|
|
|
|
|
2021-10-01 07:47:33 +00:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2019-07-05 15:42:08 +00:00
|
|
|
dontWrapQtApps = true;
|
2019-05-23 22:41:51 +00:00
|
|
|
postFixup = ''
|
|
|
|
# Also sets program_PYTHONPATH and program_PATH variables
|
|
|
|
wrapPythonPrograms
|
2019-09-14 14:14:02 +00:00
|
|
|
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"
|
2021-01-31 22:39:36 +00:00
|
|
|
patchPythonScript "$out/share/carla/carla_database.py"
|
2019-05-23 22:41:51 +00:00
|
|
|
|
|
|
|
for program in $out/bin/*; do
|
2019-07-05 15:42:08 +00:00
|
|
|
wrapQtApp "$program" \
|
2019-05-23 22:41:51 +00:00
|
|
|
--prefix PATH : "$program_PATH:${which}/bin" \
|
2019-07-05 15:42:08 +00:00
|
|
|
--set PYTHONNOUSERSITE true
|
2019-05-23 22:41:51 +00:00
|
|
|
done
|
2019-09-14 14:14:02 +00:00
|
|
|
|
|
|
|
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
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2022-01-02 00:27:04 +00:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|