* make ghc use the nix-provided gmp

- this fixes ghc on x86_64 and hopefully doesn't break 32-bit
  - ghc-6.6.1 and -6.6 are tested on 64-bit, 6.4.2 might fail

svn path=/nixpkgs/trunk/; revision=9132
This commit is contained in:
Andres Löh 2007-08-15 11:25:20 +00:00
parent ec88afcae6
commit 920ce3551d
7 changed files with 30 additions and 11 deletions

View File

@ -11,11 +11,16 @@ postInstall()
} }
postInstall=postInstall postInstall=postInstall
configureFlags="--with-gmp-libraries=$gmp/lib --with-readline-libraries=\"$readline/lib\""
preConfigure() preConfigure()
{ {
chmod u+x rts/gmp/configure chmod u+x rts/gmp/configure
# still requires a hack for ncurses
sed -i "s|^\(library-dirs.*$\)|\1 \"$ncurses/lib\"|" libraries/readline/package.conf.in
} }
preConfigure=preConfigure preConfigure=preConfigure
# Standard configure/make/make install # Standard configure/make/make install
genericBuild genericBuild

View File

@ -1,4 +1,4 @@
{stdenv, fetchurl, readline, ghc, perl, m4}: {stdenv, fetchurl, readline, ghc, perl, m4, gmp, ncurses}:
stdenv.mkDerivation { stdenv.mkDerivation {
name = "ghc-6.6.1"; name = "ghc-6.6.1";
@ -21,4 +21,6 @@ stdenv.mkDerivation {
meta = { meta = {
description = "The Glasgow Haskell Compiler v6.6.1"; description = "The Glasgow Haskell Compiler v6.6.1";
}; };
inherit readline gmp ncurses;
} }

View File

@ -11,5 +11,16 @@ postInstall()
} }
postInstall=postInstall postInstall=postInstall
configureFlags="--with-readline-libraries=\"$readline/lib\""
preConfigure()
{
chmod u+x rts/gmp/configure
# add library paths for gmp, ncurses
sed -i "s|^\(library-dirs.*$\)|\1 \"$gmp/lib\"|" rts/package.conf.in
sed -i "s|^\(library-dirs.*$\)|\1 \"$ncurses/lib\"|" libraries/readline/package.conf.in
}
preConfigure=preConfigure
# Standard configure/make/make install # Standard configure/make/make install
genericBuild genericBuild

View File

@ -1,4 +1,4 @@
{stdenv, fetchurl, readline, ghc, perl, m4}: {stdenv, fetchurl, readline, ghc, perl, m4, gmp, ncurses}:
stdenv.mkDerivation { stdenv.mkDerivation {
name = "ghc-6.6"; name = "ghc-6.6";
@ -21,4 +21,6 @@ stdenv.mkDerivation {
meta = { meta = {
description = "The Glasgow Haskell Compiler v6.6"; description = "The Glasgow Haskell Compiler v6.6";
}; };
inherit readline gmp ncurses;
} }

View File

@ -1,4 +1,4 @@
{stdenv, fetchurl, perl, readline, ncurses, gmp ? null}: {stdenv, fetchurl, perl, readline, ncurses, gmp}:
assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux"; assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
@ -15,6 +15,6 @@ stdenv.mkDerivation {
md5 = "8f5fe48798f715cd05214a10987bf6d5"; md5 = "8f5fe48798f715cd05214a10987bf6d5";
}); });
buildInputs = [perl]; buildInputs = [perl];
propagatedBuildInputs = [readline ncurses (if stdenv.system == "x86_64-linux" then gmp else null)]; propagatedBuildInputs = [readline ncurses gmp];
inherit readline ncurses gmp; inherit readline ncurses gmp;
} }

View File

@ -1,4 +1,4 @@
{stdenv, gcc, fetchurl, perl, ghc, m4, readline, ncurses}: {stdenv, gcc, fetchurl, perl, ghc, m4, readline, ncurses, gmp}:
stdenv.mkDerivation { stdenv.mkDerivation {
name = "ghc-6.4.2"; name = "ghc-6.4.2";
@ -7,7 +7,7 @@ stdenv.mkDerivation {
md5 = "a394bf14e94c3bca5507d568fcc03375"; md5 = "a394bf14e94c3bca5507d568fcc03375";
}; };
buildInputs = [perl ghc m4]; buildInputs = [perl ghc m4];
propagatedBuildInputs = [readline ncurses]; propagatedBuildInputs = [readline ncurses gmp];
builder = ./builder.sh; builder = ./builder.sh;
inherit gcc; inherit gcc;

View File

@ -762,27 +762,26 @@ rec {
ghc = ghc661; ghc = ghc661;
ghc661 = import ../development/compilers/ghc-6.6.1 { ghc661 = import ../development/compilers/ghc-6.6.1 {
inherit fetchurl stdenv readline perl; inherit fetchurl stdenv readline perl gmp ncurses;
m4 = gnum4; m4 = gnum4;
ghc = ghcboot; ghc = ghcboot;
}; };
ghc66 = import ../development/compilers/ghc-6.6 { ghc66 = import ../development/compilers/ghc-6.6 {
inherit fetchurl stdenv readline perl; inherit fetchurl stdenv readline perl gmp ncurses;
m4 = gnum4; m4 = gnum4;
ghc = ghcboot; ghc = ghcboot;
}; };
ghc64 = import ../development/compilers/ghc { ghc64 = import ../development/compilers/ghc {
inherit fetchurl stdenv perl ncurses readline m4; inherit fetchurl stdenv perl ncurses readline m4 gmp;
gcc = stdenv.gcc; gcc = stdenv.gcc;
ghc = ghcboot; ghc = ghcboot;
}; };
ghcboot = lowPrio (appendToName "boot" (import ../development/compilers/ghc/boot.nix { ghcboot = lowPrio (appendToName "boot" (import ../development/compilers/ghc/boot.nix {
inherit fetchurl stdenv perl ncurses; inherit fetchurl stdenv perl ncurses gmp;
readline = if stdenv.system == "i686-linux" then readline4 else readline; readline = if stdenv.system == "i686-linux" then readline4 else readline;
gmp = if stdenv.system == "x86_64-linux" then gmp else null;
})); }));
/* /*