about summary refs log tree commit diff
path: root/pkgs/development/compilers/ghc
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2017-09-10 15:36:48 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2017-09-23 12:58:07 -0400
commita8ef3f67420fb9b87c5b238c8fc93d4cda446a34 (patch)
tree7ab03f741714bd65a03dd108ef9c6a87902a2899 /pkgs/development/compilers/ghc
parent17de4355334f450194b0022b9a09f9b13cdeba20 (diff)
downloadnixlib-a8ef3f67420fb9b87c5b238c8fc93d4cda446a34.tar
nixlib-a8ef3f67420fb9b87c5b238c8fc93d4cda446a34.tar.gz
nixlib-a8ef3f67420fb9b87c5b238c8fc93d4cda446a34.tar.bz2
nixlib-a8ef3f67420fb9b87c5b238c8fc93d4cda446a34.tar.lz
nixlib-a8ef3f67420fb9b87c5b238c8fc93d4cda446a34.tar.xz
nixlib-a8ef3f67420fb9b87c5b238c8fc93d4cda446a34.tar.zst
nixlib-a8ef3f67420fb9b87c5b238c8fc93d4cda446a34.zip
ghc prebuilt: Clean up syntax, without changes hashes
If I'm going to make a bunch more of these, I think it's a good idea to
make them more uniform first.
Diffstat (limited to 'pkgs/development/compilers/ghc')
-rw-r--r--pkgs/development/compilers/ghc/6.10.2-binary.nix28
-rw-r--r--pkgs/development/compilers/ghc/7.0.4-binary.nix30
-rw-r--r--pkgs/development/compilers/ghc/7.4.2-binary.nix30
3 files changed, 45 insertions, 43 deletions
diff --git a/pkgs/development/compilers/ghc/6.10.2-binary.nix b/pkgs/development/compilers/ghc/6.10.2-binary.nix
index 1b9d81d2f121..99e54ff5f673 100644
--- a/pkgs/development/compilers/ghc/6.10.2-binary.nix
+++ b/pkgs/development/compilers/ghc/6.10.2-binary.nix
@@ -1,24 +1,26 @@
-{stdenv, lib, fetchurl, perl, libedit, ncurses5, gmp}:
+{ stdenv
+, fetchurl, perl
+, libedit, ncurses5, gmp
+}:
 
 stdenv.mkDerivation rec {
   version = "6.10.2";
 
   name = "ghc-${version}-binary";
 
-  src =
-    if stdenv.system == "i686-linux" then
-      fetchurl {
+  src = fetchurl ({
+      "i686-linux" = {
         # This binary requires libedit.so.0 (rather than libedit.so.2).
         url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux.tar.bz2";
         sha256 = "1fw0zr2qshlpk8s0d16k27zcv5263nqdg2xds5ymw8ff6qz9rz9b";
-      }
-    else if stdenv.system == "x86_64-linux" then
-      fetchurl {
+      };
+      "x86_64-linux" = {
         # Idem.
         url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2";
         sha256 = "1rd2j7lmcfsm2rdfb5g6q0l8dz3sxadk5m3d2f69d4a6g4p4h7jj";
-      }
-    else throw "cannot bootstrap GHC on this platform";
+      };
+    }.${stdenv.hostPlatform.system}
+      or (throw "cannot bootstrap GHC on this platform"));
 
   buildInputs = [perl];
 
@@ -37,17 +39,17 @@ stdenv.mkDerivation rec {
      '' +
     # On Linux, use patchelf to modify the executables so that they can
     # find editline/gmp.
-    (if stdenv.isLinux then ''
+    stdenv.lib.optionalString stdenv.hostPlatform.isLinux ''
       find . -type f -perm -0100 \
           -exec patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
-          --set-rpath "${lib.makeLibraryPath [ libedit ncurses5 gmp ]}" {} \;
+          --set-rpath "${stdenv.lib.makeLibraryPath [ libedit ncurses5 gmp ]}" {} \;
       for prog in ld ar gcc strip ranlib; do
         find . -name "setup-config" -exec sed -i "s@/usr/bin/$prog@$(type -p $prog)@g" {} \;
       done
-     '' else "");
+     '';
 
   configurePhase = ''
-    ./configure --prefix=$out --with-gmp-libraries=${lib.getLib gmp}/lib --with-gmp-includes=${lib.getDev gmp}/include
+    ./configure --prefix=$out --with-gmp-libraries=${stdenv.lib.getLib gmp}/lib --with-gmp-includes=${stdenv.lib.getDev gmp}/include
   '';
 
   # Stripping combined with patchelf breaks the executables (they die
diff --git a/pkgs/development/compilers/ghc/7.0.4-binary.nix b/pkgs/development/compilers/ghc/7.0.4-binary.nix
index a53098937ce8..2f758c47466e 100644
--- a/pkgs/development/compilers/ghc/7.0.4-binary.nix
+++ b/pkgs/development/compilers/ghc/7.0.4-binary.nix
@@ -1,32 +1,32 @@
-{stdenv, fetchurl, perl, ncurses5, gmp, libiconv}:
+{ stdenv
+, fetchurl, perl
+, ncurses5, gmp, libiconv
+}:
 
 stdenv.mkDerivation rec {
   version = "7.0.4";
 
   name = "ghc-${version}-binary";
 
-  src =
-    if stdenv.system == "i686-linux" then
-      fetchurl {
+  src = fetchurl ({
+      "i686-linux" = {
         url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux.tar.bz2";
         sha256 = "0mfnihiyjl06f5w1yrjp36sw9g67g2ymg5sdl0g23h1pab99jx63";
-      }
-    else if stdenv.system == "x86_64-linux" then
-      fetchurl {
+      };
+      "x86_64-linux" = {
         url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2";
         sha256 = "0mc4rhqcxz427wq4zgffmnn0d2yjqvy6af4x9mha283p1gdj5q99";
-      }
-    else if stdenv.system == "i686-darwin" then
-      fetchurl {
+      };
+      "i686-darwin" = {
         url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-apple-darwin.tar.bz2";
         sha256 = "0qj45hslrrr8zfks8m1jcb3awwx9rh35ndnpfmb0gwb6j7azq5n3";
-      }
-    else if stdenv.system == "x86_64-darwin" then
-      fetchurl {
+      };
+      "x86_64-darwin" = {
         url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-apple-darwin.tar.bz2";
         sha256 = "1m2ml88p1swf4dnv2vq8hz4drcp46n3ahpfi05wh01ajkf8hnn3l";
-      }
-    else throw "cannot bootstrap GHC on this platform";
+      };
+    }.${stdenv.hostPlatform.system}
+      or (throw "cannot bootstrap GHC on this platform"));
 
   buildInputs = [perl];
 
diff --git a/pkgs/development/compilers/ghc/7.4.2-binary.nix b/pkgs/development/compilers/ghc/7.4.2-binary.nix
index cfbc1e8dd170..60c00c2f7f53 100644
--- a/pkgs/development/compilers/ghc/7.4.2-binary.nix
+++ b/pkgs/development/compilers/ghc/7.4.2-binary.nix
@@ -1,32 +1,32 @@
-{stdenv, fetchurl, perl, ncurses5, gmp, libiconv, makeWrapper}:
+{ stdenv
+, fetchurl, perl, makeWrapper
+, ncurses5, gmp, libiconv
+}:
 
 stdenv.mkDerivation rec {
   version = "7.4.2";
 
   name = "ghc-${version}-binary";
 
-  src =
-    if stdenv.system == "i686-linux" then
-      fetchurl {
+  src = fetchurl ({
+      "i686-linux" = {
         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" = {
         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" = {
         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" = {
         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];