Merge pull request #66681 from basvandijk/init-rust-clippy

rustPackages.clippy: init at rust-1.36.0
This commit is contained in:
Eelco Dolstra 2019-08-16 14:07:17 +02:00 committed by GitHub
commit 96ec1bc7b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 36 additions and 0 deletions

View File

@ -0,0 +1,35 @@
{ stdenv, lib, rustPlatform, rustc, Security, patchelf }:
rustPlatform.buildRustPackage rec {
name = "clippy-${rustc.version}";
inherit (rustc) version src;
# the rust source tarball already has all the dependencies vendored, no need to fetch them again
cargoVendorDir = "vendor";
preBuild = "pushd src/tools/clippy";
postBuild = "popd";
# changes hash of vendor directory otherwise
dontUpdateAutotoolsGnuConfigScripts = true;
buildInputs = [ rustc ] ++ stdenv.lib.optionals stdenv.isDarwin [ Security ];
# fixes: error: the option `Z` is only accepted on the nightly compiler
RUSTC_BOOTSTRAP = 1;
# Without disabling the test the build fails with:
# error: failed to run custom build command for `rustc_llvm v0.0.0
# (/private/tmp/nix-build-clippy-1.36.0.drv-0/rustc-1.36.0-src/src/librustc_llvm)
doCheck = false;
preFixup = stdenv.lib.optionalString stdenv.isDarwin ''
install_name_tool -add_rpath "${rustc}/lib" $out/bin/clippy-driver
'';
meta = with stdenv.lib; {
homepage = https://rust-lang.github.io/rust-clippy/;
description = "A bunch of lints to catch common mistakes and improve your Rust code";
maintainers = with maintainers; [ basvandijk ];
license = with licenses; [ mit asl20 ];
platforms = platforms.unix;
};
}

View File

@ -64,6 +64,7 @@
rustPlatform = bootRustPlatform;
inherit CoreFoundation Security;
};
clippy = self.callPackage ./clippy.nix { inherit Security; };
});
};
}