2022-02-23 15:56:10 +01:00
|
|
|
{ buildPackages, callPackage, stdenv, runCommand }@prev:
|
2020-10-01 17:51:46 -04:00
|
|
|
|
2023-01-12 12:22:07 -05:00
|
|
|
{ rustc
|
|
|
|
, cargo
|
|
|
|
, cargo-auditable ? null
|
|
|
|
, stdenv ? prev.stdenv
|
|
|
|
, ...
|
|
|
|
}:
|
2020-10-01 17:51:46 -04:00
|
|
|
|
|
|
|
rec {
|
|
|
|
rust = {
|
|
|
|
inherit rustc cargo;
|
|
|
|
};
|
|
|
|
|
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
|
|
|
};
|
|
|
|
|
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
|
2023-01-12 12:22:07 -05:00
|
|
|
fetchCargoTarball 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
|
2021-02-11 17:32:47 +01:00
|
|
|
inherit (callPackage ../../../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;
|
2020-10-01 17:51:46 -04:00
|
|
|
}
|