about summary refs log tree commit diff
path: root/pkgs/development/compilers
diff options
context:
space:
mode:
authorPaul Colomiets <paul@colomiets.name>2014-10-16 23:24:33 +0300
committerPaul Colomiets <paul@colomiets.name>2014-10-16 23:25:17 +0300
commit4035d9f27e3c9d9c99b48f7e47a0e4b7e21954cf (patch)
treeb56b14bce348ca95b81a090249b24100eed259bf /pkgs/development/compilers
parent287d6d5d3aef2fd8b7f394cf233810bb2f7da6e2 (diff)
downloadnixlib-4035d9f27e3c9d9c99b48f7e47a0e4b7e21954cf.tar
nixlib-4035d9f27e3c9d9c99b48f7e47a0e4b7e21954cf.tar.gz
nixlib-4035d9f27e3c9d9c99b48f7e47a0e4b7e21954cf.tar.bz2
nixlib-4035d9f27e3c9d9c99b48f7e47a0e4b7e21954cf.tar.lz
nixlib-4035d9f27e3c9d9c99b48f7e47a0e4b7e21954cf.tar.xz
nixlib-4035d9f27e3c9d9c99b48f7e47a0e4b7e21954cf.tar.zst
nixlib-4035d9f27e3c9d9c99b48f7e47a0e4b7e21954cf.zip
rust: Upgrade rust stable to 0.12
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r--pkgs/development/compilers/rustc/0.12.nix (renamed from pkgs/development/compilers/rustc/0.11.nix)21
-rw-r--r--pkgs/development/compilers/rustc/hardcode_paths.patch29
-rw-r--r--pkgs/development/compilers/rustc/local_stage0.patch7
3 files changed, 33 insertions, 24 deletions
diff --git a/pkgs/development/compilers/rustc/0.11.nix b/pkgs/development/compilers/rustc/0.12.nix
index a7246e44a73d..d26e8ba4ddad 100644
--- a/pkgs/development/compilers/rustc/0.11.nix
+++ b/pkgs/development/compilers/rustc/0.12.nix
@@ -16,19 +16,19 @@ assert stdenv.gcc.gcc != null;
 
 */
 
-with ((import ./common.nix) {inherit stdenv; version = "0.11.0"; });
+with ((import ./common.nix) {inherit stdenv; version = "0.12.0"; });
 
 let snapshot = if stdenv.system == "i686-linux"
-      then "84339ea0f796ae468ef86797ef4587274bec19ea"
+      then "555aca74f9a268f80cab2df1147dc6406403e9e4"
       else if stdenv.system == "x86_64-linux"
-      then "bd8a6bc1f28845b7f4b768f6bfa06e7fbdcfcaae"
+      then "6a43c2f6c8ba2cbbcb9da1f7b58f748aef99f431"
       else if stdenv.system == "i686-darwin"
-      then "3f25b2680efbab16ad074477a19d49dcce475977"
+      then "331bd7ef519cbb424188c546273e8c7d738f0894"
       else if stdenv.system == "x86_64-darwin"
-      then "4a8c2e1b7634d73406bac32a1a97893ec3ed818d"
+      then "2c83a79a9febfe1d326acb17c3af76ba053c6ca9"
       else abort "no-snapshot for platform ${stdenv.system}";
-    snapshotDate = "2014-06-21";
-    snapshotRev = "db9af1d";
+    snapshotDate = "2014-10-04";
+    snapshotRev = "749ff5e";
     snapshotName = "rust-stage0-${snapshotDate}-${snapshotRev}-${platform}-${snapshot}.tar.bz2";
 
 in stdenv.mkDerivation {
@@ -37,8 +37,8 @@ in stdenv.mkDerivation {
   inherit meta;
 
   src = fetchurl {
-    url = http://static.rust-lang.org/dist/rust-0.11.0.tar.gz;
-    sha256 = "1fhi8iiyyj5j48fpnp93sfv781z1dm0xy94h534vh4mz91jf7cyi";
+    url = http://static.rust-lang.org/dist/rust-0.12.0.tar.gz;
+    sha256 = "1dv9wxh41230zknbwj34zgjnh1kgvvy6k12kbiy9bnch9nr6cgl8";
   };
 
   # We need rust to build rust. If we don't provide it, configure will try to download it.
@@ -65,7 +65,8 @@ in stdenv.mkDerivation {
   patches = [ ./hardcode_paths.patch ./local_stage0.patch ];
   postPatch = ''
     substituteInPlace src/librustc/back/link.rs \
-      --subst-var-by "ccPath" "${stdenv.gcc}/bin/cc" \
+      --subst-var-by "ccPath" "${stdenv.gcc}/bin/cc"
+    substituteInPlace src/librustc_back/archive.rs \
       --subst-var-by "arPath" "${stdenv.gcc.binutils}/bin/ar"
   '';
 
diff --git a/pkgs/development/compilers/rustc/hardcode_paths.patch b/pkgs/development/compilers/rustc/hardcode_paths.patch
index 77e4c3f37887..8701cd3c9829 100644
--- a/pkgs/development/compilers/rustc/hardcode_paths.patch
+++ b/pkgs/development/compilers/rustc/hardcode_paths.patch
@@ -1,8 +1,8 @@
 diff --git a/src/librustc/back/link.rs b/src/librustc/back/link.rs
-index 7a3e912..ced75fa 100644
+index 1cc60fc..2e94b99 100644
 --- a/src/librustc/back/link.rs
 +++ b/src/librustc/back/link.rs
-@@ -766,24 +766,15 @@ pub fn output_lib_filename(id: &CrateId) -> String {
+@@ -383,18 +383,9 @@ pub fn mangle_internal_name_by_path_and_seq(path: PathElems, flav: &str) -> Stri
  
  pub fn get_cc_prog(sess: &Session) -> String {
      match sess.opts.cg.linker {
@@ -15,18 +15,23 @@ index 7a3e912..ced75fa 100644
 -    // In the future, FreeBSD will use clang as default compiler.
 -    // It would be flexible to use cc (system's default C compiler)
 -    // instead of hard-coded gcc.
--    // For win32, there is no cc command, so we add a condition to make it use gcc.
+-    // For Windows, there is no cc command, so we add a condition to make it use gcc.
 -    match sess.targ_cfg.os {
--        abi::OsWin32 => "gcc",
+-        abi::OsWindows => "gcc",
 -        _ => "cc",
 -    }.to_string()
  }
  
- pub fn get_ar_prog(sess: &Session) -> String {
-     match sess.opts.cg.ar {
-         Some(ref ar) => (*ar).clone(),
--        None => "ar".to_string()
-+        None => "@arPath@".to_string()
-     }
- }
- 
+ pub fn remove(sess: &Session, path: &Path) {
+diff --git a/src/librustc_back/archive.rs b/src/librustc_back/archive.rs
+index 060dda5..fecf76b 100644
+--- a/src/librustc_back/archive.rs
++++ b/src/librustc_back/archive.rs
+@@ -53,7 +53,7 @@ fn run_ar(handler: &ErrorHandler, maybe_ar_prog: &Option<String>,
+           paths: &[&Path]) -> ProcessOutput {
+     let ar = match *maybe_ar_prog {
+         Some(ref ar) => ar.as_slice(),
+-        None => "ar"
++        None => "@arPath@"
+     };
+     let mut cmd = Command::new(ar);
diff --git a/pkgs/development/compilers/rustc/local_stage0.patch b/pkgs/development/compilers/rustc/local_stage0.patch
index 1261b2d458da..2f38d7c1757c 100644
--- a/pkgs/development/compilers/rustc/local_stage0.patch
+++ b/pkgs/development/compilers/rustc/local_stage0.patch
@@ -2,12 +2,15 @@ diff --git a/src/etc/local_stage0.sh b/src/etc/local_stage0.sh
 index e78f231..6b6773b 100755
 --- a/src/etc/local_stage0.sh
 +++ b/src/etc/local_stage0.sh
-@@ -53,8 +53,3 @@ if [ -z $TARG_DIR ]; then
+@@ -53,11 +53,6 @@
  fi
-
+ 
  cp ${PREFIX}/bin/rustc${BIN_SUF} ${TARG_DIR}/stage0/bin/
 -cp ${PREFIX}/${LIB_DIR}/${RUSTLIBDIR}/${TARG_DIR}/${LIB_DIR}/* ${TARG_DIR}/stage0/${LIB_DIR}/
 -cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}extra*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/
 -cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}rust*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/
 -cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}std*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/
 -cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}syntax*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/
+ 
+ # do not fail if one of the above fails, as all we need is a working rustc!
+ exit 0