2024-06-30 08:16:52 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPackages,
|
|
|
|
callPackage,
|
|
|
|
callPackages,
|
|
|
|
cargo-auditable,
|
|
|
|
stdenv,
|
|
|
|
runCommand,
|
|
|
|
path,
|
|
|
|
}@prev:
|
2024-05-02 00:46:19 +00:00
|
|
|
|
2024-06-30 08:16:52 +00:00
|
|
|
{
|
|
|
|
rustc,
|
|
|
|
cargo,
|
|
|
|
cargo-auditable ? prev.cargo-auditable,
|
|
|
|
stdenv ? prev.stdenv,
|
|
|
|
...
|
2024-05-02 00:46:19 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rec {
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
2024-06-30 08:16:52 +00:00
|
|
|
fetchCargoTarball =
|
|
|
|
buildPackages.callPackage (path + "/pkgs/build-support/rust/fetch-cargo-tarball")
|
|
|
|
{
|
|
|
|
git = buildPackages.gitMinimal;
|
|
|
|
inherit cargo;
|
|
|
|
};
|
2024-05-02 00:46:19 +00:00
|
|
|
|
|
|
|
buildRustPackage = callPackage (path + "/pkgs/build-support/rust/build-rust-package") {
|
2024-06-30 08:16:52 +00:00
|
|
|
inherit
|
|
|
|
stdenv
|
|
|
|
cargoBuildHook
|
|
|
|
cargoCheckHook
|
|
|
|
cargoInstallHook
|
|
|
|
cargoNextestHook
|
|
|
|
cargoSetupHook
|
|
|
|
fetchCargoTarball
|
|
|
|
importCargoLock
|
|
|
|
rustc
|
|
|
|
cargo
|
|
|
|
cargo-auditable
|
|
|
|
;
|
2024-05-02 00:46:19 +00:00
|
|
|
};
|
|
|
|
|
2024-06-30 08:16:52 +00:00
|
|
|
importCargoLock = buildPackages.callPackage (
|
|
|
|
path + "/pkgs/build-support/rust/import-cargo-lock.nix"
|
|
|
|
) { inherit cargo; };
|
2024-05-02 00:46:19 +00:00
|
|
|
|
2024-06-30 08:16:52 +00:00
|
|
|
rustcSrc = callPackage ./rust-src.nix { inherit runCommand rustc; };
|
2024-05-02 00:46:19 +00:00
|
|
|
|
2024-06-30 08:16:52 +00:00
|
|
|
rustLibSrc = callPackage ./rust-lib-src.nix { inherit runCommand rustc; };
|
2024-05-02 00:46:19 +00:00
|
|
|
|
|
|
|
# Hooks
|
2024-06-30 08:16:52 +00:00
|
|
|
inherit (callPackages (path + "/pkgs/build-support/rust/hooks") { inherit stdenv cargo rustc; })
|
|
|
|
cargoBuildHook
|
|
|
|
cargoCheckHook
|
|
|
|
cargoInstallHook
|
|
|
|
cargoNextestHook
|
|
|
|
cargoSetupHook
|
|
|
|
maturinBuildHook
|
|
|
|
bindgenHook
|
|
|
|
;
|
2024-05-02 00:46:19 +00:00
|
|
|
}
|