2018-11-23 23:43:52 +00:00
|
|
|
{ stdenv, fetchFromGitHub, rustPlatform, darwin }:
|
2015-09-05 17:48:36 +01:00
|
|
|
|
2017-03-29 23:24:38 +01:00
|
|
|
rustPlatform.buildRustPackage rec {
|
2016-03-22 16:33:06 +00:00
|
|
|
name = "rustfmt-${version}";
|
2019-06-13 20:45:31 +01:00
|
|
|
version = "1.2.2";
|
2016-03-22 16:33:06 +00:00
|
|
|
|
2015-10-18 02:36:15 +01:00
|
|
|
src = fetchFromGitHub {
|
2018-11-23 16:45:33 +00:00
|
|
|
owner = "rust-lang";
|
2015-10-18 02:36:15 +01:00
|
|
|
repo = "rustfmt";
|
2019-04-23 11:36:39 +01:00
|
|
|
rev = "v${version}";
|
2019-06-13 20:45:31 +01:00
|
|
|
sha256 = "1k9p6sp8q87flx9vzg46880ir7likvbydai3g6q76278h86rn0v8";
|
2015-09-05 17:48:36 +01:00
|
|
|
};
|
|
|
|
|
2019-04-23 11:36:39 +01:00
|
|
|
cargoSha256 = "08x6vy5v2vgrk3gsw3qcvv52a7hifsgcsnsg1phlk1ikaff21y4z";
|
2018-11-23 16:45:33 +00:00
|
|
|
|
2018-11-23 23:43:52 +00:00
|
|
|
buildInputs = stdenv.lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Security;
|
|
|
|
|
2018-11-23 16:45:33 +00:00
|
|
|
# As of 1.0.0 and rustc 1.30 rustfmt requires a nightly compiler
|
|
|
|
RUSTC_BOOTSTRAP = 1;
|
|
|
|
|
|
|
|
# we run tests in debug mode so tests look for a debug build of
|
|
|
|
# rustfmt. Anyway this adds nearly no compilation time.
|
|
|
|
preCheck = ''
|
|
|
|
cargo build
|
|
|
|
'';
|
2015-09-05 17:48:36 +01:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A tool for formatting Rust code according to style guidelines";
|
2016-11-16 11:26:59 +00:00
|
|
|
homepage = https://github.com/rust-lang-nursery/rustfmt;
|
2015-09-05 17:48:36 +01:00
|
|
|
license = with licenses; [ mit asl20 ];
|
|
|
|
maintainers = [ maintainers.globin ];
|
2016-07-14 10:47:18 +01:00
|
|
|
platforms = platforms.all;
|
2015-09-05 17:48:36 +01:00
|
|
|
};
|
|
|
|
}
|