makeRustPlatform: add rustLibSrc
rust-analyzer: rustcSrc -> rustLibSrc to fix build
This commit is contained in:
parent
7ac7ce8b1a
commit
68060f6f6f
@ -18,4 +18,8 @@ rec {
|
|||||||
rustcSrc = callPackage ./rust-src.nix {
|
rustcSrc = callPackage ./rust-src.nix {
|
||||||
inherit rustc;
|
inherit rustc;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
rustLibSrc = callPackage ./rust-lib-src.nix {
|
||||||
|
inherit rustc;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
11
pkgs/development/compilers/rust/rust-lib-src.nix
Normal file
11
pkgs/development/compilers/rust/rust-lib-src.nix
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{ stdenv, rustc }:
|
||||||
|
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
name = "rust-lib-src";
|
||||||
|
src = rustc.src;
|
||||||
|
phases = [ "unpackPhase" "installPhase" ];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mv library $out
|
||||||
|
'';
|
||||||
|
}
|
@ -29,7 +29,7 @@ rustPlatform.buildRustPackage {
|
|||||||
|
|
||||||
inherit doCheck;
|
inherit doCheck;
|
||||||
preCheck = lib.optionalString doCheck ''
|
preCheck = lib.optionalString doCheck ''
|
||||||
export RUST_SRC_PATH=${rustPlatform.rustcSrc}
|
export RUST_SRC_PATH=${rustPlatform.rustLibSrc}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
doInstallCheck = true;
|
doInstallCheck = true;
|
||||||
|
@ -4,7 +4,8 @@ lib.makeOverridable ({
|
|||||||
unwrapped,
|
unwrapped,
|
||||||
pname ? "rust-analyzer",
|
pname ? "rust-analyzer",
|
||||||
version ? unwrapped.version,
|
version ? unwrapped.version,
|
||||||
rustcSrc ? rustPlatform.rustcSrc,
|
# Use name from `RUST_SRC_PATH`
|
||||||
|
rustSrc ? rustPlatform.rustLibSrc,
|
||||||
}: runCommandNoCC "${pname}-${version}" {
|
}: runCommandNoCC "${pname}-${version}" {
|
||||||
inherit pname version;
|
inherit pname version;
|
||||||
inherit (unwrapped) src meta;
|
inherit (unwrapped) src meta;
|
||||||
@ -12,5 +13,5 @@ lib.makeOverridable ({
|
|||||||
} ''
|
} ''
|
||||||
mkdir -p $out/bin
|
mkdir -p $out/bin
|
||||||
makeWrapper ${unwrapped}/bin/rust-analyzer $out/bin/rust-analyzer \
|
makeWrapper ${unwrapped}/bin/rust-analyzer $out/bin/rust-analyzer \
|
||||||
--set-default RUST_SRC_PATH "${rustcSrc}"
|
--set-default RUST_SRC_PATH "${rustSrc}"
|
||||||
'')
|
'')
|
||||||
|
Loading…
Reference in New Issue
Block a user