Merge pull request #7501 from wizeman/u/upd-rust
Add support for Rust / Cargo packaging
This commit is contained in:
@@ -1,18 +1,24 @@
|
||||
{stdenv, fetchgit, rustc, cargo, makeWrapper }:
|
||||
{stdenv, fetchgit, rustPlatform, makeWrapper }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
with rustPlatform;
|
||||
|
||||
buildRustPackage rec {
|
||||
#TODO add emacs support
|
||||
name = "racer-git-2015-04-12";
|
||||
name = "racer-git-2015-05-04";
|
||||
src = fetchgit {
|
||||
url = https://github.com/phildawes/racer;
|
||||
rev = "5437e2074d87dfaab75a0f1bd2597bed61c0bbf1";
|
||||
sha256 = "0a768gvjry86l0xa5q0122iyq7zn2h9adfniglsgrbs4fan49xyn";
|
||||
rev = "bf2373ec08b0be03598283bd610c5b61bdb8738c";
|
||||
sha256 = "0ldf05d19ghxk3fslxrc87j18zg8bam2y0ygdy456h37y2p1d1ck";
|
||||
};
|
||||
|
||||
buildInputs = [ rustc cargo makeWrapper ];
|
||||
patches = [ ./pr-232.patch ];
|
||||
|
||||
buildPhase = ''
|
||||
CARGO_HOME="$NIX_BUILD_TOP/.cargo" cargo build --release
|
||||
depsSha256 = "0rinyh365znx39aygxyyxmi496pw0alblf2dl7l8fbmz63nkhfv2";
|
||||
|
||||
buildInputs = [ makeWrapper ];
|
||||
|
||||
preCheck = ''
|
||||
export RUST_SRC_PATH="${rustc.src}/src"
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
From 3f354d69881424c7c902408d22f9138412a872b4 Mon Sep 17 00:00:00 2001
|
||||
From: Ricardo Martins <ricardo@scarybox.net>
|
||||
Date: Sat, 9 May 2015 17:12:55 +0100
|
||||
Subject: [PATCH] Use `Vec::extend` instead of binary operation `+`.
|
||||
|
||||
---
|
||||
src/racer/nameres.rs | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/racer/nameres.rs b/src/racer/nameres.rs
|
||||
index 60636c6..ad1e01c 100644
|
||||
--- a/src/racer/nameres.rs
|
||||
+++ b/src/racer/nameres.rs
|
||||
@@ -620,9 +620,9 @@ pub fn search_scope(start: usize, point: usize, src: &str,
|
||||
}
|
||||
|
||||
// There's a good chance of a match. Run the matchers
|
||||
- out = out + &*run_matchers_on_blob(src, start+blobstart, start+blobend,
|
||||
- searchstr,
|
||||
- filepath, search_type, local, namespace);
|
||||
+ out.extend(run_matchers_on_blob(src, start+blobstart, start+blobend,
|
||||
+ searchstr,
|
||||
+ filepath, search_type, local, namespace));
|
||||
if let ExactMatch = search_type {
|
||||
if !out.is_empty() {
|
||||
return out.into_iter();
|
||||
Reference in New Issue
Block a user