nixpkgs-suyu/pkgs/development/compilers/rust/default.nix
2017-12-02 14:46:33 +02:00

40 lines
1.3 KiB
Nix

{ stdenv, callPackage, recurseIntoAttrs, makeRustPlatform, llvm, fetchurl
, targets ? []
, targetToolchains ? []
, targetPatches ? []
}:
let
rustPlatform = recurseIntoAttrs (makeRustPlatform (callPackage ./bootstrap.nix {}));
version = "1.21.0";
in
rec {
rustc = callPackage ./rustc.nix {
inherit llvm targets targetPatches targetToolchains rustPlatform version;
forceBundledLLVM = true;
configureFlags = [ "--release-channel=stable" ];
src = fetchurl {
url = "https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz";
sha256 = "1yj8lnxybjrybp00fqhxw8fpr641dh8wcn9mk44xjnsb4i1c21qp";
};
patches = [
./patches/0001-Disable-fragile-tests-libstd-net-tcp-on-Darwin-Linux.patch
] ++ stdenv.lib.optional stdenv.needsPax ./patches/grsec.patch
# https://github.com/rust-lang/rust/issues/45410
++ stdenv.lib.optional stdenv.isAarch64 ./patches/aarch64-disable-test_loading_cosine.patch;
};
cargo = callPackage ./cargo.nix rec {
version = "0.22.0";
srcSha = "0x9pm73hkkd1hq4qrmz8iv91djgpdsxzwll7jari0h77vpwajmw4";
cargoSha256 = "0xd0rb8gcqy6xngsx9l30jg3fqrcwccgv904ksqs9c4d44hga0gd";
inherit rustc; # the rustc that will be wrapped by cargo
inherit rustPlatform; # used to build cargo
};
}