summary refs log tree commit diff
path: root/pkgs/development/compilers/rust/default.nix
diff options
context:
space:
mode:
authorJohn Ericson <Ericson2314@Yahoo.com>2014-07-30 06:00:56 +0200
committerJohn Ericson <Ericson2314@Yahoo.com>2014-07-30 07:39:06 +0200
commit210452979adb21355f1a2c5dbcc16608713f9929 (patch)
treeb017aa861c1f707fe3b336bc2605df32bedd9720 /pkgs/development/compilers/rust/default.nix
parent0a750e0f390cb726f2dbc3099beb78a7e21a12a3 (diff)
downloadnixpkgs-210452979adb21355f1a2c5dbcc16608713f9929.tar
nixpkgs-210452979adb21355f1a2c5dbcc16608713f9929.tar.gz
nixpkgs-210452979adb21355f1a2c5dbcc16608713f9929.tar.bz2
nixpkgs-210452979adb21355f1a2c5dbcc16608713f9929.tar.lz
nixpkgs-210452979adb21355f1a2c5dbcc16608713f9929.tar.xz
nixpkgs-210452979adb21355f1a2c5dbcc16608713f9929.tar.zst
nixpkgs-210452979adb21355f1a2c5dbcc16608713f9929.zip
rust: Prepare for more versions part 1:
 - Factor out some things that REALLY shouldn't change between versions
Diffstat (limited to 'pkgs/development/compilers/rust/default.nix')
-rw-r--r--pkgs/development/compilers/rust/default.nix42
1 files changed, 16 insertions, 26 deletions
diff --git a/pkgs/development/compilers/rust/default.nix b/pkgs/development/compilers/rust/default.nix
index 2c27cf778a1..c2696bae922 100644
--- a/pkgs/development/compilers/rust/default.nix
+++ b/pkgs/development/compilers/rust/default.nix
@@ -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" ];
-  };
 }
-