diff options
author | joachim schiele <js@lastlog.de> | 2016-11-25 09:46:40 +0100 |
---|---|---|
committer | joachim schiele <js@lastlog.de> | 2016-11-29 09:10:39 +0100 |
commit | f67061c1de847f310d1569cfabf98fef8fb09d4e (patch) | |
tree | ec632bd5a174cd85095904feb108648a66ebc6e7 /pkgs/development/compilers | |
parent | a344b552adbae5e54753178d5713bb60adefdc86 (diff) | |
download | nixpkgs-f67061c1de847f310d1569cfabf98fef8fb09d4e.tar nixpkgs-f67061c1de847f310d1569cfabf98fef8fb09d4e.tar.gz nixpkgs-f67061c1de847f310d1569cfabf98fef8fb09d4e.tar.bz2 nixpkgs-f67061c1de847f310d1569cfabf98fef8fb09d4e.tar.lz nixpkgs-f67061c1de847f310d1569cfabf98fef8fb09d4e.tar.xz nixpkgs-f67061c1de847f310d1569cfabf98fef8fb09d4e.tar.zst nixpkgs-f67061c1de847f310d1569cfabf98fef8fb09d4e.zip |
(rustc-nightly) init at 2016-11-26 - precompiled rustc nightly binary
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r-- | pkgs/development/compilers/rust/nightlyBin.nix | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/pkgs/development/compilers/rust/nightlyBin.nix b/pkgs/development/compilers/rust/nightlyBin.nix new file mode 100644 index 00000000000..eff5db9143f --- /dev/null +++ b/pkgs/development/compilers/rust/nightlyBin.nix @@ -0,0 +1,59 @@ +{ stdenv, fetchurl, makeWrapper, cacert, zlib }: + +let + inherit (stdenv.lib) optionalString; + + platform = if stdenv.system == "x86_64-linux" + then "x86_64-unknown-linux-gnu" + else abort "missing boostrap url for platform ${stdenv.system}"; + + bootstrapHash = + if stdenv.system == "x86_64-linux" + then "1hsvf1vj18fqxkqw8jhnwahhk2q5xcl5396czr034fphmp5n4haw" + else throw "missing boostrap hash for platform ${stdenv.system}"; + + needsPatchelf = stdenv.isLinux; + + src = fetchurl { + url = "https://static.rust-lang.org/dist/${version}/rustc-nightly-${platform}.tar.gz"; + sha256 = bootstrapHash; + }; + + version = "2016-11-26"; +in + +rec { + rustc = stdenv.mkDerivation rec { + name = "rustc-nightly-${version}"; + + inherit version; + inherit src; + + meta = with stdenv.lib; { + homepage = http://www.rust-lang.org/; + description = "A safe, concurrent, practical language"; + maintainers = with maintainers; [ qknight ]; + license = [ licenses.mit licenses.asl20 ]; + }; + + buildInputs = [ makeWrapper ]; + phases = ["unpackPhase" "installPhase"]; + + installPhase = '' + ./install.sh --prefix=$out \ + --components=rustc + + ${optionalString needsPatchelf '' + patchelf \ + --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ + "$out/bin/rustc" + ''} + + # Do NOT, I repeat, DO NOT use `wrapProgram` on $out/bin/rustc + # (or similar) here. It causes strange effects where rustc loads + # the wrong libraries in a bootstrap-build causing failures that + # are very hard to track dow. For details, see + # https://github.com/rust-lang/rust/issues/34722#issuecomment-232164943 + ''; + }; +} |