3
0
Fork 0
forked from mirrors/nixpkgs

buildRustPackage: Avoid altering .cargo/config in source

This commit is contained in:
Atkins 2019-07-26 00:48:18 +08:00 committed by Jörg Thalheim
parent b53e237ef6
commit 626ccd7121
No known key found for this signature in database
GPG key ID: B3F5D81B0C6967C4

View file

@ -72,14 +72,6 @@ in stdenv.mkDerivation (args // {
substitute $config .cargo/config \
--subst-var-by vendor "$(pwd)/$cargoDepsCopy"
unset cargoDepsCopy
export RUST_LOG=${logLevel}
'' + (args.postUnpack or "");
configurePhase = args.configurePhase or ''
runHook preConfigure
mkdir -p .cargo
cat >> .cargo/config <<'EOF'
[target."${stdenv.buildPlatform.config}"]
"linker" = "${ccForBuild}"
@ -89,6 +81,13 @@ in stdenv.mkDerivation (args // {
''}
EOF
cat .cargo/config
unset cargoDepsCopy
export RUST_LOG=${logLevel}
'' + (args.postUnpack or "");
configurePhase = args.configurePhase or ''
runHook preConfigure
runHook postConfigure
'';