57 lines
1.4 KiB
Nix
57 lines
1.4 KiB
Nix
{ inputs, ... }: {
|
|
|
|
|
|
perSystem = { system, pkgs, self', ... }: {
|
|
packages.Sandbox = pkgs.stdenvNoCC.mkDerivation {
|
|
|
|
name = "Sandbox";
|
|
|
|
src = inputs.src;
|
|
|
|
imgui = inputs.imgui;
|
|
|
|
nativeBuildInputs = with pkgs; [
|
|
clang
|
|
];
|
|
|
|
buildInputs = with pkgs; [
|
|
glfw
|
|
glew
|
|
|
|
glm
|
|
curl
|
|
nlohmann_json
|
|
];
|
|
|
|
buildPhase = ''
|
|
clang++ \
|
|
modules/Archimedes-Modules/Sandbox/*.cpp \
|
|
modules/WindowModule/*.cpp \
|
|
modules/ImguiModule/*.cpp \
|
|
$imgui/backends/imgui_impl_glfw.cpp \
|
|
$imgui/backends/imgui_impl_opengl3.cpp \
|
|
$imgui/misc/cpp/*.cpp \
|
|
$imgui/*.cpp \
|
|
-DRENDERER_OPENGL=1 \
|
|
-DWINDOW_GLFW=1 \
|
|
-DSANDBOX_DYNAMIC \
|
|
-fpic -shared \
|
|
-I include -I $imgui -I . \
|
|
-lEGL -lglfw -lGLEW \
|
|
$(curl-config --cflags) \
|
|
$(curl-config --libs) \
|
|
-Wall \
|
|
-o $name -DIMGUI_IMPL_GLFW_DISABLE_X11
|
|
'';
|
|
|
|
installPhase = ''
|
|
mkdir -p $out/bin
|
|
cp $name $out/bin
|
|
'';
|
|
|
|
};
|
|
};
|
|
|
|
|
|
}
|