packaging

This commit is contained in:
Sebastien Bourdeauducq 2023-08-23 11:08:54 +08:00
parent 36dc98f776
commit afa0145241
1 changed files with 19 additions and 9 deletions

View File

@ -6,20 +6,30 @@
outputs = { self, nixpkgs }:
let
pkgs = import nixpkgs { system = "x86_64-linux"; };
in {
imgui_dir = "${pkgs.imgui}/include/imgui";
in rec {
packages.x86_64-linux.microsa = pkgs.stdenv.mkDerivation {
name = "microsa";
src = self;
nativeBuildInputs = [ pkgs.pkg-config ];
propagatedBuildInputs = [ pkgs.wayland pkgs.glfw-wayland pkgs.libffi ];
preBuild = ''
export IMGUI_DIR=${imgui_dir}
'';
installPhase = ''
mkdir -p $out/bin
cp microsa $out/bin
'';
};
devShell.x86_64-linux = pkgs.mkShell {
name = "microsa-dev-shell";
buildInputs = [
pkgs.gnumake
pkgs.gcc
pkgs.pkg-config
pkgs.wayland
pkgs.glfw-wayland
pkgs.libffi
];
shellHook = ''
export IMGUI_DIR=${pkgs.imgui}/include/imgui
'';
] ++ packages.x86_64-linux.microsa.nativeBuildInputs
++ packages.x86_64-linux.microsa.propagatedBuildInputs;
shellHook = packages.x86_64-linux.microsa.preBuild;
};
defaultPackage.x86_64-linux = packages.x86_64-linux.microsa;
};
}