forked from mirrors/nixpkgs
Merge pull request #44967 from Ekleog/rust-patch
buildRustPackage: allow patches to fix Cargo.lock
This commit is contained in:
commit
3dc78e6ae9
|
@ -7,6 +7,7 @@ in
|
|||
{ name, cargoSha256 ? "unset"
|
||||
, src ? null
|
||||
, srcs ? null
|
||||
, patches ? []
|
||||
, sourceRoot ? null
|
||||
, logLevel ? ""
|
||||
, buildInputs ? []
|
||||
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue