rustPlatform.fetchCargoVendor: add allowGitDependencies
This will make it possible to use fetchCargoVendor for packages that are in the dependency graph of nix-prefetch-git, by having them opt out of having nix-prefetch-git involved in fetching their dependencies.
This commit is contained in:
@@ -35,6 +35,9 @@ in
|
||||
name ? if args ? pname && args ? version then "${args.pname}-${args.version}" else "cargo-deps",
|
||||
hash ? (throw "fetchCargoVendor requires a `hash` value to be set for ${name}"),
|
||||
nativeBuildInputs ? [ ],
|
||||
# This is mostly for breaking infinite recursion where dependencies
|
||||
# of nix-prefetch-git use fetchCargoVendor.
|
||||
allowGitDependencies ? true,
|
||||
...
|
||||
}@args:
|
||||
|
||||
@@ -53,11 +56,15 @@ let
|
||||
{
|
||||
name = "${name}-vendor-staging";
|
||||
|
||||
nativeBuildInputs = [
|
||||
fetchCargoVendorUtil
|
||||
nix-prefetch-git
|
||||
cacert
|
||||
] ++ nativeBuildInputs;
|
||||
nativeBuildInputs =
|
||||
[
|
||||
fetchCargoVendorUtil
|
||||
cacert
|
||||
]
|
||||
++ lib.optionals allowGitDependencies [
|
||||
nix-prefetch-git
|
||||
]
|
||||
++ nativeBuildInputs;
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
Reference in New Issue
Block a user