use rustcSrc
This commit is contained in:
parent
015d4e2e98
commit
a153be896f
@ -2,24 +2,18 @@
|
|||||||
|
|
||||||
{ shortTarget, originalCargoToml, target, RUSTFLAGS }:
|
{ shortTarget, originalCargoToml, target, RUSTFLAGS }:
|
||||||
|
|
||||||
let rustSrc = stdenv.mkDerivation {
|
let
|
||||||
name = "rust-src";
|
|
||||||
src = rustPlatform.rust.rustc.src;
|
|
||||||
preferLocalBuild = true;
|
|
||||||
phases = [ "unpackPhase" "installPhase" ];
|
|
||||||
installPhase = "cp -r src $out";
|
|
||||||
};
|
|
||||||
cargoSrc = stdenv.mkDerivation {
|
cargoSrc = stdenv.mkDerivation {
|
||||||
name = "cargo-src";
|
name = "cargo-src";
|
||||||
preferLocalBuild = true;
|
preferLocalBuild = true;
|
||||||
phases = [ "installPhase" ];
|
phases = [ "installPhase" ];
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
RUSTC_SRC=${rustSrc} ORIG_CARGO=${originalCargoToml} \
|
RUSTC_SRC=${rustPlatform.rustcSrc} ORIG_CARGO=${originalCargoToml} \
|
||||||
${buildPackages.python3.withPackages (ps: with ps; [ toml ])}/bin/python3 ${./cargo.py}
|
${buildPackages.python3.withPackages (ps: with ps; [ toml ])}/bin/python3 ${./cargo.py}
|
||||||
mkdir -p $out
|
mkdir -p $out
|
||||||
cp Cargo.toml $out/Cargo.toml
|
cp Cargo.toml $out/Cargo.toml
|
||||||
cp ${./Cargo.lock} $out/Cargo.lock
|
cp ${./Cargo.lock} $out/Cargo.lock
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
in rustPlatform.buildRustPackage {
|
in rustPlatform.buildRustPackage {
|
||||||
inherit target RUSTFLAGS;
|
inherit target RUSTFLAGS;
|
||||||
|
@ -6,6 +6,6 @@ stdenv.mkDerivation {
|
|||||||
phases = [ "unpackPhase" "installPhase" ];
|
phases = [ "unpackPhase" "installPhase" ];
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mv src $out
|
mv src $out
|
||||||
rm -rf $out/{ci,doc,etc,grammar,llvm-project,llvm-emscripten,rtstartup,rustllvm,test,tools,vendor,stdarch}
|
rm -rf $out/{ci,doc,etc,grammar,llvm-project,llvm-emscripten,rtstartup,rustllvm,test,vendor}
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user