1{ lib, rustPlatform, fetchCrate, makeWrapper, stdenv, Security }:
2
3rustPlatform.buildRustPackage rec {
4 pname = "racer";
5 version = "2.1.48";
6
7 src = fetchCrate {
8 inherit pname version;
9 sha256 = "sha256-lat5s9+AMFI3VXiWqjLESZrtq3IwOZhlt+5BhYoonfA=";
10 };
11
12 cargoSha256 = "sha256-jGsvCmrPGVzWdx7V3J4bBK+SF2o+icORmVKuwqYxdh4=";
13
14 nativeBuildInputs = [ makeWrapper ];
15 buildInputs = lib.optional stdenv.isDarwin Security;
16
17 # a nightly compiler is required unless we use this cheat code.
18 RUSTC_BOOTSTRAP = 1;
19
20 RUST_SRC_PATH = rustPlatform.rustLibSrc;
21 postInstall = ''
22 wrapProgram $out/bin/racer --set-default RUST_SRC_PATH ${rustPlatform.rustLibSrc}
23 '';
24
25 checkFlags = [
26 "--skip nameres::test_do_file_search_std"
27 "--skip util::test_get_rust_src_path_rustup_ok"
28 "--skip util::test_get_rust_src_path_not_rust_source_tree"
29 "--skip extern --skip completes_pub_fn --skip find_crate_doc"
30 "--skip follows_use_local_package --skip follows_use_for_reexport"
31 "--skip follows_rand_crate --skip get_completion_in_example_dir"
32 "--skip test_resolve_global_path_in_modules"
33 ];
34
35 doInstallCheck = true;
36 installCheckPhase = ''
37 $out/bin/racer --version
38 '';
39
40 meta = with lib; {
41 description = "A utility intended to provide Rust code completion for editors and IDEs";
42 homepage = "https://github.com/racer-rust/racer";
43 license = licenses.mit;
44 maintainers = with maintainers; [ jagajaga ];
45 # error[E0199]: implementing the trait `Step` is not unsafe
46 broken = true;
47 };
48}