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.

+12 -5
+12 -5
pkgs/build-support/rust/fetch-cargo-vendor.nix
··· 35 name ? if args ? pname && args ? version then "${args.pname}-${args.version}" else "cargo-deps", 36 hash ? (throw "fetchCargoVendor requires a `hash` value to be set for ${name}"), 37 nativeBuildInputs ? [ ], 38 ... 39 }@args: 40 ··· 53 { 54 name = "${name}-vendor-staging"; 55 56 - nativeBuildInputs = [ 57 - fetchCargoVendorUtil 58 - nix-prefetch-git 59 - cacert 60 - ] ++ nativeBuildInputs; 61 62 buildPhase = '' 63 runHook preBuild
··· 35 name ? if args ? pname && args ? version then "${args.pname}-${args.version}" else "cargo-deps", 36 hash ? (throw "fetchCargoVendor requires a `hash` value to be set for ${name}"), 37 nativeBuildInputs ? [ ], 38 + # This is mostly for breaking infinite recursion where dependencies 39 + # of nix-prefetch-git use fetchCargoVendor. 40 + allowGitDependencies ? true, 41 ... 42 }@args: 43 ··· 56 { 57 name = "${name}-vendor-staging"; 58 59 + nativeBuildInputs = 60 + [ 61 + fetchCargoVendorUtil 62 + cacert 63 + ] 64 + ++ lib.optionals allowGitDependencies [ 65 + nix-prefetch-git 66 + ] 67 + ++ nativeBuildInputs; 68 69 buildPhase = '' 70 runHook preBuild