update ghc proposal (still not working)

svn path=/nixpkgs/trunk/; revision=10388
This commit is contained in:
Marc Weber 2008-01-29 13:26:18 +00:00
parent 3066e0e8e2
commit 3f013f7bee
2 changed files with 18 additions and 22 deletions

View file

@ -1026,8 +1026,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
@ -1052,20 +1050,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) ]);
# the wrappers basically does one thing: It defines GHC_PACKAGE_PATH before calling ghc{i,-pkg}
# So you can have different wrappers with different library combinations
@ -1091,8 +1089,6 @@ rec {
inherit ghc;
};
*/
# ghc66boot = import ../development/compilers/ghc-6.6-boot {
# inherit fetchurl stdenv perl readline;
# m4 = gnum4;

View file

@ -199,6 +199,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"];
@ -283,7 +284,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;
@ -355,7 +356,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
@ -370,8 +371,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
@ -380,6 +380,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