rust: update to 0.10 release
This commit is contained in:
parent
282a662a32
commit
6d5db3e93b
@ -16,66 +16,65 @@
|
|||||||
|
|
||||||
with if stdenv.system == "i686-linux" then {
|
with if stdenv.system == "i686-linux" then {
|
||||||
platform = "linux-i386";
|
platform = "linux-i386";
|
||||||
snapshot = "03e60be1f1b90dddd15f3597bc45ec8d9626b35d";
|
snapshot = "3bef5684fd0582fbd4ddebd4514182d4f72924f7";
|
||||||
snapshot_sha = "1v1l082gj7d2d4p53xgsxz2k965jcgqhw4cyxmjxc6yh5fw0idx6";
|
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 = "aa8fbbacdb1d8a078f3a3fe3478dcbc506bd4090";
|
snapshot = "a7b2af1076d48e4a687a71a21478293e834349bd";
|
||||||
snapshot_sha = "17inc23jpznqp0vnskvznm74mm24c1nffhz2bkadhvp2ww0vpjjx";
|
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 = "ec746585cb20d1f9edffec74f6ff8be6e93a75f7";
|
snapshot = "22b884a3876cb3e40ad942ad68a496b5f239fca5";
|
||||||
snapshot_sha = "0r8f8x3x8jb1hm40pbgj4i9ll2y5dgjgvj24qg7mp4crbqcqhkd2";
|
snapshot_sha = "0qabkvyryiwlqhzy1kscff27rx788bv7lh7d8m1hnsv38wqhwqqb";
|
||||||
} else {};
|
} else {};
|
||||||
let snapshotDate = "2014-01-05";
|
let snapshotDate = "2014-03-28";
|
||||||
snapshotRev = "a6d3e57";
|
snapshotRev = "b8601a3";
|
||||||
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.9";
|
name = "rust-0.10";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = http://static.rust-lang.org/dist/rust-0.9.tar.gz;
|
url = http://static.rust-lang.org/dist/rust-0.10.tar.gz;
|
||||||
sha256 = "1lfmgnn00wrc30nf5lgg52w58ir3xpsnpmzk2v5a35xp8lsir4f0";
|
sha256 = "c72cfbbf03016804a81d7b68e8258ffaf018f8f5a25550ad64571ce6c2642cf9";
|
||||||
};
|
};
|
||||||
|
|
||||||
# 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.
|
||||||
snapshot = fetchurl {
|
snapshot = stdenv.mkDerivation {
|
||||||
url = "http://static.rust-lang.org/stage0-snapshots/${snapshotName}";
|
name = "rust-stage0";
|
||||||
sha256 = snapshot_sha;
|
src = fetchurl {
|
||||||
|
url = "http://static.rust-lang.org/stage0-snapshots/${snapshotName}";
|
||||||
|
sha256 = snapshot_sha;
|
||||||
|
};
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p "$out"
|
||||||
|
cp -r bin "$out/bin"
|
||||||
|
'' + (if stdenv.isLinux then ''
|
||||||
|
patchelf --interpreter ${stdenv.glibc}/lib/${stdenv.gcc.dynamicLinker} \
|
||||||
|
--set-rpath ${stdenv.gcc.gcc}/lib/:${stdenv.gcc.gcc}/lib64/ \
|
||||||
|
$out/bin/rustc
|
||||||
|
'' else "");
|
||||||
};
|
};
|
||||||
|
|
||||||
# Put the snapshot where it is expected
|
configureFlags = [ "--enable-local-rust" "--local-rust-root=$snapshot" ];
|
||||||
postUnpack = ''
|
|
||||||
mkdir $sourceRoot/dl
|
|
||||||
ln -s $snapshot $sourceRoot/dl/${snapshotName}
|
|
||||||
'';
|
|
||||||
|
|
||||||
# The compiler requires cc, so we patch the source to tell it where to find it
|
# The compiler requires cc, so we patch the source to tell it where to find it
|
||||||
patches = [ ./hardcode_paths.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 "gccPath" ${stdenv.gcc}/bin/cc \
|
||||||
--subst-var-by "binutilsPath" ${stdenv.gcc.binutils}/bin/ar
|
--subst-var-by "binutilsPath" ${stdenv.gcc.binutils}/bin/ar
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Modify the snapshot compiler so that is can be executed
|
|
||||||
preBuild = if stdenv.isLinux then ''
|
|
||||||
make ${target}/stage0/bin/rustc
|
|
||||||
patchelf --interpreter ${stdenv.glibc}/lib/${stdenv.gcc.dynamicLinker} \
|
|
||||||
--set-rpath ${stdenv.gcc.gcc}/lib/:${stdenv.gcc.gcc}/lib64/ \
|
|
||||||
${target}/stage0/bin/rustc
|
|
||||||
'' else null;
|
|
||||||
|
|
||||||
buildInputs = [ which file perl curl python27 makeWrapper ];
|
buildInputs = [ which file perl curl python27 makeWrapper ];
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
meta = {
|
meta = with stdenv.lib; {
|
||||||
homepage = http://www.rust-lang.org/;
|
homepage = http://www.rust-lang.org/;
|
||||||
description = "A safe, concurrent, practical language";
|
description = "A safe, concurrent, practical language";
|
||||||
maintainers = [ stdenv.lib.maintainers.madjar ];
|
maintainers = with maintainers; [ madjar cstrahan ];
|
||||||
license = map (builtins.getAttr "shortName") [ stdenv.lib.licenses.mit stdenv.lib.licenses.asl20 ];
|
license = map (builtins.getAttr "shortName") [ licenses.mit licenses.asl20 ];
|
||||||
# platforms as per http://static.rust-lang.org/doc/master/tutorial.html#getting-started
|
# platforms as per http://static.rust-lang.org/doc/master/tutorial.html#getting-started
|
||||||
platforms = [ "i686-linux" "x86_64-linux" "x86_64-darwin" ];
|
platforms = [ "i686-linux" "x86_64-linux" "x86_64-darwin" ];
|
||||||
};
|
};
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
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 101b2e3..124267f 100644
|
index f198a41..3a47e51 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
|
||||||
@@ -728,7 +728,7 @@ pub fn get_cc_prog(sess: Session) -> ~str {
|
@@ -730,7 +730,7 @@ pub fn get_cc_prog(sess: &Session) -> ~str {
|
||||||
_ => {},
|
_ => {},
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -10,18 +10,17 @@ index 101b2e3..124267f 100644
|
|||||||
+ ~"@gccPath@"
|
+ ~"@gccPath@"
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_ar_prog(sess: Session) -> ~str {
|
pub fn get_ar_prog(sess: &Session) -> ~str {
|
||||||
@@ -737,27 +737,9 @@ pub fn get_ar_prog(sess: Session) -> ~str {
|
@@ -739,26 +739,7 @@ pub fn get_ar_prog(sess: &Session) -> ~str {
|
||||||
None => {}
|
None => {}
|
||||||
}
|
}
|
||||||
|
|
||||||
- get_system_tool(sess, "ar")
|
- get_system_tool(sess, "ar")
|
||||||
+ ~"@binutilsPath@"
|
-}
|
||||||
}
|
-
|
||||||
|
-fn get_system_tool(sess: &Session, tool: &str) -> ~str {
|
||||||
-fn get_system_tool(sess: Session, tool: &str) -> ~str {
|
|
||||||
- match sess.targ_cfg.os {
|
- match sess.targ_cfg.os {
|
||||||
- abi::OsAndroid => match sess.opts.android_cross_path {
|
- abi::OsAndroid => match sess.opts.cg.android_cross_path {
|
||||||
- Some(ref path) => {
|
- Some(ref path) => {
|
||||||
- let tool_str = match tool {
|
- let tool_str = match tool {
|
||||||
- "cc" => "gcc",
|
- "cc" => "gcc",
|
||||||
@ -31,14 +30,12 @@ index 101b2e3..124267f 100644
|
|||||||
- }
|
- }
|
||||||
- None => {
|
- None => {
|
||||||
- sess.fatal(format!("need Android NDK path for the '{}' tool \
|
- sess.fatal(format!("need Android NDK path for the '{}' tool \
|
||||||
- (--android-cross-path)", tool))
|
- (-C android-cross-path)", tool))
|
||||||
- }
|
- }
|
||||||
- },
|
- },
|
||||||
- _ => tool.to_owned(),
|
- _ => tool.to_owned(),
|
||||||
- }
|
- }
|
||||||
-}
|
+ ~"@binutilsPath@"
|
||||||
|
}
|
||||||
|
|
||||||
/// Perform the linkage portion of the compilation phase. This will generate all
|
fn remove(sess: &Session, path: &Path) {
|
||||||
/// of the requested outputs for this compilation session.
|
|
||||||
|
|
||||||
|
|
||||||
|
13
pkgs/development/compilers/rust/local_stage0.patch
Normal file
13
pkgs/development/compilers/rust/local_stage0.patch
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
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
|
||||||
|
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}/
|
Loading…
x
Reference in New Issue
Block a user