diff options
author | github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | 2022-03-10 06:01:29 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-10 06:01:29 +0000 |
commit | c46a02f95725d864b657dd915c925b246a223f6e (patch) | |
tree | 2beee7ebee720948298c819fb5e67f14cfcd7326 /pkgs/development/compilers | |
parent | b9e72faa7921e0caeb04e1a7eafa334f5835573b (diff) | |
parent | 5dd8960d56c66bf969d996e3677c6a6a89eb4730 (diff) | |
download | nixpkgs-c46a02f95725d864b657dd915c925b246a223f6e.tar nixpkgs-c46a02f95725d864b657dd915c925b246a223f6e.tar.gz nixpkgs-c46a02f95725d864b657dd915c925b246a223f6e.tar.bz2 nixpkgs-c46a02f95725d864b657dd915c925b246a223f6e.tar.lz nixpkgs-c46a02f95725d864b657dd915c925b246a223f6e.tar.xz nixpkgs-c46a02f95725d864b657dd915c925b246a223f6e.tar.zst nixpkgs-c46a02f95725d864b657dd915c925b246a223f6e.zip |
Merge master into staging-next
Diffstat (limited to 'pkgs/development/compilers')
-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 2071c48cc6d..b859d01dc08 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 67a7fa3641a..aa914338639 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 4239e92b036..69bdb37ac2f 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" + ])}} +'' |