From 496dac571ce9c93c2a73bb4c61d10f36aa727715 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benno=20F=C3=BCnfst=C3=BCck?= Date: Tue, 18 Jul 2017 17:15:00 +0200 Subject: [PATCH] racer[d]: fix RUST_SRC_PATH `rustc.src` is a `tar.gz` archive, but we need it unpacked. --- pkgs/development/tools/rust/racer/default.nix | 2 +- pkgs/development/tools/rust/racerd/default.nix | 2 +- pkgs/top-level/all-packages.nix | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/rust/racer/default.nix b/pkgs/development/tools/rust/racer/default.nix index d1cb4a8cd2e1..b79d7e0670da 100644 --- a/pkgs/development/tools/rust/racer/default.nix +++ b/pkgs/development/tools/rust/racer/default.nix @@ -24,7 +24,7 @@ rustPlatform.buildRustPackage rec { installPhase = '' mkdir -p $out/bin cp -p target/release/racer $out/bin/ - wrapProgram $out/bin/racer --set RUST_SRC_PATH "${rustPlatform.rust.rustc.src}/src" + wrapProgram $out/bin/racer --set RUST_SRC_PATH "${rustPlatform.rustcSrc}" ''; meta = with stdenv.lib; { diff --git a/pkgs/development/tools/rust/racerd/default.nix b/pkgs/development/tools/rust/racerd/default.nix index 7aaa62fef590..166e3320d9c7 100644 --- a/pkgs/development/tools/rust/racerd/default.nix +++ b/pkgs/development/tools/rust/racerd/default.nix @@ -18,7 +18,7 @@ buildRustPackage rec { buildInputs = [ makeWrapper ]; - RUST_SRC_PATH = ''${rustPlatform.rust.rustc.src}/src''; + RUST_SRC_PATH = rustPlatform.rustcSrc; installPhase = '' mkdir -p $out/bin diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d0978c71570c..7910370e2591 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5896,6 +5896,14 @@ with pkgs; buildRustPackage = callPackage ../build-support/rust { inherit rust; }; + + rustcSrc = stdenv.mkDerivation { + name = "rust-src"; + src = rust.rustc.src; + phases = ["unpackPhase" "installPhase"]; + installPhase = "mv src $out"; + }; + }); rainicorn = callPackage ../development/tools/rust/rainicorn { };