153 lines
3.1 KiB
Nix
Executable File
153 lines
3.1 KiB
Nix
Executable File
{
|
|
description = "Build Project Archimedes";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
|
imgui = {
|
|
url = "github:ocornut/imgui?ref=docking";
|
|
flake = false;
|
|
};
|
|
};
|
|
|
|
outputs = { self, nixpkgs, imgui }: let
|
|
system = "x86_64-linux";
|
|
pkgs = import nixpkgs { inherit system; };
|
|
in {
|
|
|
|
Archimedes = pkgs.stdenvNoCC.mkDerivation {
|
|
|
|
name = "Archimedes";
|
|
|
|
src = ./src;
|
|
|
|
#imgui = inputs.imgui;
|
|
|
|
NativeBuildInputs = with pkgs; [
|
|
gcc
|
|
];
|
|
|
|
buildPhase = ''
|
|
g++ \
|
|
*.cpp \
|
|
-o $name
|
|
'';
|
|
|
|
installPhase = ''
|
|
mkdir -p $out/bin
|
|
cp $name $out/bin
|
|
'';
|
|
|
|
};
|
|
|
|
TestMenu = pkgs.stdenvNoCC.mkDerivation {
|
|
|
|
name = "TestMenu";
|
|
|
|
src = ./.;
|
|
|
|
NativeBuildInputs = with pkgs; [
|
|
gcc
|
|
];
|
|
|
|
buildPhase = ''
|
|
g++ \
|
|
modules/TestMenu/src/*.cpp src/App.cpp \
|
|
-fpic -shared \
|
|
-I src \
|
|
-o $name
|
|
'';
|
|
|
|
installPhase = ''
|
|
mkdir -p $out/bin
|
|
cp $name $out/bin
|
|
'';
|
|
|
|
};
|
|
|
|
Print = pkgs.stdenvNoCC.mkDerivation {
|
|
|
|
name = "Print";
|
|
|
|
src = ./.;
|
|
|
|
NativeBuildInputs = with pkgs; [
|
|
gcc
|
|
];
|
|
|
|
buildPhase = ''
|
|
g++ \
|
|
modules/Print/src/*.cpp src/App.cpp \
|
|
-fpic -shared \
|
|
-I src -I include \
|
|
-o $name
|
|
'';
|
|
|
|
installPhase = ''
|
|
mkdir -p $out/bin
|
|
cp $name $out/bin
|
|
'';
|
|
|
|
};
|
|
|
|
Window = pkgs.stdenvNoCC.mkDerivation {
|
|
|
|
name = "Window";
|
|
|
|
src = ./.;
|
|
|
|
NativeBuildInputs = with pkgs; [
|
|
gcc
|
|
];
|
|
|
|
buildInputs = with pkgs; [
|
|
glfw
|
|
];
|
|
|
|
buildPhase = ''
|
|
g++ \
|
|
modules/Window/src/*.cpp src/App.cpp \
|
|
-fpic -shared \
|
|
-I src -I include \
|
|
-o $name
|
|
'';
|
|
|
|
installPhase = ''
|
|
mkdir -p $out/bin
|
|
cp $name $out/bin
|
|
'';
|
|
|
|
};
|
|
|
|
MainGUI = pkgs.stdenvNoCC.mkDerivation {
|
|
|
|
name = "MainGUI";
|
|
|
|
src = ./.;
|
|
|
|
inherit imgui;
|
|
|
|
NativeBuildInputs = with pkgs; [
|
|
gcc
|
|
];
|
|
|
|
buildPhase = ''
|
|
g++ \
|
|
modules/MainGUI/src/*.cpp src/App.cpp \
|
|
-fpic -shared \
|
|
-I src -I include \
|
|
-o $name
|
|
'';
|
|
|
|
installPhase = ''
|
|
mkdir -p $out/bin
|
|
cp $name $out/bin
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
packages.${system}.default = self.Archimedes;
|
|
|
|
};
|
|
}
|