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