22 wrapQtAppsHook ? null,
25 assert withQt -> qtbase != null;
26 assert withQt -> wrapQtAppsHook != null;
28 stdenv.mkDerivation (finalAttrs: {
32 src = fetchFromGitHub {
35 rev = "v${finalAttrs.version}";
36 hash = "sha256-FM/6TtNhDml1V9C5VisjLcZ3CzXsuwCZrsoz4yP3kI8=";
40 python3Packages.wrapPython
52 ++ lib.optional withFrontend pyqt5;
64 ++ lib.optional withQt qtbase
65 ++ lib.optional withGtk2 gtk2
66 ++ lib.optional withGtk3 gtk3;
68 propagatedBuildInputs = finalAttrs.pythonPath;
70 enableParallelBuilding = true;
72 installFlags = [ "PREFIX=$(out)" ];
76 # --with-appname="$0" is evaluated with $0=.carla-wrapped instead of carla. Fix that.
77 for file in $(grep -rl -- '--with-appname="$0"'); do
78 filename="$(basename -- "$file")"
79 substituteInPlace "$file" --replace '--with-appname="$0"' "--with-appname=\"$filename\""
82 + lib.optionalString withGtk2 ''
83 # Will try to dlopen() libgtk-x11-2.0 at runtime when using the bridge.
84 substituteInPlace source/bridges-ui/Makefile \
85 --replace '$(CXX) $(OBJS_GTK2)' '$(CXX) $(OBJS_GTK2) -lgtk-x11-2.0'
88 dontWrapQtApps = true;
90 # Also sets program_PYTHONPATH and program_PATH variables
92 wrapPythonProgramsIn "$out/share/carla/resources" "$out $pythonPath"
94 find "$out/share/carla" -maxdepth 1 -type f -not -name "*.py" -print0 | while read -d "" f; do
95 patchPythonScript "$f"
97 patchPythonScript "$out/share/carla/carla_settings.py"
99 for program in $out/bin/*; do
100 wrapQtApp "$program" \
101 --prefix PATH : "$program_PATH:${which}/bin" \
102 --set PYTHONNOUSERSITE true
105 find "$out/share/carla/resources" -maxdepth 1 -type f -not -name "*.py" -print0 | while read -d "" f; do
107 --prefix PATH : "$program_PATH:${which}/bin" \
108 --set PYTHONNOUSERSITE true
113 homepage = "https://kx.studio/Applications:Carla";
114 description = "Audio plugin host";
116 It currently supports LADSPA (including LRDF), DSSI, LV2, VST2/3
117 and AU plugin formats, plus GIG, SF2 and SFZ file support.
118 It uses JACK as the default and preferred audio driver but also
119 supports native drivers like ALSA, DirectSound or CoreAudio.
121 license = licenses.gpl2Plus;
122 maintainers = [ maintainers.minijackson ];
123 platforms = platforms.linux;