packaging

This commit is contained in:
Sebastien Bourdeauducq 2023-08-23 11:08:54 +08:00
parent 36dc98f776
commit afa0145241

View File

@ -6,20 +6,30 @@
outputs = { self, nixpkgs }: outputs = { self, nixpkgs }:
let let
pkgs = import nixpkgs { system = "x86_64-linux"; }; 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 { devShell.x86_64-linux = pkgs.mkShell {
name = "microsa-dev-shell"; name = "microsa-dev-shell";
buildInputs = [ buildInputs = [
pkgs.gnumake pkgs.gnumake
pkgs.gcc pkgs.gcc
pkgs.pkg-config ] ++ packages.x86_64-linux.microsa.nativeBuildInputs
pkgs.wayland ++ packages.x86_64-linux.microsa.propagatedBuildInputs;
pkgs.glfw-wayland shellHook = packages.x86_64-linux.microsa.preBuild;
pkgs.libffi
];
shellHook = ''
export IMGUI_DIR=${pkgs.imgui}/include/imgui
'';
}; };
defaultPackage.x86_64-linux = packages.x86_64-linux.microsa;
}; };
} }