1{ stdenv, fetchurl, callPackage }:
2
3let
4 # Note: the version MUST be one version prior to the version we're
5 # building
6 version = "1.26.2";
7
8 # fetch hashes by running `print-hashes.sh 1.24.1`
9 hashes = {
10 i686-unknown-linux-gnu = "e22286190a074bfb6d47c9fde236d712a53675af1563ba85ea33e0d40165f755";
11 x86_64-unknown-linux-gnu = "d2b4fb0c544874a73c463993bde122f031c34897bb1eeb653d2ba2b336db83e6";
12 armv7-unknown-linux-gnueabihf = "1140387a61083e3ef10e7a097269200fc7e9db6f6cc9f270e04319b3b429c655";
13 aarch64-unknown-linux-gnu = "3dfad0dc9c795f7ee54c2099c9b7edf06b942adbbf02e9ed9e5d4b5e3f1f3759";
14 i686-apple-darwin = "3a5de30f3e334a66bd320ec0e954961d348434da39a826284e00d55ea60f8370";
15 x86_64-apple-darwin = "f193705d4c0572a358670dbacbf0ffadcd04b3989728b442f4680fa1e065fa72";
16 };
17
18 platform =
19 if stdenv.hostPlatform.system == "i686-linux"
20 then "i686-unknown-linux-gnu"
21 else if stdenv.hostPlatform.system == "x86_64-linux"
22 then "x86_64-unknown-linux-gnu"
23 else if stdenv.hostPlatform.system == "armv7l-linux"
24 then "armv7-unknown-linux-gnueabihf"
25 else if stdenv.hostPlatform.system == "aarch64-linux"
26 then "aarch64-unknown-linux-gnu"
27 else if stdenv.hostPlatform.system == "i686-darwin"
28 then "i686-apple-darwin"
29 else if stdenv.hostPlatform.system == "x86_64-darwin"
30 then "x86_64-apple-darwin"
31 else throw "missing bootstrap url for platform ${stdenv.hostPlatform.system}";
32
33 src = fetchurl {
34 url = "https://static.rust-lang.org/dist/rust-${version}-${platform}.tar.gz";
35 sha256 = hashes."${platform}";
36 };
37
38in callPackage ./binaryBuild.nix
39 { inherit version src platform;
40 buildRustPackage = null;
41 versionType = "bootstrap";
42 }