Hello! I’m on NixOS, setting up a development environment for JUCE.
I downloaded the JUCE repo from: GitHub - juce-framework/JUCE: JUCE is an open-source cross-platform C++ application framework for desktop and mobile applications, including VST, VST3, AU, AUv3, LV2 and AAX audio plug-ins.
Then, in the cloned directory, I created a shell.nix file as follows (verbatim):
let
pkgs = import <nixpkgs> {};
in
pkgs.mkShell {
buildInputs = with pkgs; [
xorg.libX11
xorg.libXrandr
xorg.libXinerama
xorg.libXext
xorg.libXcursor
freetype
fontconfig
curl
webkitgtk_4_1
];
nativeBuildInputs = with pkgs; [
pkg-config
];
}
Then, I ran nix-shell
, before running the JUCE cmake commands:
This first command finishes successfully:
cmake . -B cmake-build -DJUCE_BUILD_EXAMPLES=ON -DJUCE_BUILD_EXTRAS=ON
But this next command finishes with an error because it cannot find gtk.h:
cmake --build cmake-build --target DemoRunner
The error output is as follows:
[ 0%] Building CXX object examples/DemoRunner/CMakeFiles/DemoRunner.dir/__/__/modules/juce_gui_extra/juce_gui_extra.cpp.o
/home/symys/source/JUCE/modules/juce_gui_extra/juce_gui_extra.cpp:127:11: fatal error: gtk/gtk.h: No such file or directory
127 | #include <gtk/gtk.h>
| ^~~~~~~~~~~
compilation terminated.
make[3]: *** [examples/DemoRunner/CMakeFiles/DemoRunner.dir/build.make:363: examples/DemoRunner/CMakeFiles/DemoRunner.dir/__/__/modules/juce_gui_extra/juce_gui_extra.cpp.o] Error 1
make[2]: *** [CMakeFiles/Makefile2:1421: examples/DemoRunner/CMakeFiles/DemoRunner.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:1428: examples/DemoRunner/CMakeFiles/DemoRunner.dir/rule] Error 2
make: *** [Makefile:365: DemoRunner] Error 2
I included webkitgtk_4_1
in buildInputs because the JUCE dependencies list at JUCE/docs/Linux Dependencies.md at 10a589619b452c261b2940767eb253171eb5a823 · juce-framework/JUCE · GitHub names libwebkit2gtk-4.1-dev
as the relevant dependency. I also tried replacing that line in shell.nix with gtk3
and gtk4
- same error.
Any help, guidance, and feedback is much appreciated! Thank you in advance!