2017-01-11 11:50:42 +01:00
|
|
|
{ stdenv, callPackage, rustPlatform, cacert, gdb,
|
2016-06-14 12:49:48 +02:00
|
|
|
targets ? [], targetToolchains ? [], targetPatches ? [] }:
|
|
|
|
|
|
|
|
rec {
|
2017-01-11 11:50:42 +01:00
|
|
|
rustc = stdenv.lib.overrideDerivation (callPackage ./rustc.nix {
|
|
|
|
shortVersion = "beta-2017-01-07";
|
|
|
|
forceBundledLLVM = true; # TODO: figure out why linking fails without this
|
2016-06-14 12:49:48 +02:00
|
|
|
configureFlags = [ "--release-channel=beta" ];
|
2017-01-11 11:50:42 +01:00
|
|
|
srcRev = "a035041ba450ce3061d78a2bdb9c446eb5321d0d";
|
|
|
|
srcSha = "12xsm0yp1y39fvf9j218gxv73j8hhahc53jyv3q58kiriyqvfc1s";
|
2016-07-19 10:25:35 +02:00
|
|
|
patches = [
|
2017-01-11 11:50:42 +01:00
|
|
|
./patches/disable-lockfile-check-nightly.patch
|
2016-07-19 10:25:35 +02:00
|
|
|
] ++ stdenv.lib.optional stdenv.needsPax ./patches/grsec.patch;
|
2016-06-14 12:49:48 +02:00
|
|
|
inherit targets;
|
|
|
|
inherit targetPatches;
|
|
|
|
inherit targetToolchains;
|
|
|
|
inherit rustPlatform;
|
2017-01-11 11:50:42 +01:00
|
|
|
}) (oldAttrs: {
|
|
|
|
nativeBuildInputs = oldAttrs.nativeBuildInputs ++ [ gdb rustPlatform.rust.cargo ];
|
|
|
|
postUnpack = ''
|
|
|
|
export CARGO_HOME="$(realpath deps)"
|
|
|
|
export SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt
|
|
|
|
'';
|
|
|
|
postPatch = ''
|
|
|
|
${oldAttrs.postPatch}
|
|
|
|
|
|
|
|
# Remove failing debuginfo tests because of old gdb version: https://github.com/rust-lang/rust/issues/38948#issuecomment-271443596
|
|
|
|
rm -vr src/test/debuginfo/borrowed-enum.rs || true
|
|
|
|
rm -vr src/test/debuginfo/generic-struct-style-enum.rs || true
|
|
|
|
rm -vr src/test/debuginfo/generic-tuple-style-enum.rs || true
|
|
|
|
rm -vr src/test/debuginfo/packed-struct.rs || true
|
|
|
|
rm -vr src/test/debuginfo/recursive-struct.rs || true
|
|
|
|
rm -vr src/test/debuginfo/struct-in-enum.rs || true
|
|
|
|
rm -vr src/test/debuginfo/struct-style-enum.rs || true
|
|
|
|
rm -vr src/test/debuginfo/tuple-style-enum.rs || true
|
|
|
|
rm -vr src/test/debuginfo/union-smoke.rs || true
|
|
|
|
rm -vr src/test/debuginfo/unique-enum.rs || true
|
|
|
|
|
|
|
|
# make external cargo work until https://github.com/rust-lang/rust/issues/38950 is fixed
|
|
|
|
sed -i "s# def cargo(self):# def cargo(self):\n return \"${rustPlatform.rust.cargo}/bin/cargo\"#g" src/bootstrap/bootstrap.py
|
|
|
|
substituteInPlace \
|
|
|
|
src/bootstrap/config.rs \
|
|
|
|
--replace \
|
|
|
|
'self.cargo = Some(push_exe_path(path, &["bin", "cargo"]));' \
|
|
|
|
''$'self.cargo = Some(\n "${rustPlatform.rust.cargo}\\\n /bin/cargo".into());'
|
|
|
|
'';
|
|
|
|
});
|
2016-06-14 12:49:48 +02:00
|
|
|
|
|
|
|
cargo = callPackage ./cargo.nix rec {
|
2017-01-11 11:50:42 +01:00
|
|
|
version = "beta-2017-01-10";
|
|
|
|
srcRev = "6dd4ff0f5b59fff524762c4a7b65882adda713c0";
|
|
|
|
srcSha = "1x6d42qq2zhr1iaw0m0nslhv6c1w6x6schmd96max0p9xb47l9zj";
|
|
|
|
depsSha256 = "1sywnhzgambmqsjs2xlnzracfv7vjljha55hgf8wca2marafr5dp";
|
2016-08-08 22:20:56 +02:00
|
|
|
|
2016-06-14 12:49:48 +02:00
|
|
|
inherit rustc; # the rustc that will be wrapped by cargo
|
|
|
|
inherit rustPlatform; # used to build cargo
|
|
|
|
};
|
|
|
|
}
|