summary refs log tree commit diff
path: root/pkgs/development/compilers/ghc/7.4.2-binary.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/compilers/ghc/7.4.2-binary.nix')
-rw-r--r--pkgs/development/compilers/ghc/7.4.2-binary.nix33
1 files changed, 18 insertions, 15 deletions
diff --git a/pkgs/development/compilers/ghc/7.4.2-binary.nix b/pkgs/development/compilers/ghc/7.4.2-binary.nix
index 100bb87768b..eae45bc0b92 100644
--- a/pkgs/development/compilers/ghc/7.4.2-binary.nix
+++ b/pkgs/development/compilers/ghc/7.4.2-binary.nix
@@ -1,32 +1,35 @@
-{stdenv, fetchurl, perl, ncurses5, gmp, libiconv, makeWrapper}:
+{ stdenv
+, fetchurl, perl, makeWrapper
+, ncurses5, gmp, libiconv
+}:
+
+# Prebuilt only does native
+assert stdenv.targetPlatform == stdenv.hostPlatform;
 
 stdenv.mkDerivation rec {
   version = "7.4.2";
 
   name = "ghc-${version}-binary";
 
-  src =
-    if stdenv.system == "i686-linux" then
-      fetchurl {
+  src = {
+      "i686-linux" = fetchurl {
         url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux.tar.bz2";
         sha256 = "0gny7knhss0w0d9r6jm1gghrcb8kqjvj94bb7hxf9syrk4fxlcxi";
-      }
-    else if stdenv.system == "x86_64-linux" then
-      fetchurl {
+      };
+      "x86_64-linux" = fetchurl {
         url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2";
         sha256 = "043jabd0lh6n1zlqhysngbpvlsdznsa2mmsj08jyqgahw9sjb5ns";
-      }
-    else if stdenv.system == "i686-darwin" then
-      fetchurl {
+      };
+      "i686-darwin" =  fetchurl {
         url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-apple-darwin.tar.bz2";
         sha256 = "1vrbs3pzki37hzym1f1nh07lrqh066z3ypvm81fwlikfsvk4djc0";
-      }
-    else if stdenv.system == "x86_64-darwin" then
-      fetchurl {
+      };
+      "x86_64-darwin" = fetchurl {
         url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-apple-darwin.tar.bz2";
         sha256 = "1imzqc0slpg0r6p40n5a9m18cbcm0m86z8dgyhfxcckksw54mzwf";
-      }
-    else throw "cannot bootstrap GHC on this platform";
+      };
+    }.${stdenv.hostPlatform.system}
+      or (throw "cannot bootstrap GHC on this platform");
 
   buildInputs = [perl];