Skip to content

Commit

Permalink
buildRustPackage: allow patches to fix Cargo.lock
Browse files Browse the repository at this point in the history
  • Loading branch information
Ekleog committed Aug 13, 2018
1 parent f8e8ecd commit b6e881a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion pkgs/build-support/rust/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ in
{ name, cargoSha256 ? "unset"
, src ? null
, srcs ? null
, patches ? []
, sourceRoot ? null
, logLevel ? ""
, buildInputs ? []
Expand All @@ -22,7 +23,7 @@ assert cargoVendorDir == null -> cargoSha256 != "unset";
let
cargoDeps = if cargoVendorDir == null
then fetchcargo {
inherit name src srcs sourceRoot cargoUpdateHook;
inherit name src srcs patches sourceRoot cargoUpdateHook;
sha256 = cargoSha256;
}
else null;
Expand Down
6 changes: 3 additions & 3 deletions pkgs/build-support/rust/fetchcargo.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{ stdenv, cacert, git, rust, cargo-vendor }:
{ name ? "cargo-deps", src, srcs, sourceRoot, sha256, cargoUpdateHook ? "" }:
{ name ? "cargo-deps", src, srcs, patches, sourceRoot, sha256, cargoUpdateHook ? "" }:
stdenv.mkDerivation {
name = "${name}-vendor";
nativeBuildInputs = [ cacert cargo-vendor git rust.cargo ];
inherit src srcs sourceRoot;
inherit src srcs patches sourceRoot;

phases = "unpackPhase installPhase";
phases = "unpackPhase patchPhase installPhase";

installPhase = ''
if [[ ! -f Cargo.lock ]]; then
Expand Down

0 comments on commit b6e881a

Please sign in to comment.