about summary refs log tree commit diff
diff options
context:
space:
mode:
authorarcnmx <arcnmx@users.noreply.github.com>2019-06-24 15:44:15 -0700
committerarcnmx <arcnmx@users.noreply.github.com>2019-07-28 10:09:38 -0700
commit40020f46b6b64cd0de9e18dc01051a09438eb00d (patch)
treec55023654a6a84c41f8d1a510d3872fd85a953c1
parente84e223c9b44dfc7b86bbee5ae2e73c02ab06fa4 (diff)
downloadnixlib-40020f46b6b64cd0de9e18dc01051a09438eb00d.tar
nixlib-40020f46b6b64cd0de9e18dc01051a09438eb00d.tar.gz
nixlib-40020f46b6b64cd0de9e18dc01051a09438eb00d.tar.bz2
nixlib-40020f46b6b64cd0de9e18dc01051a09438eb00d.tar.lz
nixlib-40020f46b6b64cd0de9e18dc01051a09438eb00d.tar.xz
nixlib-40020f46b6b64cd0de9e18dc01051a09438eb00d.tar.zst
nixlib-40020f46b6b64cd0de9e18dc01051a09438eb00d.zip
rls: fix darwin build
rls links to internal rustc crates, which introduces an atypical
dependency on rustc. A superficial installCheck ensures that the
binary is linked properly and able to run on its own.
-rw-r--r--pkgs/development/tools/rust/rls/default.nix8
1 files changed, 8 insertions, 0 deletions
diff --git a/pkgs/development/tools/rust/rls/default.nix b/pkgs/development/tools/rust/rls/default.nix
index 22374d2bbe77..454c5da71438 100644
--- a/pkgs/development/tools/rust/rls/default.nix
+++ b/pkgs/development/tools/rust/rls/default.nix
@@ -19,6 +19,9 @@ rustPlatform.buildRustPackage rec {
   # a nightly compiler is required unless we use this cheat code.
   RUSTC_BOOTSTRAP=1;
 
+  # rls-rustc links to rustc_private crates
+  CARGO_BUILD_RUSTFLAGS = if stdenv.isDarwin then "-C rpath" else null;
+
   nativeBuildInputs = [ pkgconfig cmake ];
   buildInputs = [ openssh openssl curl zlib libiconv ]
     ++ (stdenv.lib.optionals stdenv.isDarwin [ CoreFoundation Security ]);
@@ -29,6 +32,11 @@ rustPlatform.buildRustPackage rec {
     rm tests/client.rs
   '';
 
+  doInstallCheck = true;
+  installCheckPhase = ''
+    $out/bin/rls --version
+  '';
+
   meta = with stdenv.lib; {
     description = "Rust Language Server - provides information about Rust programs to IDEs and other tools";
     homepage = https://github.com/rust-lang/rls/;