mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 06:53:01 +00:00
minor clean up
This commit is contained in:
parent
116ac11652
commit
dec97eb3e9
@ -77,6 +77,7 @@ let
|
||||
'';
|
||||
|
||||
targetIsJSON = stdenv.lib.hasSuffix ".json" target;
|
||||
useSysroot = targetIsJSON && !__internal_dontAddSysroot;
|
||||
|
||||
# see https://github.com/rust-lang/cargo/blob/964a16a28e234a3d397b2a7031d4ab4a428b1391/src/cargo/core/compiler/compile_kind.rs#L151-L168
|
||||
# the "${}" is needed to transform the path into a /nix/store path before baseNameOf
|
||||
@ -202,8 +203,8 @@ stdenv.mkDerivation ((removeAttrs args ["depsExtraArgs"]) // {
|
||||
"CXX_${rust.toRustTarget stdenv.buildPlatform}"="${cxxForBuild}" \
|
||||
"CC_${rust.toRustTarget stdenv.hostPlatform}"="${ccForHost}" \
|
||||
"CXX_${rust.toRustTarget stdenv.hostPlatform}"="${cxxForHost}" \
|
||||
${stdenv.lib.optionalString
|
||||
(targetIsJSON && !__internal_dontAddSysroot) "RUSTFLAGS=\"--sysroot ${sysroot} $RUSTFLAGS\" "
|
||||
${stdenv.lib.optionalString useSysroot
|
||||
"RUSTFLAGS=\"--sysroot ${sysroot} $RUSTFLAGS\" "
|
||||
}cargo build -j $NIX_BUILD_CORES \
|
||||
${stdenv.lib.optionalString (buildType == "release") "--release"} \
|
||||
--target ${target} \
|
||||
|
Loading…
Reference in New Issue
Block a user