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