mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 08:23:09 +00:00
buildRustPackage: add useFetchCargoVendor flag
This commit is contained in:
parent
1911b1e399
commit
37ce479c7b
@ -1,6 +1,7 @@
|
||||
{ lib
|
||||
, importCargoLock
|
||||
, fetchCargoTarball
|
||||
, fetchCargoVendor
|
||||
, stdenv
|
||||
, callPackage
|
||||
, cargoBuildHook
|
||||
@ -36,6 +37,7 @@
|
||||
, cargoDepsHook ? ""
|
||||
, buildType ? "release"
|
||||
, meta ? {}
|
||||
, useFetchCargoVendor ? false
|
||||
, cargoLock ? null
|
||||
, cargoVendorDir ? null
|
||||
, checkType ? buildType
|
||||
@ -67,6 +69,12 @@ let
|
||||
cargoDeps =
|
||||
if cargoVendorDir != null then null
|
||||
else if cargoLock != null then importCargoLock cargoLock
|
||||
else if useFetchCargoVendor then (fetchCargoVendor {
|
||||
inherit src srcs sourceRoot preUnpack unpackPhase postUnpack;
|
||||
name = cargoDepsName;
|
||||
patches = cargoPatches;
|
||||
hash = args.cargoHash;
|
||||
} // depsExtraArgs)
|
||||
else fetchCargoTarball ({
|
||||
inherit src srcs sourceRoot preUnpack unpackPhase postUnpack cargoUpdateHook;
|
||||
name = cargoDepsName;
|
||||
|
@ -22,7 +22,7 @@ rec {
|
||||
|
||||
buildRustPackage = callPackage ../../../build-support/rust/build-rust-package {
|
||||
inherit stdenv cargoBuildHook cargoCheckHook cargoInstallHook cargoNextestHook cargoSetupHook
|
||||
fetchCargoTarball importCargoLock rustc cargo cargo-auditable;
|
||||
fetchCargoTarball fetchCargoVendor importCargoLock rustc cargo cargo-auditable;
|
||||
};
|
||||
|
||||
importCargoLock = buildPackages.callPackage ../../../build-support/rust/import-cargo-lock.nix { inherit cargo; };
|
||||
|
Loading…
Reference in New Issue
Block a user