diff options
author | Felix Buehler <account@buehler.rocks> | 2022-02-23 15:56:10 +0100 |
---|---|---|
committer | Felix Buehler <account@buehler.rocks> | 2022-02-25 22:57:59 +0100 |
commit | 916a86aa2fb3cf2c1184bfb463266e935300365c (patch) | |
tree | fd23cee7bff0e9b4eb28b9cdd9ee6c066ab05397 /pkgs/development/compilers/rust | |
parent | f4b8977e0b3182d94c7d2c5185df047815c98935 (diff) |
rust-{lib-}src: deprecate phases
Diffstat (limited to 'pkgs/development/compilers/rust')
-rw-r--r-- | pkgs/development/compilers/rust/make-rust-platform.nix | 6 | ||||
-rw-r--r-- | pkgs/development/compilers/rust/rust-lib-src.nix | 15 | ||||
-rw-r--r-- | pkgs/development/compilers/rust/rust-src.nix | 44 |
3 files changed, 28 insertions, 37 deletions
diff --git a/pkgs/development/compilers/rust/make-rust-platform.nix b/pkgs/development/compilers/rust/make-rust-platform.nix index 2071c48cc6d5e..b859d01dc0859 100644 --- a/pkgs/development/compilers/rust/make-rust-platform.nix +++ b/pkgs/development/compilers/rust/make-rust-platform.nix @@ -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 diff --git a/pkgs/development/compilers/rust/rust-lib-src.nix b/pkgs/development/compilers/rust/rust-lib-src.nix index 67a7fa3641ad2..aa914338639d7 100644 --- a/pkgs/development/compilers/rust/rust-lib-src.nix +++ b/pkgs/development/compilers/rust/rust-lib-src.nix @@ -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 +'' diff --git a/pkgs/development/compilers/rust/rust-src.nix b/pkgs/development/compilers/rust/rust-src.nix index 4239e92b03638..69bdb37ac2fdb 100644 --- a/pkgs/development/compilers/rust/rust-src.nix +++ b/pkgs/development/compilers/rust/rust-src.nix @@ -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" + ])}} +'' |