2019-07-30 08:22:58 +01:00
|
|
|
{ stdenv, fetchFromGitHub, rustPlatform, makeWrapper, substituteAll, Security }:
|
2014-11-23 19:42:22 +00:00
|
|
|
|
2017-03-22 01:45:55 +00:00
|
|
|
rustPlatform.buildRustPackage rec {
|
2019-08-31 12:41:23 +01:00
|
|
|
pname = "racer";
|
2020-07-26 01:39:13 +01:00
|
|
|
version = "2.1.35";
|
2017-03-22 01:45:55 +00:00
|
|
|
|
2015-09-24 00:45:45 +01:00
|
|
|
src = fetchFromGitHub {
|
2017-07-27 22:55:26 +01:00
|
|
|
owner = "racer-rust";
|
2015-09-24 00:45:45 +01:00
|
|
|
repo = "racer";
|
2020-07-13 21:40:26 +01:00
|
|
|
rev = "v${version}";
|
2020-07-26 01:39:13 +01:00
|
|
|
sha256 = "0c00b81s7abnadjbf4i39lhdkipx7z44sr8p78jd1fl61yyrspli";
|
2014-11-23 19:42:22 +00:00
|
|
|
};
|
|
|
|
|
2020-07-26 01:39:13 +01:00
|
|
|
cargoSha256 = "1nbp2jp65fqwsq9i04iyi4pbszs035w6id50p5ypw234cqxznikm";
|
2015-01-20 18:24:49 +00:00
|
|
|
|
2020-07-13 21:40:26 +01:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = stdenv.lib.optional stdenv.isDarwin Security;
|
2015-01-20 18:24:49 +00:00
|
|
|
|
2019-07-30 05:59:24 +01:00
|
|
|
# a nightly compiler is required unless we use this cheat code.
|
2020-07-13 21:40:26 +01:00
|
|
|
RUSTC_BOOTSTRAP = 1;
|
2019-07-30 05:59:24 +01:00
|
|
|
|
|
|
|
RUST_SRC_PATH = rustPlatform.rustcSrc;
|
|
|
|
postInstall = ''
|
2019-10-06 08:56:55 +01:00
|
|
|
wrapProgram $out/bin/racer --set-default RUST_SRC_PATH ${rustPlatform.rustcSrc}
|
2019-07-30 05:59:24 +01: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 08:39:21 +01:00
|
|
|
--skip follows_rand_crate --skip get_completion_in_example_dir \
|
|
|
|
--skip test_resolve_global_path_in_modules
|
2019-07-30 05:59:24 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
|
|
|
$out/bin/racer --version
|
2015-01-20 18:24:49 +00:00
|
|
|
'';
|
2016-07-25 20:31:53 +01:00
|
|
|
|
2014-11-27 20:06:07 +00:00
|
|
|
meta = with stdenv.lib; {
|
2015-04-28 09:54:58 +01:00
|
|
|
description = "A utility intended to provide Rust code completion for editors and IDEs";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/racer-rust/racer";
|
2017-03-22 01:45:55 +00:00
|
|
|
license = licenses.mit;
|
2020-01-05 19:14:55 +00:00
|
|
|
maintainers = with maintainers; [ jagajaga ma27 ];
|
2014-11-23 19:42:22 +00:00
|
|
|
};
|
|
|
|
}
|