Try to set up staged building

This commit is contained in:
Savanni D'Gerinel 2023-04-03 09:22:23 -04:00
parent d8573665d9
commit d776a64837
1 changed files with 34 additions and 2 deletions

View File

@ -47,17 +47,49 @@
let let
pkgs = import nixpkgs { system = "x86_64-linux"; }; pkgs = import nixpkgs { system = "x86_64-linux"; };
craneLib = crane.lib."x86_64-linux"; craneLib = crane.lib."x86_64-linux";
in { in rec {
kifu-core-deps = craneLib.buildDepsOnly {
pname = "kifu-core-deps";
version = "0.1.0";
src = craneLib.cleanCargoSource (craneLib.path ./.);
cargoExtraArgs = "-p kifu-core";
};
kifu-core = craneLib.buildPackage {
pname = "kifu-core";
version = "0.1.0";
src = craneLib.cleanCargoSource (craneLib.path ./.);
cargoExtraArgs = "-p kifu-core";
doInstallCargoArtifacts = true;
inherit kifu-core-deps;
};
kifu-gtk-deps = craneLib.buildDepsOnly {
pname = "kifu-gtk-deps";
version = "0.1.0";
src = craneLib.cleanCargoSource (craneLib.path ./.);
nativeBuildInputs = with pkgs; [
pkg-config
glib
gtk4
];
buildInputs = with pkgs; [
pkg-config
];
cargoExtraArgs = "-p kifu-gtk";
inherit kifu-core;
};
kifu-gtk = craneLib.buildPackage { kifu-gtk = craneLib.buildPackage {
pname = "kifu-gtk"; pname = "kifu-gtk";
version = "0.1.0"; version = "0.1.0";
src = craneLib.cleanCargoSource (craneLib.path ./.); src = craneLib.cleanCargoSource (craneLib.path ./.);
cargoExtraArgs = "-p kifu-gtk"; cargoExtraArgs = "-p kifu-gtk";
nativeBuildInputs = with pkgs; [ nativeBuildInputs = with pkgs; [
pkg-config
glib glib
gtk4 gtk4
]; ];
buildInputs = with pkgs; [
pkg-config
];
inherit kifu-gtk-deps;
}; };
}; };
}; };