mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-20 21:17:46 +00:00
4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
49 lines
1.5 KiB
Nix
49 lines
1.5 KiB
Nix
{ lib, stdenv, fetchFromGitHub, rustPlatform, makeWrapper, substituteAll, Security }:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "racer";
|
|
version = "2.1.40";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "racer-rust";
|
|
repo = "racer";
|
|
rev = "v${version}";
|
|
sha256 = "sha256-8Is+RBfcXKbGSFzYoolLHs30rxlNI//xVGEOhxP2TV8=";
|
|
};
|
|
|
|
cargoSha256 = "sha256-iUomr9viCdZk4nV75/OP8vHtJpMbmy+pq1IbaA2lLmE=";
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
buildInputs = stdenv.lib.optional stdenv.isDarwin Security;
|
|
|
|
# a nightly compiler is required unless we use this cheat code.
|
|
RUSTC_BOOTSTRAP = 1;
|
|
|
|
RUST_SRC_PATH = rustPlatform.rustLibSrc;
|
|
postInstall = ''
|
|
wrapProgram $out/bin/racer --set-default RUST_SRC_PATH ${rustPlatform.rustLibSrc}
|
|
'';
|
|
|
|
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"
|
|
];
|
|
|
|
doInstallCheck = true;
|
|
installCheckPhase = ''
|
|
$out/bin/racer --version
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "A utility intended to provide Rust code completion for editors and IDEs";
|
|
homepage = "https://github.com/racer-rust/racer";
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ jagajaga ma27 ];
|
|
};
|
|
}
|