rust: Prepare for more versions part 1:

- Factor out some things that REALLY shouldn't change between versions
This commit is contained in:
John Ericson 2014-07-30 06:00:56 +02:00
parent 0a750e0f39
commit 210452979a
2 changed files with 48 additions and 26 deletions

View file

@ -0,0 +1,32 @@
{stdenv, version}:
{
inherit version;
platform = if stdenv.system == "i686-linux"
then "linux-i386"
else if stdenv.system == "x86_64-linux"
then "linux-x86_64"
else if stdenv.system == "x86_64-darwin"
then "macos-x86_64"
else abort "no snapshot to boostrap for this platform (missing platform url suffix)";
target = if stdenv.system == "i686-linux"
then "i686-unknown-linux-gnu"
else if stdenv.system == "x86_64-linux"
then "x86_64-unknown-linux-gnu"
else if stdenv.system == "x86_64-darwin"
then "x86_64-apple-darwin"
else abort "no snapshot to boostrap for this platform (missing target triple";
meta = with stdenv.lib; {
homepage = http://www.rust-lang.org/;
description = "A safe, concurrent, practical language";
maintainers = with maintainers; [ madjar cstrahan ];
license = map (builtins.getAttr "shortName") [ licenses.mit licenses.asl20 ];
# platforms as per http://static.rust-lang.org/doc/master/tutorial.html#getting-started
platforms = [ "i686-linux" "x86_64-linux" "x86_64-darwin" ];
};
name = "rust-${version}";
}

View file

@ -14,23 +14,23 @@
*/
with if stdenv.system == "i686-linux" then {
platform = "linux-i386";
snapshot = "84339ea0f796ae468ef86797ef4587274bec19ea";
target = "i686-unknown-linux-gnu";
} else if stdenv.system == "x86_64-linux" then {
platform = "linux-x86_64";
snapshot = "bd8a6bc1f28845b7f4b768f6bfa06e7fbdcfcaae";
target = "x86_64-unknown-linux-gnu";
} else if stdenv.system == "x86_64-darwin" then {
platform = "macos-x86_64";
snapshot = "4a8c2e1b7634d73406bac32a1a97893ec3ed818d";
} else {};
let snapshotDate = "2014-06-21";
with ((import ./common.nix) {inherit stdenv; version = "0.11.0"; });
let snapshot = if stdenv.system == "i686-linux"
then "84339ea0f796ae468ef86797ef4587274bec19ea"
else if stdenv.system == "x86_64-linux"
then "bd8a6bc1f28845b7f4b768f6bfa06e7fbdcfcaae"
else if stdenv.system == "x86_64-darwin"
then "4a8c2e1b7634d73406bac32a1a97893ec3ed818d"
else abort "no-snapshot for platform ${stdenv.system}";
snapshotDate = "2014-06-21";
snapshotRev = "db9af1d";
snapshotName = "rust-stage0-${snapshotDate}-${snapshotRev}-${platform}-${snapshot}.tar.bz2"; in
stdenv.mkDerivation {
name = "rust-0.11.0";
snapshotName = "rust-stage0-${snapshotDate}-${snapshotRev}-${platform}-${snapshot}.tar.bz2";
in stdenv.mkDerivation {
inherit name;
inherit version;
inherit meta;
src = fetchurl {
url = http://static.rust-lang.org/dist/rust-0.11.0.tar.gz;
@ -67,14 +67,4 @@ stdenv.mkDerivation {
buildInputs = [ which file perl curl python27 makeWrapper ];
enableParallelBuilding = true;
meta = with stdenv.lib; {
homepage = http://www.rust-lang.org/;
description = "A safe, concurrent, practical language";
maintainers = with maintainers; [ madjar cstrahan ];
license = map (builtins.getAttr "shortName") [ licenses.mit licenses.asl20 ];
# platforms as per http://static.rust-lang.org/doc/master/tutorial.html#getting-started
platforms = [ "i686-linux" "x86_64-linux" "x86_64-darwin" ];
};
}