buildRustPackage: factor out build phase to cargoBuildHook

- API change: remove the `target` argument of `buildRustPackage`, the
  target should always be in sync with the C/C++ compiler that is used.

- Gathering of binaries has moved from `buildPhase` to `installPhase`,
  this simplifies the hook and orders this functionality logically
  with the installation logic.
This commit is contained in:
Daniël de Kok
2021-02-11 17:32:47 +01:00
parent 198dd77635
commit a8efb2053f
4 changed files with 75 additions and 45 deletions

View File

@@ -12,7 +12,7 @@ rec {
};
buildRustPackage = callPackage ../../../build-support/rust {
inherit rustc cargo cargoSetupHook fetchCargoTarball;
inherit rustc cargo cargoBuildHook cargoSetupHook fetchCargoTarball;
};
rustcSrc = callPackage ./rust-src.nix {
@@ -24,5 +24,7 @@ rec {
};
# Hooks
inherit (callPackage ../../../build-support/rust/hooks { }) cargoSetupHook;
inherit (callPackage ../../../build-support/rust/hooks {
inherit cargo;
}) cargoBuildHook cargoSetupHook;
}