2018-11-10 07:38:20 +00:00
|
|
|
{ stdenv, fetchFromGitHub, rustPlatform, makeWrapper, substituteAll }:
|
2014-11-23 19:42:22 +00:00
|
|
|
|
2017-03-22 01:45:55 +00:00
|
|
|
rustPlatform.buildRustPackage rec {
|
2015-09-24 00:45:45 +01:00
|
|
|
name = "racer-${version}";
|
2019-07-30 05:59:24 +01:00
|
|
|
version = "2.1.22";
|
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";
|
2019-07-30 05:59:24 +01:00
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "1n808h4jqxkvpjwmj8jgi4y5is5zvr8vn42mwb3yi13mix32cysa";
|
2014-11-23 19:42:22 +00:00
|
|
|
};
|
|
|
|
|
2019-07-30 05:59:24 +01:00
|
|
|
cargoSha256 = "0njaa9vk2i9g1c6sq20b7ls97nl532rfv3is7d8dwz51nrwk6jxs";
|
2015-01-20 18:24:49 +00:00
|
|
|
|
2018-11-10 07:38:20 +00:00
|
|
|
buildInputs = [ makeWrapper ];
|
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.
|
|
|
|
RUSTC_BOOTSTRAP=1;
|
|
|
|
|
|
|
|
RUST_SRC_PATH = rustPlatform.rustcSrc;
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/racer --set-default RUST_SRC_PATH $rustcSrc
|
|
|
|
'';
|
|
|
|
|
|
|
|
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 \
|
|
|
|
--skip follows_rand_crate --skip get_completion_in_example_dir
|
|
|
|
'';
|
|
|
|
|
|
|
|
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";
|
2017-07-27 22:55:26 +01:00
|
|
|
homepage = https://github.com/racer-rust/racer;
|
2017-03-22 01:45:55 +00:00
|
|
|
license = licenses.mit;
|
2015-09-24 00:45:45 +01:00
|
|
|
maintainers = with maintainers; [ jagajaga globin ];
|
2016-07-14 10:46:57 +01:00
|
|
|
platforms = platforms.all;
|
2014-11-23 19:42:22 +00:00
|
|
|
};
|
|
|
|
}
|