mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-17 07:13:23 +01:00
use rustcSrc
This commit is contained in:
parent
015d4e2e98
commit
a153be896f
2 changed files with 12 additions and 18 deletions
|
@ -2,24 +2,18 @@
|
|||
|
||||
{ shortTarget, originalCargoToml, target, RUSTFLAGS }:
|
||||
|
||||
let rustSrc = stdenv.mkDerivation {
|
||||
name = "rust-src";
|
||||
src = rustPlatform.rust.rustc.src;
|
||||
preferLocalBuild = true;
|
||||
phases = [ "unpackPhase" "installPhase" ];
|
||||
installPhase = "cp -r src $out";
|
||||
};
|
||||
let
|
||||
cargoSrc = stdenv.mkDerivation {
|
||||
name = "cargo-src";
|
||||
preferLocalBuild = true;
|
||||
phases = [ "installPhase" ];
|
||||
installPhase = ''
|
||||
RUSTC_SRC=${rustSrc} ORIG_CARGO=${originalCargoToml} \
|
||||
${buildPackages.python3.withPackages (ps: with ps; [ toml ])}/bin/python3 ${./cargo.py}
|
||||
mkdir -p $out
|
||||
cp Cargo.toml $out/Cargo.toml
|
||||
cp ${./Cargo.lock} $out/Cargo.lock
|
||||
'';
|
||||
name = "cargo-src";
|
||||
preferLocalBuild = true;
|
||||
phases = [ "installPhase" ];
|
||||
installPhase = ''
|
||||
RUSTC_SRC=${rustPlatform.rustcSrc} ORIG_CARGO=${originalCargoToml} \
|
||||
${buildPackages.python3.withPackages (ps: with ps; [ toml ])}/bin/python3 ${./cargo.py}
|
||||
mkdir -p $out
|
||||
cp Cargo.toml $out/Cargo.toml
|
||||
cp ${./Cargo.lock} $out/Cargo.lock
|
||||
'';
|
||||
};
|
||||
in rustPlatform.buildRustPackage {
|
||||
inherit target RUSTFLAGS;
|
||||
|
|
|
@ -6,6 +6,6 @@ stdenv.mkDerivation {
|
|||
phases = [ "unpackPhase" "installPhase" ];
|
||||
installPhase = ''
|
||||
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…
Reference in a new issue