diff options
author | Jörg Thalheim <Mic92@users.noreply.github.com> | 2017-11-17 08:00:37 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-17 08:00:37 +0000 |
commit | 0bab82b00114fd09f219b488344d5a20f75a3ef8 (patch) | |
tree | aef19516b084f69eeba01f2c16928b3f047c8469 /pkgs | |
parent | 3ac474aee6ac977f67fa4ffd35da8af56df5fba8 (diff) | |
parent | 1d8f539bd4d19701bd148400301d21cc58cd7540 (diff) | |
download | nixlib-0bab82b00114fd09f219b488344d5a20f75a3ef8.tar nixlib-0bab82b00114fd09f219b488344d5a20f75a3ef8.tar.gz nixlib-0bab82b00114fd09f219b488344d5a20f75a3ef8.tar.bz2 nixlib-0bab82b00114fd09f219b488344d5a20f75a3ef8.tar.lz nixlib-0bab82b00114fd09f219b488344d5a20f75a3ef8.tar.xz nixlib-0bab82b00114fd09f219b488344d5a20f75a3ef8.tar.zst nixlib-0bab82b00114fd09f219b488344d5a20f75a3ef8.zip |
Merge pull request #31717 from Mic92/rustracer
rustracer: 2.0.9 -> 2.0.12
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/development/compilers/rust/rust-src.nix | 11 | ||||
-rw-r--r-- | pkgs/development/tools/rust/racer/default.nix | 25 | ||||
-rw-r--r-- | pkgs/development/tools/rust/racer/ignore-tests.patch | 22 | ||||
-rw-r--r-- | pkgs/development/tools/rust/racer/rust-src.patch | 10 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 8 |
5 files changed, 58 insertions, 18 deletions
diff --git a/pkgs/development/compilers/rust/rust-src.nix b/pkgs/development/compilers/rust/rust-src.nix new file mode 100644 index 000000000000..1b819a7f6068 --- /dev/null +++ b/pkgs/development/compilers/rust/rust-src.nix @@ -0,0 +1,11 @@ +{ stdenv, rustc }: + +stdenv.mkDerivation { + name = "rust-src"; + src = rustc.src; + phases = [ "unpackPhase" "installPhase" ]; + installPhase = '' + mv src $out + rm -rf $out/{ci,doc,driver,etc,grammar,llvm,rt,rtstartup,rustllvm,test,tools,vendor} + ''; +} diff --git a/pkgs/development/tools/rust/racer/default.nix b/pkgs/development/tools/rust/racer/default.nix index 57b685e946d0..77ab75d1446c 100644 --- a/pkgs/development/tools/rust/racer/default.nix +++ b/pkgs/development/tools/rust/racer/default.nix @@ -1,32 +1,33 @@ -{ stdenv, fetchFromGitHub, rustPlatform, makeWrapper }: +{ stdenv, fetchFromGitHub, rustPlatform, makeWrapper, rustup, substituteAll }: rustPlatform.buildRustPackage rec { name = "racer-${version}"; - version = "2.0.9"; + version = "2.0.12"; src = fetchFromGitHub { owner = "racer-rust"; repo = "racer"; rev = version; - sha256 = "06k50f2vj2w08afh3nrlhs0amcvw2i45bhfwr70sgs395xicjswp"; + sha256 = "0y1xlpjr8y8gsmmrjlykx4vwzf8akk42g35kg3kc419ry4fli945"; }; - cargoSha256 = "1w5imxyqlyv24dvzncq6dy01zn2x8p1aciyvzh8ac1x1wdjcacjc"; + cargoSha256 = "1h3jv4hajdv6k309kjr6b6298kxmd0faw081i3788sl794k9mp0j"; - buildInputs = [ makeWrapper ]; + # rustup is required for test + buildInputs = [ makeWrapper rustup ]; preCheck = '' export RUST_SRC_PATH="${rustPlatform.rustcSrc}" ''; - + patches = [ + (substituteAll { + src = ./rust-src.patch; + inherit (rustPlatform) rustcSrc; + }) + ./ignore-tests.patch + ]; doCheck = true; - installPhase = '' - mkdir -p $out/bin - cp -p target/release/racer $out/bin/ - wrapProgram $out/bin/racer --set RUST_SRC_PATH "${rustPlatform.rustcSrc}" - ''; - meta = with stdenv.lib; { description = "A utility intended to provide Rust code completion for editors and IDEs"; homepage = https://github.com/racer-rust/racer; diff --git a/pkgs/development/tools/rust/racer/ignore-tests.patch b/pkgs/development/tools/rust/racer/ignore-tests.patch new file mode 100644 index 000000000000..021217b4094e --- /dev/null +++ b/pkgs/development/tools/rust/racer/ignore-tests.patch @@ -0,0 +1,22 @@ +diff -Naur --strip-trailing-cr source.org/src/racer/nameres.rs source/src/racer/nameres.rs +--- source.org/src/racer/nameres.rs 2017-11-15 20:37:38.571644733 +0000 ++++ source/src/racer/nameres.rs 2017-11-15 20:23:20.521324031 +0000 +@@ -577,6 +577,7 @@ + out.into_iter() + } + ++#[ignore] + #[test] + fn test_do_file_search() { + let cache = core::FileCache::default(); +diff -Naur --strip-trailing-cr source.org/src/racer/util.rs source/src/racer/util.rs +--- source.org/src/racer/util.rs 2017-11-15 19:37:55.095344120 +0000 ++++ source/src/racer/util.rs 2017-11-15 20:22:53.746624158 +0000 +@@ -475,6 +475,7 @@ + + } + ++#[ignore] + #[test] + fn test_get_rust_src_path_missing() { + use std::env; diff --git a/pkgs/development/tools/rust/racer/rust-src.patch b/pkgs/development/tools/rust/racer/rust-src.patch new file mode 100644 index 000000000000..2e794ac88874 --- /dev/null +++ b/pkgs/development/tools/rust/racer/rust-src.patch @@ -0,0 +1,10 @@ +--- source.org/src/racer/util.rs 1970-01-01 01:00:01.000000000 +0100 ++++ source/src/racer/util.rs 2017-11-15 16:50:12.904216242 +0000 +@@ -384,6 +384,7 @@ + debug!("Nope. Trying default paths: /usr/local/src/rust/src and /usr/src/rust/src"); + + let default_paths = [ ++ "@rustcSrc@", + "/usr/local/src/rust/src", + "/usr/src/rust/src", + ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index eb04e27fac0b..1f47193e4c35 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6253,13 +6253,9 @@ with pkgs; inherit rust; }; - rustcSrc = stdenv.mkDerivation { - name = "rust-src"; - src = rust.rustc.src; - phases = ["unpackPhase" "installPhase"]; - installPhase = "mv src $out"; + rustcSrc = callPackage ../development/compilers/rust/rust-src.nix { + inherit (rust) rustc; }; - }); cargo-edit = callPackage ../tools/package-management/cargo-edit { }; |