···12 sha512 = "cef5de1e9d6ddf6509a80cd30169fdce701b2fed022979ba5931ccea7b8f77cb644b01984dae028d350e32321cfe2eefc0236c0731bf5a2be12a994fc3fc1118";
13 };
140015 meta = {
16 description = "A web browser built from Firefox source tree";
17 homepage = http://www.mozilla.com/en-US/firefox/;
···12 sha512 = "cef5de1e9d6ddf6509a80cd30169fdce701b2fed022979ba5931ccea7b8f77cb644b01984dae028d350e32321cfe2eefc0236c0731bf5a2be12a994fc3fc1118";
13 };
1415+ patches = [ ./cargo-fix.patch ];
16+17 meta = {
18 description = "A web browser built from Firefox source tree";
19 homepage = http://www.mozilla.com/en-US/firefox/;
···1+#!/usr/bin/env bash
2+3+# All rust-related downloads can be found at
4+# https://static.rust-lang.org/dist/index.html. To find the date on
5+# which a particular thing was last updated, look for the *-date.txt
6+# file, e.g.
7+# https://static.rust-lang.org/dist/channel-rust-beta-date.txt
89PLATFORMS="i686-unknown-linux-gnu x86_64-unknown-linux-gnu i686-apple-darwin x86_64-apple-darwin"
10BASEURL="https://static.rust-lang.org/dist"
11+DATE=$1
12+VERSION=$2
13+14+if [[ -z $DATE ]]
15+then
16+ echo "No date supplied"
17+ exit -1
18+fi
1920if [[ -z $VERSION ]]
21then
···2526for PLATFORM in $PLATFORMS
27do
28+ URL="$BASEURL/$DATE/rust-$VERSION-$PLATFORM.tar.gz.sha256"
29 curl $URL
30done
+37-37
pkgs/development/compilers/rust/rustc.nix
···1{ stdenv, fetchurl, fetchgit, fetchzip, file, python2, tzdata, procps
2, llvm, jemalloc, ncurses, darwin, binutils, rustPlatform, git, cmake, curl
3-4-, isRelease ? false
5-, shortVersion
6, forceBundledLLVM ? false
7-, srcSha, srcRev
8, configureFlags ? []
9, patches
10, targets
11, targetPatches
12, targetToolchains
013} @ args:
1415let
16 inherit (stdenv.lib) optional optionalString;
1718- version = if isRelease then
19- "${shortVersion}"
20- else
21- "${shortVersion}-g${builtins.substring 0 7 srcRev}";
22-23 procps = if stdenv.isDarwin then darwin.ps else args.procps;
2425 llvmShared = llvm.override { enableSharedLibraries = true; };
···31stdenv.mkDerivation {
32 name = "rustc-${version}";
33 inherit version;
003435 __impureHostDeps = [ "/usr/lib/libedit.3.dylib" ];
36···45 # Increase codegen units to introduce parallelism within the compiler.
46 RUSTFLAGS = "-Ccodegen-units=10";
4748- src = fetchgit {
49- url = https://github.com/rust-lang/rust;
50- rev = srcRev;
51- sha256 = srcSha;
52- };
53-54 # We need rust to build rust. If we don't provide it, configure will try to download it.
55 configureFlags = configureFlags
56 ++ [ "--enable-local-rust" "--local-rust-root=${rustPlatform.rust.rustc}" "--enable-rpath" ]
0057 # ++ [ "--jemalloc-root=${jemalloc}/lib"
58 ++ [ "--default-linker=${stdenv.cc}/bin/cc" "--default-ar=${binutils.out}/bin/ar" ]
59- # TODO: Remove when fixed build with rustbuild
60- ++ [ "--disable-rustbuild" ]
61 ++ optional (stdenv.cc.cc ? isClang) "--enable-clang"
62 ++ optional (targets != []) "--target=${target}"
63 ++ optional (!forceBundledLLVM) "--llvm-root=${llvmShared}";
···67 passthru.target = target;
6869 postPatch = ''
70- substituteInPlace src/rust-installer/gen-install-script.sh \
71- --replace /bin/echo "$(type -P echo)"
72- substituteInPlace src/rust-installer/gen-installer.sh \
73- --replace /bin/echo "$(type -P echo)"
74-75- # Workaround for NixOS/nixpkgs#8676
76- substituteInPlace mk/rustllvm.mk \
77- --replace "\$\$(subst /,//," "\$\$(subst /,/,"
78-79 # Fix dynamic linking against llvm
80- ${optionalString (!forceBundledLLVM) ''sed -i 's/, kind = \\"static\\"//g' src/etc/mklldeps.py''}
8182 # Fix the configure script to not require curl as we won't use it
83 sed -i configure \
···98 # https://reviews.llvm.org/rL281650
99 rm -vr src/test/run-pass/issue-36474.rs || true
100000000000000000000101 # Useful debugging parameter
102 # export VERBOSE=1
103- '' +
104- # In src/compiler-rt/cmake/config-ix.cmake, the cmake build falls
105- # back to darwin 10.4. This causes the OS name to be recorded as
106- # "10.4" rather than the expected "osx". But mk/rt.mk expects the
107- # built library name to have an "_osx" suffix on darwin.
108- optionalString stdenv.isDarwin ''
109- substituteInPlace mk/rt.mk --replace "_osx" "_10.4"
110 '';
111112 preConfigure = ''
···120 dontUseCmakeConfigure = true;
121122 # ps is needed for one of the test cases
123- nativeBuildInputs = [ file python2 procps rustPlatform.rust.rustc git cmake ];
0124125 buildInputs = [ ncurses ] ++ targetToolchains
126 ++ optional (!forceBundledLLVM) llvmShared;
···141 sed -i '28s/home_dir().is_some()/true/' ./src/test/run-pass/env-home-dir.rs
142 '';
143144- doCheck = true;
0145 dontSetConfigureCross = true;
146147 # https://github.com/NixOS/nixpkgs/pull/21742#issuecomment-272305764
···151 meta = with stdenv.lib; {
152 homepage = http://www.rust-lang.org/;
153 description = "A safe, concurrent, practical language";
154- maintainers = with maintainers; [ madjar cstrahan wizeman globin havvy wkennington retrry ];
155 license = [ licenses.mit licenses.asl20 ];
156 platforms = platforms.linux ++ platforms.darwin;
157 };
···1{ stdenv, fetchurl, fetchgit, fetchzip, file, python2, tzdata, procps
2, llvm, jemalloc, ncurses, darwin, binutils, rustPlatform, git, cmake, curl
3+, which, libffi, gdb
4+, version
05, forceBundledLLVM ? false
6+, src
7, configureFlags ? []
8, patches
9, targets
10, targetPatches
11, targetToolchains
12+, doCheck ? true
13} @ args:
1415let
16 inherit (stdenv.lib) optional optionalString;
170000018 procps = if stdenv.isDarwin then darwin.ps else args.procps;
1920 llvmShared = llvm.override { enableSharedLibraries = true; };
···26stdenv.mkDerivation {
27 name = "rustc-${version}";
28 inherit version;
29+30+ inherit src;
3132 __impureHostDeps = [ "/usr/lib/libedit.3.dylib" ];
33···42 # Increase codegen units to introduce parallelism within the compiler.
43 RUSTFLAGS = "-Ccodegen-units=10";
4400000045 # We need rust to build rust. If we don't provide it, configure will try to download it.
46 configureFlags = configureFlags
47 ++ [ "--enable-local-rust" "--local-rust-root=${rustPlatform.rust.rustc}" "--enable-rpath" ]
48+ ++ [ "--enable-vendor" "--disable-locked-deps" ]
49+ ++ [ "--enable-llvm-link-shared" ]
50 # ++ [ "--jemalloc-root=${jemalloc}/lib"
51 ++ [ "--default-linker=${stdenv.cc}/bin/cc" "--default-ar=${binutils.out}/bin/ar" ]
0052 ++ optional (stdenv.cc.cc ? isClang) "--enable-clang"
53 ++ optional (targets != []) "--target=${target}"
54 ++ optional (!forceBundledLLVM) "--llvm-root=${llvmShared}";
···58 passthru.target = target;
5960 postPatch = ''
00000000061 # Fix dynamic linking against llvm
62+ #${optionalString (!forceBundledLLVM) ''sed -i 's/, kind = \\"static\\"//g' src/etc/mklldeps.py''}
6364 # Fix the configure script to not require curl as we won't use it
65 sed -i configure \
···80 # https://reviews.llvm.org/rL281650
81 rm -vr src/test/run-pass/issue-36474.rs || true
8283+ # Disable some failing gdb tests. Try re-enabling these when gdb
84+ # is updated past version 7.12.
85+ rm src/test/debuginfo/basic-types-globals.rs
86+ rm src/test/debuginfo/basic-types-mut-globals.rs
87+ rm src/test/debuginfo/c-style-enum.rs
88+ rm src/test/debuginfo/lexical-scopes-in-block-expression.rs
89+ rm src/test/debuginfo/limited-debuginfo.rs
90+ rm src/test/debuginfo/simple-struct.rs
91+ rm src/test/debuginfo/simple-tuple.rs
92+ rm src/test/debuginfo/union-smoke.rs
93+ rm src/test/debuginfo/vec-slices.rs
94+ rm src/test/debuginfo/vec.rs
95+96+ # this can probably be removed when rust is updated beyond 1.17
97+ # fixes a warning in the test harness (I think?) which fails the build due
98+ # to strict warnings
99+ sed -i '/static_in_const/d' src/tools/compiletest/src/main.rs
100+101 # Useful debugging parameter
102 # export VERBOSE=1
103+ ''
104+ + optionalString stdenv.isDarwin ''
105+ # Disable all lldb tests.
106+ # error: Can't run LLDB test because LLDB's python path is not set
107+ rm -vr src/test/debuginfo/*
00108 '';
109110 preConfigure = ''
···118 dontUseCmakeConfigure = true;
119120 # ps is needed for one of the test cases
121+ nativeBuildInputs = [ file python2 procps rustPlatform.rust.rustc git cmake
122+ which libffi gdb ];
123124 buildInputs = [ ncurses ] ++ targetToolchains
125 ++ optional (!forceBundledLLVM) llvmShared;
···140 sed -i '28s/home_dir().is_some()/true/' ./src/test/run-pass/env-home-dir.rs
141 '';
142143+ inherit doCheck;
144+145 dontSetConfigureCross = true;
146147 # https://github.com/NixOS/nixpkgs/pull/21742#issuecomment-272305764
···151 meta = with stdenv.lib; {
152 homepage = http://www.rust-lang.org/;
153 description = "A safe, concurrent, practical language";
154+ maintainers = with maintainers; [ madjar cstrahan wizeman globin havvy wkennington ];
155 license = [ licenses.mit licenses.asl20 ];
156 platforms = platforms.linux ++ platforms.darwin;
157 };