2024-11-27 20:49:01 +01:00
|
|
|
{ lib, buildPackages, callPackage, callPackages, cargo-auditable, config, stdenv, runCommand }@prev:
|
2020-10-01 17:51:46 -04:00
|
|
|
|
2023-01-12 12:22:07 -05:00
|
|
|
{ rustc
|
|
|
|
, cargo
|
2023-04-13 10:12:52 -04:00
|
|
|
, cargo-auditable ? prev.cargo-auditable
|
2023-01-12 12:22:07 -05:00
|
|
|
, stdenv ? prev.stdenv
|
|
|
|
, ...
|
|
|
|
}:
|
2020-10-01 17:51:46 -04:00
|
|
|
|
|
|
|
rec {
|
2021-11-01 21:48:55 -04:00
|
|
|
fetchCargoTarball = buildPackages.callPackage ../../../build-support/rust/fetch-cargo-tarball {
|
2021-06-13 04:54:49 +02:00
|
|
|
git = buildPackages.gitMinimal;
|
2021-10-28 23:25:35 -07:00
|
|
|
inherit cargo;
|
2020-10-01 17:51:46 -04:00
|
|
|
};
|
|
|
|
|
2024-10-17 22:10:47 +02:00
|
|
|
fetchCargoVendor = buildPackages.callPackage ../../../build-support/rust/fetch-cargo-vendor.nix { inherit cargo; };
|
|
|
|
|
2021-11-01 21:48:55 -04:00
|
|
|
buildRustPackage = callPackage ../../../build-support/rust/build-rust-package {
|
2022-11-28 17:00:17 -05:00
|
|
|
inherit stdenv cargoBuildHook cargoCheckHook cargoInstallHook cargoNextestHook cargoSetupHook
|
2024-10-21 22:21:06 +02:00
|
|
|
fetchCargoTarball fetchCargoVendor importCargoLock rustc cargo cargo-auditable;
|
2020-10-01 17:51:46 -04:00
|
|
|
};
|
|
|
|
|
2022-10-04 12:09:52 +02:00
|
|
|
importCargoLock = buildPackages.callPackage ../../../build-support/rust/import-cargo-lock.nix { inherit cargo; };
|
2021-05-08 07:40:34 +02:00
|
|
|
|
2020-10-01 17:51:46 -04:00
|
|
|
rustcSrc = callPackage ./rust-src.nix {
|
2022-02-23 15:56:10 +01:00
|
|
|
inherit runCommand rustc;
|
2020-10-01 17:51:46 -04:00
|
|
|
};
|
2020-11-07 00:31:25 +08:00
|
|
|
|
|
|
|
rustLibSrc = callPackage ./rust-lib-src.nix {
|
2022-02-23 15:56:10 +01:00
|
|
|
inherit runCommand rustc;
|
2020-11-07 00:31:25 +08:00
|
|
|
};
|
2021-02-09 11:38:25 +01:00
|
|
|
|
|
|
|
# Hooks
|
2024-02-26 10:52:06 +00:00
|
|
|
inherit (callPackages ../../../build-support/rust/hooks {
|
2021-10-26 22:04:25 -07:00
|
|
|
inherit stdenv cargo rustc;
|
2022-11-28 17:00:17 -05:00
|
|
|
}) cargoBuildHook cargoCheckHook cargoInstallHook cargoNextestHook cargoSetupHook maturinBuildHook bindgenHook;
|
2024-11-27 20:49:01 +01:00
|
|
|
} // lib.optionalAttrs config.allowAliases {
|
|
|
|
rust = {
|
|
|
|
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-01 17:51:46 -04:00
|
|
|
}
|