buildRustCrate: deduplicate dependency override code
The previous lines were only different in the kind of dependencies but otherwise exactly the same. It makes the entire thing a bit more readable by moving this into a function that takes care of this.
This commit is contained in:
parent
6ad22f5b4d
commit
3f49d7a3ea
1 changed files with 2 additions and 9 deletions
|
@ -81,15 +81,8 @@ stdenv.mkDerivation (rec {
|
|||
name = "rust_${crate.crateName}-${crate.version}";
|
||||
depsBuildBuild = [ rust stdenv.cc ];
|
||||
buildInputs = (crate.buildInputs or []) ++ buildInputs_;
|
||||
dependencies =
|
||||
map
|
||||
(dep: lib.getLib (dep.override { rust = rust; release = release; verbose = verbose; crateOverrides = crateOverrides; }))
|
||||
dependencies_;
|
||||
|
||||
buildDependencies =
|
||||
map
|
||||
(dep: lib.getLib (dep.override { rust = rust; release = release; verbose = verbose; crateOverrides = crateOverrides; }))
|
||||
buildDependencies_;
|
||||
dependencies = makeDependencies dependencies_;
|
||||
buildDependencies = makeDependencies buildDependencies_;
|
||||
|
||||
completeDeps = lib.unique (dependencies ++ lib.concatMap (dep: dep.completeDeps) dependencies);
|
||||
completeBuildDeps = lib.unique (
|
||||
|
|
Loading…
Reference in a new issue