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.

+45 -43
+15 -13
pkgs/development/compilers/ghc/6.10.2-binary.nix
··· 1 - {stdenv, lib, fetchurl, perl, libedit, ncurses5, gmp}: 1 + { stdenv 2 + , fetchurl, perl 3 + , libedit, ncurses5, gmp 4 + }: 2 5 3 6 stdenv.mkDerivation rec { 4 7 version = "6.10.2"; 5 8 6 9 name = "ghc-${version}-binary"; 7 10 8 - src = 9 - if stdenv.system == "i686-linux" then 10 - fetchurl { 11 + src = fetchurl ({ 12 + "i686-linux" = { 11 13 # This binary requires libedit.so.0 (rather than libedit.so.2). 12 14 url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux.tar.bz2"; 13 15 sha256 = "1fw0zr2qshlpk8s0d16k27zcv5263nqdg2xds5ymw8ff6qz9rz9b"; 14 - } 15 - else if stdenv.system == "x86_64-linux" then 16 - fetchurl { 16 + }; 17 + "x86_64-linux" = { 17 18 # Idem. 18 19 url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2"; 19 20 sha256 = "1rd2j7lmcfsm2rdfb5g6q0l8dz3sxadk5m3d2f69d4a6g4p4h7jj"; 20 - } 21 - else throw "cannot bootstrap GHC on this platform"; 21 + }; 22 + }.${stdenv.hostPlatform.system} 23 + or (throw "cannot bootstrap GHC on this platform")); 22 24 23 25 buildInputs = [perl]; 24 26 ··· 37 39 '' + 38 40 # On Linux, use patchelf to modify the executables so that they can 39 41 # find editline/gmp. 40 - (if stdenv.isLinux then '' 42 + stdenv.lib.optionalString stdenv.hostPlatform.isLinux '' 41 43 find . -type f -perm -0100 \ 42 44 -exec patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ 43 - --set-rpath "${lib.makeLibraryPath [ libedit ncurses5 gmp ]}" {} \; 45 + --set-rpath "${stdenv.lib.makeLibraryPath [ libedit ncurses5 gmp ]}" {} \; 44 46 for prog in ld ar gcc strip ranlib; do 45 47 find . -name "setup-config" -exec sed -i "s@/usr/bin/$prog@$(type -p $prog)@g" {} \; 46 48 done 47 - '' else ""); 49 + ''; 48 50 49 51 configurePhase = '' 50 - ./configure --prefix=$out --with-gmp-libraries=${lib.getLib gmp}/lib --with-gmp-includes=${lib.getDev gmp}/include 52 + ./configure --prefix=$out --with-gmp-libraries=${stdenv.lib.getLib gmp}/lib --with-gmp-includes=${stdenv.lib.getDev gmp}/include 51 53 ''; 52 54 53 55 # Stripping combined with patchelf breaks the executables (they die
+15 -15
pkgs/development/compilers/ghc/7.0.4-binary.nix
··· 1 - {stdenv, fetchurl, perl, ncurses5, gmp, libiconv}: 1 + { stdenv 2 + , fetchurl, perl 3 + , ncurses5, gmp, libiconv 4 + }: 2 5 3 6 stdenv.mkDerivation rec { 4 7 version = "7.0.4"; 5 8 6 9 name = "ghc-${version}-binary"; 7 10 8 - src = 9 - if stdenv.system == "i686-linux" then 10 - fetchurl { 11 + src = fetchurl ({ 12 + "i686-linux" = { 11 13 url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux.tar.bz2"; 12 14 sha256 = "0mfnihiyjl06f5w1yrjp36sw9g67g2ymg5sdl0g23h1pab99jx63"; 13 - } 14 - else if stdenv.system == "x86_64-linux" then 15 - fetchurl { 15 + }; 16 + "x86_64-linux" = { 16 17 url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2"; 17 18 sha256 = "0mc4rhqcxz427wq4zgffmnn0d2yjqvy6af4x9mha283p1gdj5q99"; 18 - } 19 - else if stdenv.system == "i686-darwin" then 20 - fetchurl { 19 + }; 20 + "i686-darwin" = { 21 21 url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-apple-darwin.tar.bz2"; 22 22 sha256 = "0qj45hslrrr8zfks8m1jcb3awwx9rh35ndnpfmb0gwb6j7azq5n3"; 23 - } 24 - else if stdenv.system == "x86_64-darwin" then 25 - fetchurl { 23 + }; 24 + "x86_64-darwin" = { 26 25 url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-apple-darwin.tar.bz2"; 27 26 sha256 = "1m2ml88p1swf4dnv2vq8hz4drcp46n3ahpfi05wh01ajkf8hnn3l"; 28 - } 29 - else throw "cannot bootstrap GHC on this platform"; 27 + }; 28 + }.${stdenv.hostPlatform.system} 29 + or (throw "cannot bootstrap GHC on this platform")); 30 30 31 31 buildInputs = [perl]; 32 32
+15 -15
pkgs/development/compilers/ghc/7.4.2-binary.nix
··· 1 - {stdenv, fetchurl, perl, ncurses5, gmp, libiconv, makeWrapper}: 1 + { stdenv 2 + , fetchurl, perl, makeWrapper 3 + , ncurses5, gmp, libiconv 4 + }: 2 5 3 6 stdenv.mkDerivation rec { 4 7 version = "7.4.2"; 5 8 6 9 name = "ghc-${version}-binary"; 7 10 8 - src = 9 - if stdenv.system == "i686-linux" then 10 - fetchurl { 11 + src = fetchurl ({ 12 + "i686-linux" = { 11 13 url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux.tar.bz2"; 12 14 sha256 = "0gny7knhss0w0d9r6jm1gghrcb8kqjvj94bb7hxf9syrk4fxlcxi"; 13 - } 14 - else if stdenv.system == "x86_64-linux" then 15 - fetchurl { 15 + }; 16 + "x86_64-linux" = { 16 17 url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2"; 17 18 sha256 = "043jabd0lh6n1zlqhysngbpvlsdznsa2mmsj08jyqgahw9sjb5ns"; 18 - } 19 - else if stdenv.system == "i686-darwin" then 20 - fetchurl { 19 + }; 20 + "i686-darwin" = { 21 21 url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-apple-darwin.tar.bz2"; 22 22 sha256 = "1vrbs3pzki37hzym1f1nh07lrqh066z3ypvm81fwlikfsvk4djc0"; 23 - } 24 - else if stdenv.system == "x86_64-darwin" then 25 - fetchurl { 23 + }; 24 + "x86_64-darwin" = { 26 25 url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-apple-darwin.tar.bz2"; 27 26 sha256 = "1imzqc0slpg0r6p40n5a9m18cbcm0m86z8dgyhfxcckksw54mzwf"; 28 - } 29 - else throw "cannot bootstrap GHC on this platform"; 27 + }; 28 + }.${stdenv.hostPlatform.system} 29 + or (throw "cannot bootstrap GHC on this platform")); 30 30 31 31 buildInputs = [perl]; 32 32