2024-04-21 15:54:59 +00:00
|
|
|
{ lib, buildPackages, callPackage, callPackages, cargo-auditable, stdenv, runCommand }@prev:
|
2020-10-16 20:44:37 +00:00
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
{ rustc
|
|
|
|
, cargo
|
2023-04-29 16:46:19 +00:00
|
|
|
, cargo-auditable ? prev.cargo-auditable
|
2023-01-20 10:41:00 +00:00
|
|
|
, stdenv ? prev.stdenv
|
|
|
|
, ...
|
|
|
|
}:
|
2020-10-16 20:44:37 +00:00
|
|
|
|
|
|
|
rec {
|
|
|
|
rust = {
|
2023-05-24 13:37:59 +00:00
|
|
|
rustc = lib.warn "rustPlatform.rust.rustc is deprecated. Use rustc instead." rustc;
|
|
|
|
cargo = lib.warn "rustPlatform.rust.cargo is deprecated. Use cargo instead." cargo;
|
2020-10-16 20:44:37 +00:00
|
|
|
};
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
fetchCargoTarball = buildPackages.callPackage ../../../build-support/rust/fetch-cargo-tarball {
|
2021-06-28 23:13:55 +00:00
|
|
|
git = buildPackages.gitMinimal;
|
2021-12-06 16:07:01 +00:00
|
|
|
inherit cargo;
|
2020-10-16 20:44:37 +00:00
|
|
|
};
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
buildRustPackage = callPackage ../../../build-support/rust/build-rust-package {
|
2022-12-17 10:02:37 +00:00
|
|
|
inherit stdenv cargoBuildHook cargoCheckHook cargoInstallHook cargoNextestHook cargoSetupHook
|
2023-01-20 10:41:00 +00:00
|
|
|
fetchCargoTarball importCargoLock rustc cargo cargo-auditable;
|
2020-10-16 20:44:37 +00:00
|
|
|
};
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
importCargoLock = buildPackages.callPackage ../../../build-support/rust/import-cargo-lock.nix { inherit cargo; };
|
2021-05-29 03:34:57 +00:00
|
|
|
|
2020-10-16 20:44:37 +00:00
|
|
|
rustcSrc = callPackage ./rust-src.nix {
|
2022-03-10 19:12:11 +00:00
|
|
|
inherit runCommand rustc;
|
2020-10-16 20:44:37 +00:00
|
|
|
};
|
2020-11-09 15:59:12 +00:00
|
|
|
|
|
|
|
rustLibSrc = callPackage ./rust-lib-src.nix {
|
2022-03-10 19:12:11 +00:00
|
|
|
inherit runCommand rustc;
|
2020-11-09 15:59:12 +00:00
|
|
|
};
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
# Hooks
|
2024-04-21 15:54:59 +00:00
|
|
|
inherit (callPackages ../../../build-support/rust/hooks {
|
2021-10-28 06:52:43 +00:00
|
|
|
inherit stdenv cargo rustc;
|
2022-12-17 10:02:37 +00:00
|
|
|
}) cargoBuildHook cargoCheckHook cargoInstallHook cargoNextestHook cargoSetupHook maturinBuildHook bindgenHook;
|
2020-10-16 20:44:37 +00:00
|
|
|
}
|