* Started cleaning up the GHC support.

svn path=/nixpkgs/trunk/; revision=15091
This commit is contained in:
Eelco Dolstra 2009-04-16 18:08:09 +00:00
parent fb6ccb6355
commit 49e5575268
5 changed files with 1 additions and 163 deletions

View file

@ -1,26 +0,0 @@
source $stdenv/setup
# Setup isolated package management
postInstall()
{
ensureDir "$out/nix-support"
echo "# Path to the GHC compiler directory in the store" > $out/nix-support/setup-hook
echo "ghc=$out" >> $out/nix-support/setup-hook
echo "" >> $out/nix-support/setup-hook
cat $setupHook >> $out/nix-support/setup-hook
}
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
genericBuild

View file

@ -1,26 +0,0 @@
{stdenv, fetchurl, readline, ghc, perl, m4, gmp, ncurses}:
stdenv.mkDerivation {
name = "ghc-6.6";
src = map fetchurl [
{ url = http://www.haskell.org/ghc/dist/6.6/ghc-6.6-src.tar.bz2;
md5 = "2427a8d7d14f86e0878df6b54938acf7";
}
{ url = http://www.haskell.org/ghc/dist/6.6/ghc-6.6-src-extralibs.tar.bz2;
md5 = "14b22fce36caffa509046361724bc119";
}
];
builder = ./builder.sh;
buildInputs = [ghc readline perl m4];
setupHook = ./setup-hook.sh;
meta = {
description = "The Glasgow Haskell Compiler v6.6";
};
inherit readline gmp ncurses;
}

View file

@ -1,41 +0,0 @@
# Support dir for isolating GHC
ghc_support=$TMPDIR/ghc-6.6-nix-support
mkdir -p $ghc_support
# Create isolated package config
packages_db=$ghc_support/package.conf
cp $ghc/lib/ghc-*/package.conf $packages_db
chmod +w $packages_db
# Generate wrappers for GHC that use the isolated package config
makeWrapper() {
wrapperName="$1"
wrapper="$ghc_support/$wrapperName"
shift #the other arguments are passed to the source app
echo '#!'"$SHELL" > "$wrapper"
echo "exec \"$ghc/bin/$wrapperName\" $@" '"$@"' >> "$wrapper"
chmod +x "$wrapper"
}
makeWrapper "ghc" "-no-user-package-conf -package-conf $packages_db"
makeWrapper "ghci" "-no-user-package-conf -package-conf $packages_db"
makeWrapper "runghc" "-no-user-package-conf -package-conf $packages_db"
makeWrapper "runhaskell" "-no-user-package-conf -package-conf $packages_db"
makeWrapper "ghc-pkg" "--global-conf $packages_db"
# Add wrappers to search path
export _PATH=$ghc_support:$_PATH
# Env hook to add packages to the package config
addLibToPackageConf ()
{
local regscript=$1/nix-support/register-ghclib.sh
if test -f $regscript; then
local oldpath=$PATH
export PATH=$ghc_support:$PATH
sh $regscript $package_db
export PATH=$oldpath
fi
}
envHooks=(${envHooks[@]} addLibToPackageConf)

View file

@ -1,47 +0,0 @@
{stdenv, fetchurl, readline, ghc, happy, alex, perl, m4, gmp, ncurses, haskellEditline}:
stdenv.mkDerivation (rec {
name = "ghc-6.9.20080719";
homepage = "http://www.haskell.org/ghc";
src = map fetchurl [
{ url = "${homepage}/dist/current/dist/${name}-src.tar.bz2";
sha256 = "ed2371c3632962fccab6ec60c04e9fc6a38f3ade3a30a464cea5d53784bc3a34";
}
{ url = "${homepage}/dist/current/dist/${name}-src-extralibs.tar.bz2";
sha256 = "d3c7aa7d53befe268f92148cc8f3b0861dfdc84e9b21b039af0f5b230bfbf72b";
}
];
buildInputs = [ghc readline perl m4 gmp happy alex haskellEditline];
# The setup hook is executed by other packages building with ghc.
# It then looks for package configurations that are available and
# build a package database on the fly.
setupHook = ./setup-hook.sh;
meta = {
description = "The Glasgow Haskell Compiler";
};
configureFlags=[
"--with-gmp-libraries=${gmp}/lib"
"--with-gmp-includes=${gmp}/include"
"--with-readline-libraries=${readline}/lib"
"--with-gcc=${gcc}/bin/gcc"
];
preConfigure = ''
# should not be present in a clean distribution
rm utils/pwd/pwd
# fix bug in makefile
sed -i -e 's/:\\"//' -e 's/\\"//' mk/config.mk.in
'';
postInstall = ''
ln -s $out/lib/${name}/ghc $out/lib/${name}/${name}
'';
inherit (stdenv) gcc;
inherit readline gmp ncurses;
})

View file

@ -1831,11 +1831,6 @@ let
inherit ghc;
};
# ghc66boot = import ../development/compilers/ghc-6.6-boot {
# inherit fetchurl stdenv perl readline;
# m4 = gnum4;
#};
ghc = ghc683;
ghc682 = import ../development/compilers/ghc-6.8/ghc-6.8.2.nix {
@ -1849,21 +1844,11 @@ let
haddock = haddockboot;
};
ghc69snapshot = lowPrio (import ../development/compilers/ghc-6.8/head.nix {
inherit fetchurl stdenv readline perl gmp ncurses m4 happy alex haskellEditline;
ghc = ghc683;
});
ghc661 = import ../development/compilers/ghc-6.6.1 {
inherit fetchurl stdenv readline perl58 gmp ncurses m4;
ghc = ghcboot;
};
ghc66 = import ../development/compilers/ghc-6.6 {
inherit fetchurl stdenv readline perl gmp ncurses m4;
ghc = ghcboot;
};
ghc64 = import ../development/compilers/ghc {
inherit fetchurl stdenv perl ncurses readline m4 gmp;
gcc = stdenv.gcc;
@ -1881,13 +1866,6 @@ let
# readline = if stdenv.system == "i686-linux" then readline4 else readline;
perl = perl58;
}));
/*
ghcWrapper = assert uulib.ghc == ghc;
import ../development/compilers/ghc-wrapper {
inherit stdenv ghc;
libraries = [];
};
*/
gprolog = import ../development/compilers/gprolog {
inherit fetchurl stdenv;
@ -4212,7 +4190,7 @@ let
inherit stdenv fetchurl;
ghc = ghc682;
};
cabal683 = import ../development/libraries/haskell/cabal/cabal.nix {
inherit stdenv fetchurl;
ghc = ghc683;