2023-03-15 16:39:30 +00:00
|
|
|
{ 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
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
assert withQt -> qtbase != null;
|
|
|
|
assert withQt -> wrapQtAppsHook != null;
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "carla";
|
2023-10-19 13:55:26 +00:00
|
|
|
version = "2.5.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "falkTX";
|
2023-07-15 17:15:38 +00:00
|
|
|
repo = finalAttrs.pname;
|
|
|
|
rev = "v${finalAttrs.version}";
|
2023-10-19 13:55:26 +00:00
|
|
|
hash = "sha256-WDwYfDR760Maz3oWNPcPbl8L+0MIRbeqNVGH9Gg4ZYc=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2021-02-05 17:12:51 +00:00
|
|
|
python3Packages.wrapPython pkg-config which wrapQtAppsHook
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
pythonPath = with python3Packages; [
|
|
|
|
rdflib pyliblo
|
2023-02-02 18:25:31 +00:00
|
|
|
] ++ lib.optional withFrontend pyqt5;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
2021-06-28 23:13:55 +00:00
|
|
|
file liblo alsa-lib fluidsynth jack2 libpulseaudio libsndfile
|
2023-02-02 18:25:31 +00:00
|
|
|
] ++ lib.optional withQt qtbase
|
|
|
|
++ lib.optional withGtk2 gtk2
|
|
|
|
++ lib.optional withGtk3 gtk3;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
propagatedBuildInputs = finalAttrs.pythonPath;
|
2021-02-05 17:12:51 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
installFlags = [ "PREFIX=$(out)" ];
|
|
|
|
|
2021-10-04 12:37:57 +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
|
2023-11-16 04:20:00 +00:00
|
|
|
'' + lib.optionalString withGtk2 ''
|
|
|
|
# Will try to dlopen() libgtk-x11-2.0 at runtime when using the bridge.
|
|
|
|
substituteInPlace source/bridges-ui/Makefile \
|
|
|
|
--replace '$(CXX) $(OBJS_GTK2)' '$(CXX) $(OBJS_GTK2) -lgtk-x11-2.0'
|
2021-10-04 12:37:57 +00:00
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
dontWrapQtApps = true;
|
|
|
|
postFixup = ''
|
|
|
|
# Also sets program_PYTHONPATH and program_PATH variables
|
|
|
|
wrapPythonPrograms
|
|
|
|
wrapPythonProgramsIn "$out/share/carla/resources" "$out $pythonPath"
|
|
|
|
|
|
|
|
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" \
|
|
|
|
--prefix PATH : "$program_PATH:${which}/bin" \
|
|
|
|
--set PYTHONNOUSERSITE true
|
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2022-01-03 16:56:52 +00:00
|
|
|
homepage = "https://kx.studio/Applications:Carla";
|
2020-04-24 23:36:52 +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;
|
|
|
|
};
|
2023-07-15 17:15:38 +00:00
|
|
|
})
|