forked from mirrors/nixpkgs
Merge pull request #161533 from Stunkymonkey/rust-{lib-}src-phases
rust-{lib-}src: deprecate phases
This commit is contained in:
commit
5625298330
|
@ -1,4 +1,4 @@
|
|||
{ buildPackages, callPackage, stdenv }@prev:
|
||||
{ buildPackages, callPackage, stdenv, runCommand }@prev:
|
||||
|
||||
{ rustc, cargo, stdenv ? prev.stdenv, ... }:
|
||||
|
||||
|
@ -21,11 +21,11 @@ rec {
|
|||
importCargoLock = buildPackages.callPackage ../../../build-support/rust/import-cargo-lock.nix {};
|
||||
|
||||
rustcSrc = callPackage ./rust-src.nix {
|
||||
inherit stdenv rustc;
|
||||
inherit runCommand rustc;
|
||||
};
|
||||
|
||||
rustLibSrc = callPackage ./rust-lib-src.nix {
|
||||
inherit stdenv rustc;
|
||||
inherit runCommand rustc;
|
||||
};
|
||||
|
||||
# Hooks
|
||||
|
|
|
@ -1,11 +1,6 @@
|
|||
{ stdenv, rustc }:
|
||||
{ runCommand, rustc }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "rust-lib-src";
|
||||
src = rustc.src;
|
||||
phases = [ "unpackPhase" "installPhase" ];
|
||||
|
||||
installPhase = ''
|
||||
mv library $out
|
||||
'';
|
||||
}
|
||||
runCommand "rust-lib-src" { } ''
|
||||
tar --strip-components=1 -xzf ${rustc.src}
|
||||
mv library $out
|
||||
''
|
||||
|
|
|
@ -1,25 +1,21 @@
|
|||
{ lib, stdenv, rustc, minimalContent ? true }:
|
||||
{ lib, runCommand, rustc, minimalContent ? true }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "rust-src";
|
||||
src = rustc.src;
|
||||
phases = [ "unpackPhase" "installPhase" ];
|
||||
installPhase = ''
|
||||
mv src $out
|
||||
rm -rf $out/{${lib.concatStringsSep "," ([
|
||||
"ci"
|
||||
"doc"
|
||||
"etc"
|
||||
"grammar"
|
||||
"llvm-project"
|
||||
"llvm-emscripten"
|
||||
"rtstartup"
|
||||
"rustllvm"
|
||||
"test"
|
||||
"vendor"
|
||||
] ++ lib.optionals minimalContent [
|
||||
"tools"
|
||||
"stdarch"
|
||||
])}}
|
||||
'';
|
||||
}
|
||||
runCommand "rust-src" { } ''
|
||||
tar -xzf ${rustc.src}
|
||||
mv rustc-${rustc.version}-src $out
|
||||
rm -rf $out/{${lib.concatStringsSep "," ([
|
||||
"ci"
|
||||
"doc"
|
||||
"etc"
|
||||
"grammar"
|
||||
"llvm-project"
|
||||
"llvm-emscripten"
|
||||
"rtstartup"
|
||||
"rustllvm"
|
||||
"test"
|
||||
"vendor"
|
||||
] ++ lib.optionals minimalContent [
|
||||
"tools"
|
||||
"stdarch"
|
||||
])}}
|
||||
''
|
||||
|
|
Loading…
Reference in a new issue