update ghc proposal (still not working)

svn path=/nixpkgs/branches/stdenv-updates/; revision=10421
This commit is contained in:
Yury G. Kudryashov 2008-01-31 10:38:45 +00:00
parent 54303ac99c
commit 864a711d1b
2 changed files with 18 additions and 22 deletions

View File

@ -1020,8 +1020,6 @@ rec {
profiledCompiler = true;
});
/* doesn't work yet
# This new ghc stuff is under heavy development and might change !
# usage: see ghcPkgUtil.sh - use setup-new2 because of PATH_DELIMITER
@ -1044,20 +1042,20 @@ rec {
};
# this will change in the future
ghc68_extra_libs =
ghc : let
deriv = name : goSrcDir : deps :
let bd = builderDefs {
goSrcDir = "ghc-* /libraries";
src = ghc.extra_src;
} null; in
stdenv.mkDerivation rec {
inherit name;
builder = bd.writeScript (name + "-builder")
(bd.textClosure [builderDefs.haskellBuilderDefs]);
};
ghc68_extra_libs = ghc:
let deriv = name : goSrcDir : deps :
let localDefs = builderDefs {
inherit goSrcDir;
src = ghc.extra_src;
} null;
in with localDefs;
stdenv.mkDerivation rec {
inherit name;
builder = writeScript (name + "-builder")
(textClosure localDefs [ cabalBuild ]);
};
# using nvs to be able to use mtl-1.1.0.0 as name
in lib.nvs "mtl-1.1.0.0" (deriv "mtl-1.1.0.0" "libraries/mtl" [ (__getAttr "base-3.0.1.0" ghc.core_libs) ]);
in lib.nvs "mtl-1.1.0.0" (deriv "mtl-1.1.0.0" "cd libraries/mtl" [ (__getAttr "base-3.0.1.0" ghc.core_libs) ]);
# this will change in the future
ghc68_extra_libs =
@ -1099,8 +1097,6 @@ rec {
inherit ghc;
};
*/
# ghc66boot = import ../development/compilers/ghc-6.6-boot {
# inherit fetchurl stdenv perl readline;
# m4 = gnum4;

View File

@ -204,6 +204,7 @@ args: with args; with stringsWithDeps; with lib;
bzip2 -d <${s} > \$PWD/\$(basename ${s} .bz2)/\${NAME#*-}
cd \$(basename ${s} .bz2)
" else (abort "unknown archive type : ${s}"))+
# goSrcDir is typically something like "cd mysubdir" .. but can be anything else
(if args ? goSrcDir then args.goSrcDir else "")
) ["minInit"];
@ -288,7 +289,7 @@ args: with args; with stringsWithDeps; with lib;
replaceScripts = l:(concatStringsSep "\n" (pairMap replaceInScript l));
doReplaceScripts = FullDepEntry (replaceScripts (getAttr ["shellReplacements"] [] args)) [minInit];
makeNest = x:(if x==defNest.text then x else "startNest\n" + x + "\nstopNest\n");
textClosure = textClosureMapOveridable makeNest;
textClosure = a : steps : textClosureMapOveridable makeNest a (["defNest"] ++ steps);
inherit noDepEntry FullDepEntry PackEntry;
@ -360,7 +361,7 @@ args: with args; with stringsWithDeps; with lib;
PACKAGE_DB=$out/nix-support/package.conf;
echo '[]' > \"$PACKAGE_DB\";
setupHookRegisteringPackageDatabase
}" [defSetupHookRegisteringPackageDatabase];
}" ["defSetupHookRegisteringPackageDatabase" "defEnsureDir"];
# Cabal does only support --user ($HOME/.ghc/** ) and --global (/nix/store/*-ghc/lib/...)
# But we need kind of --custom=my-package-db
@ -375,8 +376,7 @@ args: with args; with stringsWithDeps; with lib;
# and ./setup register --gen-script to install to our local database
# after replacing /usr/lib etc with our pure $out path
cabalBuild = FullDepEntry
(if (args ? subdir) then "cd ${args.subdir}" else "")+ "
createEmptyPackageDatabaseAndSetupHook
" createEmptyPackageDatabaseAndSetupHook
ghc --make setup.hs -o setup
\$CABAL_SETUP configure
\$CABAL_SETUP build
@ -385,6 +385,6 @@ args: with args; with stringsWithDeps; with lib;
sed -e 's=/usr/local/lib=\$out=g' \\
-i register.sh
GHC_PACKAGE_PATH=\$PACKAGE_DB ./register.sh
" [defCreateEmptyPackageDatabaseAndSetupHook defCabalSetupCmd];
" ["defCreateEmptyPackageDatabaseAndSetupHook" "defCabalSetupCmd"];
}) // args