buildRustCrate: rename makeDeps
function to mkRustcDepArgs
This should carry the function better then `makeDeps` as it isn't producing deps but the rustc arguments required to link against those.
This commit is contained in:
parent
f4aeabd04a
commit
d37f001164
@ -1,4 +1,4 @@
|
||||
{ lib, stdenv, echo_build_heading, noisily, makeDeps, rust }:
|
||||
{ lib, stdenv, echo_build_heading, noisily, mkRustcDepArgs, rust }:
|
||||
{ crateName,
|
||||
dependencies,
|
||||
crateFeatures, crateRenames, libName, release, libPath,
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
let
|
||||
|
||||
deps = makeDeps dependencies crateRenames;
|
||||
deps = mkRustcDepArgs dependencies crateRenames;
|
||||
rustcOpts =
|
||||
lib.foldl' (opts: opt: opts + " " + opt)
|
||||
(if release then "-C opt-level=3" else "-C debuginfo=2")
|
||||
|
@ -1,4 +1,4 @@
|
||||
{ lib, stdenv, echo_build_heading, noisily, makeDeps }:
|
||||
{ lib, stdenv, echo_build_heading, noisily, mkRustcDepArgs }:
|
||||
{ build
|
||||
, buildDependencies
|
||||
, colors
|
||||
@ -25,7 +25,7 @@ let version_ = lib.splitString "-" crateVersion;
|
||||
rustcOpts = lib.foldl' (opts: opt: opts + " " + opt)
|
||||
(if release then "-C opt-level=3" else "-C debuginfo=2")
|
||||
(["-C codegen-units=$NIX_BUILD_CORES"] ++ extraRustcOpts);
|
||||
buildDeps = makeDeps buildDependencies crateRenames;
|
||||
buildDeps = mkRustcDepArgs buildDependencies crateRenames;
|
||||
authors = lib.concatStringsSep ":" crateAuthors;
|
||||
optLevel = if release then 3 else 0;
|
||||
completeDepsDir = lib.concatStringsSep " " completeDeps;
|
||||
|
@ -13,7 +13,9 @@ let
|
||||
then "macos"
|
||||
else stdenv.hostPlatform.parsed.kernel.name;
|
||||
|
||||
makeDeps = dependencies: crateRenames:
|
||||
# Create rustc arguments to link against the given list of dependencies and
|
||||
# renames
|
||||
mkRustcDepArgs = dependencies: crateRenames:
|
||||
lib.concatMapStringsSep " " (dep:
|
||||
let
|
||||
extern = lib.replaceStrings ["-"] ["_"] dep.libName;
|
||||
@ -27,15 +29,14 @@ let
|
||||
" --extern ${name}=${dep.lib}/lib/lib${extern}-${dep.metadata}${stdenv.hostPlatform.extensions.sharedLibrary}")
|
||||
) dependencies;
|
||||
|
||||
|
||||
inherit (import ./log.nix { inherit lib; }) noisily echo_build_heading;
|
||||
|
||||
configureCrate = import ./configure-crate.nix {
|
||||
inherit lib stdenv echo_build_heading noisily makeDeps;
|
||||
inherit lib stdenv echo_build_heading noisily mkRustcDepArgs;
|
||||
};
|
||||
|
||||
buildCrate = import ./build-crate.nix {
|
||||
inherit lib stdenv echo_build_heading noisily makeDeps rust;
|
||||
inherit lib stdenv echo_build_heading noisily mkRustcDepArgs rust;
|
||||
};
|
||||
|
||||
installCrate = import ./install-crate.nix;
|
||||
|
Loading…
Reference in New Issue
Block a user