rustPackages: make rustc-dev optional
This was only introduced in 1.40.0 and doesn't work on older versions.
thread 'main' panicked at 'Error: no rules matched rustc-dev.', src/bootstrap/builder.rs:231:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
failed to run: /build/rustc-1.38.0-src/build/bootstrap/debug/bootstrap dist rustc-dev
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
, pkgconfig, openssl
|
||||
, which, libffi
|
||||
, withBundledLLVM ? false
|
||||
, enableRustcDev ? true
|
||||
, version
|
||||
, sha256
|
||||
}:
|
||||
@@ -132,12 +133,13 @@ in stdenv.mkDerivation rec {
|
||||
outputs = [ "out" "man" "doc" ];
|
||||
setOutputFlags = false;
|
||||
|
||||
postInstall = ''
|
||||
postInstall = stdenv.lib.optionalString enableRustcDev ''
|
||||
# install rustc-dev components. Necessary to build rls, clippy...
|
||||
python x.py dist rustc-dev
|
||||
tar xf build/dist/rustc-dev*tar.gz
|
||||
cp -r rustc-dev*/rustc-dev*/lib/* $out/lib/
|
||||
|
||||
'' + ''
|
||||
# remove references to llvm-config in lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
|
||||
# and thus a transitive dependency on ncurses
|
||||
find $out/lib -name "*.so" -type f -exec remove-references-to -t ${llvmShared} '{}' '+'
|
||||
|
||||
Reference in New Issue
Block a user