* adding ghc-6.8 even though it still segfaults on my machine
(it's marked lowPrio for now, so it shouldn't break anything) svn path=/nixpkgs/trunk/; revision=9482
This commit is contained in:
parent
dc49f13eef
commit
23d6fce80d
26
pkgs/development/compilers/ghc-6.8/builder.sh
Normal file
26
pkgs/development/compilers/ghc-6.8/builder.sh
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
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-gmp-libraries=$gmp/lib --with-readline-libraries=\"$readline/lib\""
|
||||||
|
|
||||||
|
preConfigure()
|
||||||
|
{
|
||||||
|
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
|
||||||
|
|
||||||
|
|
||||||
|
# Standard configure/make/make install
|
||||||
|
genericBuild
|
41
pkgs/development/compilers/ghc-6.8/default.nix
Normal file
41
pkgs/development/compilers/ghc-6.8/default.nix
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
{stdenv, fetchurl, readline, ghc, perl, m4, gmp, ncurses}:
|
||||||
|
|
||||||
|
stdenv.mkDerivation (rec {
|
||||||
|
name = "ghc-6.8.0.20071018";
|
||||||
|
homepage = "http://www.haskell.org/ghc";
|
||||||
|
|
||||||
|
src = map fetchurl [
|
||||||
|
{ url = "${homepage}/dist/stable/dist/${name}-src.tar.bz2";
|
||||||
|
md5 = "7e61bd2a55c2d6ed5a6d996d19d3f6bf";
|
||||||
|
}
|
||||||
|
{ url = "${homepage}/dist/stable/dist/${name}-src-extralibs.tar.bz2";
|
||||||
|
md5 = "7b155c1d1e7daa492cc2161b3828a377";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
buildInputs = [ghc readline perl m4];
|
||||||
|
|
||||||
|
setupHook = ./setup-hook.sh;
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "The Glasgow Haskell Compiler v6.8 (snapshot)";
|
||||||
|
};
|
||||||
|
|
||||||
|
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
|
||||||
|
";
|
||||||
|
|
||||||
|
configureFlags="--with-gmp-libraries=$gmp/lib --with-readline-libraries=\"$readline/lib\"";
|
||||||
|
|
||||||
|
# the presence of this file makes Cabal cry for happy while generating makefiles ...
|
||||||
|
preConfigure = "
|
||||||
|
echo 'GhcThreaded=NO' > mk/build.mk
|
||||||
|
rm libraries/haskell-src/Language/Haskell/Parser.ly
|
||||||
|
";
|
||||||
|
|
||||||
|
inherit readline gmp ncurses;
|
||||||
|
})
|
41
pkgs/development/compilers/ghc-6.8/setup-hook.sh
Normal file
41
pkgs/development/compilers/ghc-6.8/setup-hook.sh
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
# 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)
|
@ -890,6 +890,12 @@ rec {
|
|||||||
|
|
||||||
ghc = ghc661;
|
ghc = ghc661;
|
||||||
|
|
||||||
|
ghc68 = lowPrio (appendToName "snapshot" (import ../development/compilers/ghc-6.8 {
|
||||||
|
inherit fetchurl stdenv readline perl gmp ncurses;
|
||||||
|
m4 = gnum4;
|
||||||
|
ghc = ghcboot;
|
||||||
|
}));
|
||||||
|
|
||||||
ghc661 = import ../development/compilers/ghc-6.6.1 {
|
ghc661 = import ../development/compilers/ghc-6.6.1 {
|
||||||
inherit fetchurl stdenv readline perl gmp ncurses;
|
inherit fetchurl stdenv readline perl gmp ncurses;
|
||||||
m4 = gnum4;
|
m4 = gnum4;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user