2019-07-30 00:22:58 -07:00
|
|
|
{ stdenv, fetchFromGitHub, rustPlatform, makeWrapper, substituteAll, Security }:
|
2014-11-23 11:42:22 -08:00
|
|
|
|
2017-03-21 18:45:55 -07:00
|
|
|
rustPlatform.buildRustPackage rec {
|
2019-08-31 04:41:23 -07:00
|
|
|
pname = "racer";
|
2020-02-05 23:11:25 -08:00
|
|
|
version = "2.1.30";
|
2017-03-21 18:45:55 -07:00
|
|
|
|
2015-09-23 16:45:45 -07:00
|
|
|
src = fetchFromGitHub {
|
2017-07-27 14:55:26 -07:00
|
|
|
owner = "racer-rust";
|
2015-09-23 16:45:45 -07:00
|
|
|
repo = "racer";
|
2020-02-05 23:11:25 -08:00
|
|
|
rev = "c2b0080243fefdad7f7b223e8a7fdef3e1f0fa77";
|
|
|
|
sha256 = "0svvdkfqpk2rw0wxyrhkxy553k55lg7jxc0ly4w1195iwv14ad3y";
|
2014-11-23 11:42:22 -08:00
|
|
|
};
|
|
|
|
|
2020-03-08 21:10:59 -07:00
|
|
|
cargoSha256 = "0zaqa89z3nf23s2q1jpmfz4lygh4zq9ymql71d748fgjy9psr449";
|
2015-01-20 10:24:49 -08:00
|
|
|
|
2019-07-30 00:22:58 -07:00
|
|
|
buildInputs = [ makeWrapper ]
|
|
|
|
++ stdenv.lib.optional stdenv.isDarwin Security;
|
2015-01-20 10:24:49 -08:00
|
|
|
|
2019-07-29 21:59:24 -07:00
|
|
|
# a nightly compiler is required unless we use this cheat code.
|
|
|
|
RUSTC_BOOTSTRAP=1;
|
|
|
|
|
|
|
|
RUST_SRC_PATH = rustPlatform.rustcSrc;
|
|
|
|
postInstall = ''
|
2019-10-06 00:56:55 -07:00
|
|
|
wrapProgram $out/bin/racer --set-default RUST_SRC_PATH ${rustPlatform.rustcSrc}
|
2019-07-29 21:59:24 -07:00
|
|
|
'';
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
cargo test -- \
|
|
|
|
--skip nameres::test_do_file_search_std \
|
|
|
|
--skip util::test_get_rust_src_path_rustup_ok \
|
|
|
|
--skip util::test_get_rust_src_path_not_rust_source_tree \
|
|
|
|
--skip extern --skip completes_pub_fn --skip find_crate_doc \
|
|
|
|
--skip follows_use_local_package --skip follows_use_for_reexport \
|
2019-10-06 00:39:21 -07:00
|
|
|
--skip follows_rand_crate --skip get_completion_in_example_dir \
|
|
|
|
--skip test_resolve_global_path_in_modules
|
2019-07-29 21:59:24 -07:00
|
|
|
'';
|
|
|
|
|
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
|
|
|
$out/bin/racer --version
|
2015-01-20 10:24:49 -08:00
|
|
|
'';
|
2016-07-25 12:31:53 -07:00
|
|
|
|
2014-11-27 12:06:07 -08:00
|
|
|
meta = with stdenv.lib; {
|
2015-04-28 01:54:58 -07:00
|
|
|
description = "A utility intended to provide Rust code completion for editors and IDEs";
|
2020-03-31 18:11:51 -07:00
|
|
|
homepage = "https://github.com/racer-rust/racer";
|
2017-03-21 18:45:55 -07:00
|
|
|
license = licenses.mit;
|
2020-01-05 11:14:55 -08:00
|
|
|
maintainers = with maintainers; [ jagajaga ma27 ];
|
2016-07-14 02:46:57 -07:00
|
|
|
platforms = platforms.all;
|
2014-11-23 11:42:22 -08:00
|
|
|
};
|
|
|
|
}
|