mirror of
https://github.com/nix-community/naersk
synced 2024-11-10 14:14:14 +00:00
Add global cargo options to config
This commit is contained in:
parent
551a2a6339
commit
b9310fdcf7
2 changed files with 7 additions and 2 deletions
|
@ -37,6 +37,7 @@
|
||||||
, buildInputs
|
, buildInputs
|
||||||
, builtDependencies
|
, builtDependencies
|
||||||
, release
|
, release
|
||||||
|
, cargoOptions
|
||||||
, stdenv
|
, stdenv
|
||||||
, lib
|
, lib
|
||||||
, rsync
|
, rsync
|
||||||
|
@ -104,6 +105,7 @@ let
|
||||||
|
|
||||||
configurePhase = ''
|
configurePhase = ''
|
||||||
cargo_release=( ${lib.optionalString release "--release" } )
|
cargo_release=( ${lib.optionalString release "--release" } )
|
||||||
|
cargo_options=( ${lib.escapeShellArgs cargoOptions} )
|
||||||
|
|
||||||
runHook preConfigure
|
runHook preConfigure
|
||||||
|
|
||||||
|
|
|
@ -14,14 +14,16 @@ let
|
||||||
root = attrs0.root or null;
|
root = attrs0.root or null;
|
||||||
# The command to use for the build.
|
# The command to use for the build.
|
||||||
cargoBuild = attrs0.cargoBuild or
|
cargoBuild = attrs0.cargoBuild or
|
||||||
''cargo build "''${cargo_release}" -j $NIX_BUILD_CORES -Z unstable-options --out-dir out'';
|
''cargo "''${cargo_options[@]}" build "''${cargo_release[@]}" -j $NIX_BUILD_CORES -Z unstable-options --out-dir out'';
|
||||||
# When true, `checkPhase` is run.
|
# When true, `checkPhase` is run.
|
||||||
doCheck = attrs0.doCheck or true;
|
doCheck = attrs0.doCheck or true;
|
||||||
# The commands to run in the `checkPhase`.
|
# The commands to run in the `checkPhase`.
|
||||||
cargoTestCommands = attrs0.cargoTestCommands or
|
cargoTestCommands = attrs0.cargoTestCommands or
|
||||||
[ ''cargo test "''${cargo_release}" -j $NIX_BUILD_CORES'' ];
|
[ ''cargo "''${cargo_options[@]}" test "''${cargo_release[@]}" -j $NIX_BUILD_CORES'' ];
|
||||||
# Extra `buildInputs` to all derivations.
|
# Extra `buildInputs` to all derivations.
|
||||||
buildInputs = attrs0.buildInputs or [];
|
buildInputs = attrs0.buildInputs or [];
|
||||||
|
# Options passed to cargo before the command (cargo OPTIONS <cmd>)
|
||||||
|
cargoOptions = attrs0.cargoOptions or [];
|
||||||
# When true, `cargo doc` is run and a new output `doc` is generated.
|
# When true, `cargo doc` is run and a new output `doc` is generated.
|
||||||
doDoc = attrs0.doDoc or true;
|
doDoc = attrs0.doDoc or true;
|
||||||
# When true, all cargo builds are run with `--release`.
|
# When true, all cargo builds are run with `--release`.
|
||||||
|
@ -109,6 +111,7 @@ let
|
||||||
buildConfig = {
|
buildConfig = {
|
||||||
compressTarget = attrs.compressTarget;
|
compressTarget = attrs.compressTarget;
|
||||||
doCheck = attrs.doCheck;
|
doCheck = attrs.doCheck;
|
||||||
|
cargoOptions = attrs.cargoOptions;
|
||||||
buildInputs = attrs.buildInputs;
|
buildInputs = attrs.buildInputs;
|
||||||
removeReferencesToSrcFromDocs = attrs.removeReferencesToSrcFromDocs;
|
removeReferencesToSrcFromDocs = attrs.removeReferencesToSrcFromDocs;
|
||||||
doDoc = attrs.doDoc;
|
doDoc = attrs.doDoc;
|
||||||
|
|
Loading…
Reference in a new issue