3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/compilers/rust/make-rust-platform.nix
John Ericson 18ed048c7b build-support/rust: Organize
- `toRustTarget` and friends pulled out from rust tools into rust
   library. Since they don't depend on any packages they can be more
   widely useable.

 - `build-rust-package` gets its own directory

 - `fetch-cargo-tarball` gets its own directory
2021-11-07 14:16:49 -05:00

36 lines
994 B
Nix

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