diff --git a/pkgs/development/compilers/ghc/boot.nix b/pkgs/development/compilers/ghc/boot.nix index c1297ca814f..52c8374f4ac 100644 --- a/pkgs/development/compilers/ghc/boot.nix +++ b/pkgs/development/compilers/ghc/boot.nix @@ -1,15 +1,20 @@ -{stdenv, fetchurl, perl, readline, ncurses}: +{stdenv, fetchurl, perl, readline, ncurses, gmp ? null}: -assert stdenv.system == "i686-linux"; +assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux"; stdenv.mkDerivation { name = "ghc-6.4.2"; builder = ./boot.sh; - src = fetchurl { - url = http://nix.cs.uu.nl/dist/tarballs/ghc-6.4.2-i386-unknown-linux.tar.bz2; - md5 = "092fe2e25dab22b926babe97cc77db1f"; - }; + src = if stdenv.system == "i686-linux" then + (fetchurl { + url = http://nix.cs.uu.nl/dist/tarballs/ghc-6.4.2-i386-unknown-linux.tar.bz2; + md5 = "092fe2e25dab22b926babe97cc77db1f"; + }) else + (fetchurl { + url = http://haskell.org/ghc/dist/6.4.2/ghc-6.4.2-x86_64-unknown-linux.tar.bz2; + md5 = "8f5fe48798f715cd05214a10987bf6d5"; + }); buildInputs = [perl]; - propagatedBuildInputs = [readline ncurses]; - inherit readline ncurses; + propagatedBuildInputs = [readline ncurses (if stdenv.system == "x86_64-linux" then gmp else null)]; + inherit readline ncurses gmp; } diff --git a/pkgs/development/compilers/ghc/boot.sh b/pkgs/development/compilers/ghc/boot.sh index e952f5d17ab..4b88b6bdba3 100644 --- a/pkgs/development/compilers/ghc/boot.sh +++ b/pkgs/development/compilers/ghc/boot.sh @@ -4,7 +4,7 @@ postBuild=postBuild postBuild () { find . -type f -perm +100 \ -exec patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \ - --set-rpath "$readline/lib:$ncurses/lib" {} \; + --set-rpath "$readline/lib:$ncurses/lib:$gmp/lib" {} \; } genericBuild diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 832f7d39902..24f1135b167 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -770,7 +770,8 @@ rec { ghcboot = lowPrio (appendToName "boot" (import ../development/compilers/ghc/boot.nix { inherit fetchurl stdenv perl ncurses; - readline = readline4; + readline = if stdenv.system == "i686-linux" then readline4 else readline; + gmp = if stdenv.system == "x86_64-linux" then gmp else null; })); /*