2017-05-30 06:48:06 -07:00
|
|
|
{ stdenv, callPackage, recurseIntoAttrs, makeRustPlatform, llvm, fetchurl
|
2017-03-24 16:59:14 -07:00
|
|
|
, targets ? []
|
|
|
|
, targetToolchains ? []
|
|
|
|
, targetPatches ? []
|
|
|
|
}:
|
2016-06-14 03:49:48 -07:00
|
|
|
|
|
|
|
let
|
2016-07-09 00:01:49 -07:00
|
|
|
rustPlatform = recurseIntoAttrs (makeRustPlatform (callPackage ./bootstrap.nix {}));
|
2017-10-04 09:41:16 -07:00
|
|
|
version = "1.20.0";
|
2016-06-14 03:49:48 -07:00
|
|
|
in
|
|
|
|
rec {
|
|
|
|
rustc = callPackage ./rustc.nix {
|
2017-05-30 06:48:06 -07:00
|
|
|
inherit llvm targets targetPatches targetToolchains rustPlatform version;
|
|
|
|
|
2017-10-04 09:41:16 -07:00
|
|
|
forceBundledLLVM = true;
|
|
|
|
|
2016-06-14 03:49:48 -07:00
|
|
|
configureFlags = [ "--release-channel=stable" ];
|
2017-05-30 06:48:06 -07:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz";
|
2017-10-04 09:41:16 -07:00
|
|
|
sha256 = "0542y4rnzlsrricai130mqyxl8r6rd991frb4qsnwb27yigqg91a";
|
2017-05-30 06:48:06 -07:00
|
|
|
};
|
2016-08-24 02:56:02 -07:00
|
|
|
|
2016-07-10 13:45:58 -07:00
|
|
|
patches = [
|
2017-08-05 07:38:48 -07:00
|
|
|
./patches/0001-Disable-fragile-tests-libstd-net-tcp-on-Darwin-Linux.patch
|
2016-07-10 13:45:58 -07:00
|
|
|
] ++ stdenv.lib.optional stdenv.needsPax ./patches/grsec.patch;
|
2016-08-24 02:56:02 -07:00
|
|
|
|
2016-06-14 03:49:48 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
cargo = callPackage ./cargo.nix rec {
|
2017-10-19 15:29:28 -07:00
|
|
|
version = "0.22.0";
|
|
|
|
srcSha = "0x9pm73hkkd1hq4qrmz8iv91djgpdsxzwll7jari0h77vpwajmw4";
|
|
|
|
cargoSha256 = "0xd0rb8gcqy6xngsx9l30jg3fqrcwccgv904ksqs9c4d44hga0gd";
|
2016-08-08 06:55:26 -07:00
|
|
|
|
2016-06-14 03:49:48 -07:00
|
|
|
inherit rustc; # the rustc that will be wrapped by cargo
|
|
|
|
inherit rustPlatform; # used to build cargo
|
|
|
|
};
|
|
|
|
}
|