forked from mirrors/nixpkgs
* ghc version 6.6.1
svn path=/nixpkgs/trunk/; revision=8654
This commit is contained in:
parent
f2da0ba2c4
commit
e3f701c311
21
pkgs/development/compilers/ghc-6.6.1/builder.sh
Normal file
21
pkgs/development/compilers/ghc-6.6.1/builder.sh
Normal file
|
@ -0,0 +1,21 @@
|
|||
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
|
||||
|
||||
preConfigure()
|
||||
{
|
||||
chmod u+x rts/gmp/configure
|
||||
}
|
||||
preConfigure=preConfigure
|
||||
|
||||
# Standard configure/make/make install
|
||||
genericBuild
|
24
pkgs/development/compilers/ghc-6.6.1/default.nix
Normal file
24
pkgs/development/compilers/ghc-6.6.1/default.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{stdenv, fetchurl, readline, ghc, perl, m4}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "ghc-6.6.1";
|
||||
|
||||
src = map fetchurl [
|
||||
{ url = http://www.haskell.org/ghc/dist/6.6.1/ghc-6.6.1-src.tar.bz2;
|
||||
md5 = "dea271503463bd28c27f25ab90998633";
|
||||
}
|
||||
{ url = http://www.haskell.org/ghc/dist/6.6.1/ghc-6.6.1-src-extralibs.tar.bz2;
|
||||
md5 = "43a26b81608b206c056adc3032f7da2a";
|
||||
}
|
||||
];
|
||||
|
||||
builder = ./builder.sh;
|
||||
|
||||
buildInputs = [ghc readline perl m4];
|
||||
|
||||
setupHook = ./setup-hook.sh;
|
||||
|
||||
meta = {
|
||||
description = "The Glasgow Haskell Compiler v6.6.1";
|
||||
};
|
||||
}
|
41
pkgs/development/compilers/ghc-6.6.1/setup-hook.sh
Normal file
41
pkgs/development/compilers/ghc-6.6.1/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)
|
|
@ -690,6 +690,12 @@ rec {
|
|||
|
||||
ghc = ghc66;
|
||||
|
||||
ghc661 = import ../development/compilers/ghc-6.6.1 {
|
||||
inherit fetchurl stdenv readline perl;
|
||||
m4 = gnum4;
|
||||
ghc = ghcboot;
|
||||
};
|
||||
|
||||
ghc66 = import ../development/compilers/ghc-6.6 {
|
||||
inherit fetchurl stdenv readline perl;
|
||||
m4 = gnum4;
|
||||
|
|
Loading…
Reference in a new issue