Merge pull request #143076 from lovesegfault/make-rust-platform-stdenv

makeRustPlatform: allow to easily override stdenv
This commit is contained in:
Jörg Thalheim 2021-10-27 10:07:39 +02:00 committed by GitHub
commit 578415d9be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,6 @@
{ buildPackages, callPackage }: { buildPackages, callPackage, stdenv }@prev:
{ rustc, cargo, ... }: { rustc, cargo, stdenv ? prev.stdenv, ... }:
rec { rec {
rust = { rust = {
@ -9,27 +9,27 @@ rec {
fetchCargoTarball = buildPackages.callPackage ../../../build-support/rust/fetchCargoTarball.nix { fetchCargoTarball = buildPackages.callPackage ../../../build-support/rust/fetchCargoTarball.nix {
git = buildPackages.gitMinimal; git = buildPackages.gitMinimal;
inherit cargo; inherit stdenv cargo;
}; };
buildRustPackage = callPackage ../../../build-support/rust { buildRustPackage = callPackage ../../../build-support/rust {
git = buildPackages.gitMinimal; git = buildPackages.gitMinimal;
inherit cargoBuildHook cargoCheckHook cargoInstallHook cargoSetupHook inherit stdenv cargoBuildHook cargoCheckHook cargoInstallHook cargoSetupHook
fetchCargoTarball importCargoLock rustc; fetchCargoTarball importCargoLock rustc;
}; };
importCargoLock = buildPackages.callPackage ../../../build-support/rust/import-cargo-lock.nix {}; importCargoLock = buildPackages.callPackage ../../../build-support/rust/import-cargo-lock.nix {};
rustcSrc = callPackage ./rust-src.nix { rustcSrc = callPackage ./rust-src.nix {
inherit rustc; inherit stdenv rustc;
}; };
rustLibSrc = callPackage ./rust-lib-src.nix { rustLibSrc = callPackage ./rust-lib-src.nix {
inherit rustc; inherit stdenv rustc;
}; };
# Hooks # Hooks
inherit (callPackage ../../../build-support/rust/hooks { inherit (callPackage ../../../build-support/rust/hooks {
inherit cargo rustc; inherit stdenv cargo rustc;
}) cargoBuildHook cargoCheckHook cargoInstallHook cargoSetupHook maturinBuildHook; }) cargoBuildHook cargoCheckHook cargoInstallHook cargoSetupHook maturinBuildHook;
} }