buildRustPackage: Add check phase and enable it by default

Also disable check phase in cargo as there are lots of failures (some
probably due to trying to access the network).
This commit is contained in:
Ricardo M. Correia 2015-04-21 20:34:26 +02:00
parent 5e8a447739
commit d648be6724
3 changed files with 16 additions and 1 deletions

View file

@ -39,10 +39,17 @@ in stdenv.mkDerivation (args // {
'' + (args.prePatch or "");
buildPhase = args.buildPhase or ''
echo "Running cargo build"
echo "Running cargo build --release"
cargo build --release
'';
checkPhase = args.checkPhase or ''
echo "Running cargo test"
cargo test
'';
doCheck = args.doCheck or true;
installPhase = args.installPhase or ''
mkdir -p $out/bin
for f in $(find target/release -maxdepth 1 -type f); do

View file

@ -25,6 +25,10 @@ buildRustPackage rec {
buildPhase = "make";
# Disable check phase as there are lots of failures (some probably due to
# trying to access the network).
doCheck = false;
installPhase = ''
make install
${postInstall}

View file

@ -15,6 +15,10 @@ buildRustPackage rec {
buildInputs = [ makeWrapper ];
preCheck = ''
export RUST_SRC_PATH="${rustc.src}/src"
'';
installPhase = ''
mkdir -p $out/bin
cp -p target/release/racer $out/bin/