@@ -1,17 +1,29 @@
1−{ stdenv, fetchFromGitHub, rustPlatform }:
1+{ stdenv, fetchFromGitHub, rustPlatform, darwin }:
22
33rustPlatform.buildRustPackage rec {
44 name = "rustfmt-${version}";
5− version = "0.9.0";
5+ version = "0.99.5";
66
77 src = fetchFromGitHub {
8− owner = "rust-lang-nursery";
8+ owner = "rust-lang";
99 repo = "rustfmt";
1010 rev = "${version}";
11− sha256 = "12l3ff0s0pzhcf5jbs8wqawjk4jghhhz8j6dq1n5201yvny12jlr";
11+ sha256 = "1gx1bsyb0f94r3f88f1j3b4rcm2x6zppcfab1c5vgpsr2dr6ch28";
1212 };
1313
14− cargoSha256 = "0gppki9mgx99xipapg36ydwk1bplygnz6sbyzbg46vhn10iggfwm";
14+ cargoSha256 = "1rs6jjm75ixxhrf8b3zn991xa5kfayxlf0b70zdx6wd4r6by7w2y";
15+
16+ buildInputs = stdenv.lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Security;
17+
18+
19+ # As of 1.0.0 and rustc 1.30 rustfmt requires a nightly compiler
20+ RUSTC_BOOTSTRAP = 1;
21+
22+ # we run tests in debug mode so tests look for a debug build of
23+ # rustfmt. Anyway this adds nearly no compilation time.
24+ preCheck = ''
25+ cargo build
26+ '';
1527
1628 meta = with stdenv.lib; {
1729 description = "A tool for formatting Rust code according to style guidelines";