Commit f07977cf authored by Alyssa Ross's avatar Alyssa Ross
Browse files

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.
parent 50d16c29
Loading
Loading
Loading
Loading
+12 −5
Original line number Diff line number Diff line
@@ -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 = [
      nativeBuildInputs =
        [
          fetchCargoVendorUtil
        nix-prefetch-git
          cacert
      ] ++ nativeBuildInputs;
        ]
        ++ lib.optionals allowGitDependencies [
          nix-prefetch-git
        ]
        ++ nativeBuildInputs;

      buildPhase = ''
        runHook preBuild