2018-11-23 15:43:52 -08:00
|
|
|
{ stdenv, fetchFromGitHub, rustPlatform, darwin }:
|
2015-09-05 09:48:36 -07:00
|
|
|
|
2017-03-29 15:24:38 -07:00
|
|
|
rustPlatform.buildRustPackage rec {
|
2016-03-22 09:33:06 -07:00
|
|
|
name = "rustfmt-${version}";
|
2019-02-04 04:42:54 -08:00
|
|
|
version = "1.0.1";
|
2016-03-22 09:33:06 -07:00
|
|
|
|
2015-10-17 18:36:15 -07:00
|
|
|
src = fetchFromGitHub {
|
2018-11-23 08:45:33 -08:00
|
|
|
owner = "rust-lang";
|
2015-10-17 18:36:15 -07:00
|
|
|
repo = "rustfmt";
|
2017-05-25 14:03:45 -07:00
|
|
|
rev = "${version}";
|
2019-02-04 04:42:54 -08:00
|
|
|
sha256 = "1l18ycbq3125sq8v3wgma630wd6kclarlf8f51cmi9blk322jg9p";
|
2015-09-05 09:48:36 -07:00
|
|
|
};
|
|
|
|
|
2019-02-04 04:42:54 -08:00
|
|
|
cargoSha256 = "1557783icdzlwn02c5zl4362yl85r5zj4nkjv80p6896yli9hk9h";
|
2018-11-23 08:45:33 -08:00
|
|
|
|
2018-11-23 15:43:52 -08:00
|
|
|
buildInputs = stdenv.lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Security;
|
|
|
|
|
2018-11-23 08:45:33 -08: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 09:48:36 -07:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A tool for formatting Rust code according to style guidelines";
|
2016-11-16 03:26:59 -08:00
|
|
|
homepage = https://github.com/rust-lang-nursery/rustfmt;
|
2015-09-05 09:48:36 -07:00
|
|
|
license = with licenses; [ mit asl20 ];
|
|
|
|
maintainers = [ maintainers.globin ];
|
2016-07-14 02:47:18 -07:00
|
|
|
platforms = platforms.all;
|
2015-09-05 09:48:36 -07:00
|
|
|
};
|
|
|
|
}
|