rust: Update to 0.11
This commit is contained in:
parent
48817c8d97
commit
febf46bf5c
2 changed files with 39 additions and 50 deletions
|
@ -16,28 +16,25 @@
|
||||||
|
|
||||||
with if stdenv.system == "i686-linux" then {
|
with if stdenv.system == "i686-linux" then {
|
||||||
platform = "linux-i386";
|
platform = "linux-i386";
|
||||||
snapshot = "3bef5684fd0582fbd4ddebd4514182d4f72924f7";
|
snapshot = "84339ea0f796ae468ef86797ef4587274bec19ea";
|
||||||
snapshot_sha = "1c72d65pcgm3z4sly7al09mjvpp8asxbbv7iyzzv5k8f66ny2agy";
|
|
||||||
target = "i686-unknown-linux-gnu";
|
target = "i686-unknown-linux-gnu";
|
||||||
} else if stdenv.system == "x86_64-linux" then {
|
} else if stdenv.system == "x86_64-linux" then {
|
||||||
platform = "linux-x86_64";
|
platform = "linux-x86_64";
|
||||||
snapshot = "a7b2af1076d48e4a687a71a21478293e834349bd";
|
snapshot = "bd8a6bc1f28845b7f4b768f6bfa06e7fbdcfcaae";
|
||||||
snapshot_sha = "1c72d65pcgm3z4sly7al09mjvpp8asxbbv7iyzzv5k8f66ny2agy";
|
|
||||||
target = "x86_64-unknown-linux-gnu";
|
target = "x86_64-unknown-linux-gnu";
|
||||||
} else if stdenv.system == "x86_64-darwin" then {
|
} else if stdenv.system == "x86_64-darwin" then {
|
||||||
platform = "macos-x86_64";
|
platform = "macos-x86_64";
|
||||||
snapshot = "22b884a3876cb3e40ad942ad68a496b5f239fca5";
|
snapshot = "4a8c2e1b7634d73406bac32a1a97893ec3ed818d";
|
||||||
snapshot_sha = "0qabkvyryiwlqhzy1kscff27rx788bv7lh7d8m1hnsv38wqhwqqb";
|
|
||||||
} else {};
|
} else {};
|
||||||
let snapshotDate = "2014-03-28";
|
let snapshotDate = "2014-06-21";
|
||||||
snapshotRev = "b8601a3";
|
snapshotRev = "db9af1d";
|
||||||
snapshotName = "rust-stage0-${snapshotDate}-${snapshotRev}-${platform}-${snapshot}.tar.bz2"; in
|
snapshotName = "rust-stage0-${snapshotDate}-${snapshotRev}-${platform}-${snapshot}.tar.bz2"; in
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "rust-0.10";
|
name = "rust-0.11.0";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = http://static.rust-lang.org/dist/rust-0.10.tar.gz;
|
url = http://static.rust-lang.org/dist/rust-0.11.0.tar.gz;
|
||||||
sha256 = "c72cfbbf03016804a81d7b68e8258ffaf018f8f5a25550ad64571ce6c2642cf9";
|
sha256 = "1fhi8iiyyj5j48fpnp93sfv781z1dm0xy94h534vh4mz91jf7cyi";
|
||||||
};
|
};
|
||||||
|
|
||||||
# We need rust to build rust. If we don't provide it, configure will try to download it.
|
# We need rust to build rust. If we don't provide it, configure will try to download it.
|
||||||
|
@ -45,15 +42,16 @@ stdenv.mkDerivation {
|
||||||
name = "rust-stage0";
|
name = "rust-stage0";
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "http://static.rust-lang.org/stage0-snapshots/${snapshotName}";
|
url = "http://static.rust-lang.org/stage0-snapshots/${snapshotName}";
|
||||||
sha256 = snapshot_sha;
|
sha1 = snapshot;
|
||||||
};
|
};
|
||||||
|
dontStrip = true;
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p "$out"
|
mkdir -p "$out"
|
||||||
cp -r bin "$out/bin"
|
cp -r bin "$out/bin"
|
||||||
'' + (if stdenv.isLinux then ''
|
'' + (if stdenv.isLinux then ''
|
||||||
patchelf --interpreter ${stdenv.glibc}/lib/${stdenv.gcc.dynamicLinker} \
|
patchelf --interpreter "${stdenv.glibc}/lib/${stdenv.gcc.dynamicLinker}" \
|
||||||
--set-rpath ${stdenv.gcc.gcc}/lib/:${stdenv.gcc.gcc}/lib64/ \
|
--set-rpath "${stdenv.gcc.gcc}/lib/:${stdenv.gcc.gcc}/lib64/" \
|
||||||
$out/bin/rustc
|
"$out/bin/rustc"
|
||||||
'' else "");
|
'' else "");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -63,8 +61,8 @@ stdenv.mkDerivation {
|
||||||
patches = [ ./hardcode_paths.patch ./local_stage0.patch ];
|
patches = [ ./hardcode_paths.patch ./local_stage0.patch ];
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
substituteInPlace src/librustc/back/link.rs \
|
substituteInPlace src/librustc/back/link.rs \
|
||||||
--subst-var-by "gccPath" ${stdenv.gcc}/bin/cc \
|
--subst-var-by "ccPath" "${stdenv.gcc}/bin/cc" \
|
||||||
--subst-var-by "binutilsPath" ${stdenv.gcc.binutils}/bin/ar
|
--subst-var-by "arPath" "${stdenv.gcc.binutils}/bin/ar"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
buildInputs = [ which file perl curl python27 makeWrapper ];
|
buildInputs = [ which file perl curl python27 makeWrapper ];
|
||||||
|
|
|
@ -1,41 +1,32 @@
|
||||||
diff --git a/src/librustc/back/link.rs b/src/librustc/back/link.rs
|
diff --git a/src/librustc/back/link.rs b/src/librustc/back/link.rs
|
||||||
index f198a41..3a47e51 100644
|
index 7a3e912..ced75fa 100644
|
||||||
--- a/src/librustc/back/link.rs
|
--- a/src/librustc/back/link.rs
|
||||||
+++ b/src/librustc/back/link.rs
|
+++ b/src/librustc/back/link.rs
|
||||||
@@ -730,7 +730,7 @@ pub fn get_cc_prog(sess: &Session) -> ~str {
|
@@ -766,24 +766,15 @@ pub fn output_lib_filename(id: &CrateId) -> String {
|
||||||
_ => {},
|
|
||||||
|
pub fn get_cc_prog(sess: &Session) -> String {
|
||||||
|
match sess.opts.cg.linker {
|
||||||
|
- Some(ref linker) => return linker.to_string(),
|
||||||
|
- None => {}
|
||||||
|
+ Some(ref linker) => linker.to_string(),
|
||||||
|
+ None => "@ccPath@".to_string()
|
||||||
}
|
}
|
||||||
|
|
||||||
- get_system_tool(sess, "cc")
|
|
||||||
+ ~"@gccPath@"
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn get_ar_prog(sess: &Session) -> ~str {
|
|
||||||
@@ -739,26 +739,7 @@ pub fn get_ar_prog(sess: &Session) -> ~str {
|
|
||||||
None => {}
|
|
||||||
}
|
|
||||||
|
|
||||||
- get_system_tool(sess, "ar")
|
|
||||||
-}
|
|
||||||
-
|
-
|
||||||
-fn get_system_tool(sess: &Session, tool: &str) -> ~str {
|
- // 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.
|
||||||
- match sess.targ_cfg.os {
|
- match sess.targ_cfg.os {
|
||||||
- abi::OsAndroid => match sess.opts.cg.android_cross_path {
|
- abi::OsWin32 => "gcc",
|
||||||
- Some(ref path) => {
|
- _ => "cc",
|
||||||
- let tool_str = match tool {
|
- }.to_string()
|
||||||
- "cc" => "gcc",
|
}
|
||||||
- _ => tool
|
|
||||||
- };
|
pub fn get_ar_prog(sess: &Session) -> String {
|
||||||
- format!("{}/bin/arm-linux-androideabi-{}", *path, tool_str)
|
match sess.opts.cg.ar {
|
||||||
- }
|
Some(ref ar) => (*ar).clone(),
|
||||||
- None => {
|
- None => "ar".to_string()
|
||||||
- sess.fatal(format!("need Android NDK path for the '{}' tool \
|
+ None => "@arPath@".to_string()
|
||||||
- (-C android-cross-path)", tool))
|
}
|
||||||
- }
|
|
||||||
- },
|
|
||||||
- _ => tool.to_owned(),
|
|
||||||
- }
|
|
||||||
+ ~"@binutilsPath@"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn remove(sess: &Session, path: &Path) {
|
|
||||||
|
|
Loading…
Reference in a new issue