updated version of my ghc and packages proposal. Now compiles HAppS.
Examples on how to add ghc extra_libs, libraries from hackage are included svn path=/nixpkgs/trunk/; revision=10565
This commit is contained in:
parent
cb418b6e34
commit
0efd4183e1
@ -5,7 +5,7 @@
|
||||
and add all together using GHC_PACKAGE_PATH
|
||||
|
||||
First I've tried separating the build of ghc from it's lib. It hase been to painful. I've failed.
|
||||
Now there is splitpackagedb.hs which just takes the installed package.conf
|
||||
Now there is nix_ghc_pkg_tool.hs which just takes the installed package.conf
|
||||
and creates a new package db file for each contained package.
|
||||
|
||||
The final attribute set looks similar to this:
|
||||
@ -31,13 +31,17 @@
|
||||
|
||||
*/
|
||||
|
||||
# creates a nix package out of the single package.conf files created when after installing ghc (see splitpackagedb.hs)
|
||||
packageByPackageDB = otherPkg : name : packageconfpath : propagatedBuildInputs : stdenv.mkDerivation {
|
||||
inherit name otherPkg propagatedBuildInputs;
|
||||
# creates a nix package out of the single package.conf files created when after installing ghc (see nix_ghc_pkg_tool.hs)
|
||||
packageByPackageDB = ghc : # ghc
|
||||
name :
|
||||
packageconfpath :
|
||||
propagatedBuildInputs :
|
||||
stdenv.mkDerivation {
|
||||
inherit name;
|
||||
phases = "buildPhase fixupPhase";
|
||||
buildInputs = [ghcPkgUtil];
|
||||
buildPhase = "setupHookRegisteringPackageDatabase \"$otherPkg/${packageconfpath}\"
|
||||
";
|
||||
buildInputs = [ ghcPkgUtil ];
|
||||
propagatedBuildInputs = [ ghc ] ++ propagatedBuildInputs;
|
||||
buildPhase = "setupHookRegisteringPackageDatabase \"${ghc}/${packageconfpath}\"";
|
||||
};
|
||||
|
||||
# used to automatically get dependencies ( used for core_libs )
|
||||
@ -58,7 +62,8 @@
|
||||
|
||||
#this only works for ghc-6.8 right now
|
||||
ghcAndLibraries = { version, src /* , core_libraries, extra_libraries */
|
||||
, extra_src }:
|
||||
, extra_src
|
||||
, alias_names }:
|
||||
recurseIntoAttrs ( rec {
|
||||
inherit src extra_src version;
|
||||
|
||||
@ -74,7 +79,8 @@
|
||||
sed -i \"s|^\(library-dirs.*$\)|\1 \\\"$ncurses/lib\\\"|\" libraries/readline/package.conf.in
|
||||
";
|
||||
|
||||
splitpackagedb = ./splitpackagedb.hs;
|
||||
# TODO add unique (filter duplicates?) shouldn't be there?
|
||||
nix_ghc_pkg_tool = ./nix_ghc_pkg_tool.hs;
|
||||
|
||||
configurePhase = "./configure"
|
||||
+" --prefix=\$out "
|
||||
@ -89,9 +95,10 @@
|
||||
# note : I don't know yet wether it's a good idea to have RUNGHC.. It's faster
|
||||
# but you can't pass packages, can you?
|
||||
postInstall = "
|
||||
cp \$splitpackagedb splitpackagedb.hs
|
||||
\$out/bin/ghc-\$version --make -o splitpackagedb splitpackagedb.hs;
|
||||
./splitpackagedb \$out/lib/ghc-\$version/package.conf \$out/lib/ghc-\$version
|
||||
cp \$nix_ghc_pkg_tool nix_ghc_pkg_tool.hs
|
||||
\$out/bin/ghc-\$version --make -o nix_ghc_pkg_tool nix_ghc_pkg_tool.hs;
|
||||
./nix_ghc_pkg_tool split \$out/lib/ghc-\$version/package.conf \$out/lib/ghc-\$version
|
||||
cp nix_ghc_pkg_tool \$out/bin
|
||||
|
||||
if test -x \$out/bin/runghc; then
|
||||
RUNHGHC=\$out/bin/runghc # > ghc-6.7/8 ?
|
||||
@ -110,7 +117,7 @@
|
||||
core_libs = resolveDeps ghc
|
||||
[ { name = "Cabal-1.2.3.0"; deps = ["base-3.0.1.0" "pretty-1.0.0.0" "old-locale-1.0.0.0" "old-time-1.0.0.0" "directory-1.0.0.0" "unix-2.3.0.0" "process-1.0.0.0" "array-0.1.0.0" "containers-0.1.0.1" "rts-1.0" "filepath-1.1.0.0"];} #
|
||||
{ name = "array-0.1.0.0"; deps = ["base-3.0.1.0"];}
|
||||
{ name = "base-3.0.1.0"; deps = [];} #
|
||||
{ name = "base-3.0.1.0"; deps = ["rts-1.0"];} #
|
||||
{ name = "bytestring-0.9.0.1"; deps = [ "base-3.0.1.0" "array-0.1.0.0" ];}
|
||||
{ name = "containers-0.1.0.1"; deps = [ "base-3.0.1.0" "array-0.1.0.0" ];}
|
||||
{ name = "directory-1.0.0.0"; deps = [ "base-3.0.1.0" "old-locale-1.0.0.0" "old-time-1.0.0.0" "filepath-1.1.0.0"];}
|
||||
@ -125,17 +132,21 @@
|
||||
{ name = "process-1.0.0.0"; deps = [ "base-3.0.1.0" "old-locale-1.0.0.0" "old-time-1.0.0.0" "filepath-1.1.0.0" "directory-1.0.0.0" "unix-2.3.0.0"];}
|
||||
{ name = "random-1.0.0.0"; deps = [ "base-3.0.1.0" "old-locale-1.0.0.0" "old-time-1.0.0.0"];}
|
||||
{ name = "readline-1.0.1.0"; deps = [ "base-3.0.1.0" "old-locale-1.0.0.0" "old-time-1.0.0.0" "filepath-1.1.0.0" "directory-1.0.0.0" "unix-2.3.0.0" "process-1.0.0.0" ];}
|
||||
{ name = "rts-1.0"; deps = [ "base-3.0.1.0" ];} #
|
||||
{ name = "rts-1.0"; deps = [];} #
|
||||
{ name = "template-haskell-2.2.0.0"; deps = [ "base-3.0.1.0" "pretty-1.0.0.0" "array-0.1.0.0" "packedstring-0.1.0.0" "containers-0.1.0.1" ];}
|
||||
|
||||
{ name = "unix-2.3.0.0"; deps = [ "base-3.0.1.0" "old-locale-1.0.0.0" "old-time-1.0.0.0" "filepath-1.1.0.0" "directory-1.0.0.0" ];}
|
||||
];
|
||||
|
||||
|
||||
|
||||
extra_libs = [];
|
||||
|
||||
#all_libs = core_libs ++ extra_libs;
|
||||
extra_libs = {}; # TODO ? at the moment outside of this package
|
||||
|
||||
# contains core_libs { "base-3.0.1.0" = <derivation> ...
|
||||
# and alias names base = base-3.0.1.0
|
||||
# (without version) }
|
||||
# to get a specific version don't use set.xy-7 but (__getAttr "xy-7" set)
|
||||
all_libs = let all = core_libs // extra_libs;
|
||||
in all // ( builtins.listToAttrs ( lib.mapRecordFlatten (attr : v : lib.nv attr (__getAttr v all ) ) alias_names ) );
|
||||
} );
|
||||
|
||||
ghc68 = ghcAndLibraries rec {
|
||||
@ -156,6 +167,30 @@
|
||||
#sha256 = "0py7d9nh3lkhjxr3yb3n9345d0hmzq79bi40al5rcr3sb84rnp9r";
|
||||
};
|
||||
|
||||
# to be able to use just array instead of array-0.1.0.0 (versions are likely to change, dependencies not that often)
|
||||
alias_names = {
|
||||
cabal = "Cabal-1.2.3.0";
|
||||
array = "array-0.1.0.0";
|
||||
base = "base-3.0.1.0";
|
||||
bytestring = "bytestring-0.9.0.1";
|
||||
containers = "containers-0.1.0.1";
|
||||
directory = "directory-1.0.0.0";
|
||||
filepath = "filepath-1.1.0.0";
|
||||
haskell98 = "haskell98-1.0.1.0";
|
||||
hpc = "hpc-0.5.0.0";
|
||||
packedstring = "packedstring-0.1.0.0";
|
||||
pretty = "pretty-1.0.0.0";
|
||||
process = "process-1.0.0.0";
|
||||
random = "random-1.0.0.0";
|
||||
readline = "readline-1.0.1.0";
|
||||
rts = "rts-1.0";
|
||||
template = "template-haskell-2.2.0.0";
|
||||
unix = "unix-2.3.0.0";
|
||||
template_haskell = "template-haskell-2.2.0.0";
|
||||
old_time = "old-time-1.0.0.0";
|
||||
old_locale = "old-locale-1.0.0.0";
|
||||
};
|
||||
|
||||
# this will change because of dependency hell :)
|
||||
#core_libraries = [ "Cabal" /* "Win32" */ "array" "base" "bytestring" "containers"
|
||||
#"directory" "doc" "filepath" "haskell98" "hpc" "old-locale" "old-time"
|
||||
|
48
pkgs/development/compilers/ghcs/nix_ghc_pkg_tool.hs
Normal file
48
pkgs/development/compilers/ghcs/nix_ghc_pkg_tool.hs
Normal file
@ -0,0 +1,48 @@
|
||||
-- packages: filepath,Cabal,directory
|
||||
{-# OPTIONS_GHC -fglasgow-exts #-}
|
||||
module Main where
|
||||
import Distribution.InstalledPackageInfo (InstalledPackageInfo (..))
|
||||
import Distribution.Package (showPackageId)
|
||||
import System.FilePath
|
||||
import System.Environment
|
||||
import System.Directory
|
||||
import System.IO
|
||||
import System.Exit
|
||||
import Data.List
|
||||
|
||||
usage = unlines [
|
||||
" usage a) <app-name> split in_path out_path"
|
||||
, " b) <app-anme> join out_path"
|
||||
, "This small helper executable servers two purposes:"
|
||||
, "a) split the main package db created by ghc installation into single libs"
|
||||
, " so that nix can add them piecwise as needed to buildInputs"
|
||||
, "b) merge databases into one single file, so when building a library"
|
||||
, " we can create one db containing all dependencies passed by GHC_PACKAGE_PATH"
|
||||
, " I think this is a better solution than patching and mantaining cabal so"
|
||||
, " that it support GHC_PACKAGE_PATH (not only by accident) ?"
|
||||
]
|
||||
|
||||
mySplit :: (Eq Char) => [Char] ->[[ Char ]]
|
||||
mySplit [] = []
|
||||
mySplit list = let (l, l') = span (not . (`elem` ":;")) list
|
||||
in l: mySplit (drop 1 l')
|
||||
|
||||
myReadFile f = doesFileExist f >>= \fe ->
|
||||
if fe then readFile f
|
||||
else do hPutStrLn stderr $ "unable to read file " ++ f
|
||||
exitWith (ExitFailure 1)
|
||||
|
||||
main = do
|
||||
args <- getArgs
|
||||
case args of
|
||||
["split", inFile, outDir] -> do
|
||||
-- prior to 6.9.x (when exactly) this must be InstalledPackageInfo only (not InstalledPackageInfo_ String)
|
||||
-- (packagedb :: [InstalledPackageInfo_ String] ) <- fmap read $ myReadFile inFile
|
||||
(packagedb :: [InstalledPackageInfo] ) <- fmap read $ myReadFile inFile
|
||||
mapM_ (\pi -> let fn = outDir </> (showPackageId $ package pi) ++ ".conf"
|
||||
in writeFile fn (show [pi])
|
||||
) packagedb
|
||||
["join", outpath] -> do
|
||||
getEnv "GHC_PACKAGE_PATH" >>= mapM myReadFile . nub . mySplit
|
||||
>>= writeFile outpath . show . concat . map (read :: String -> [InstalledPackageInfo])
|
||||
_ -> putStrLn usage
|
@ -18,6 +18,8 @@ main = do
|
||||
args <- getArgs
|
||||
case args of
|
||||
[inFile, outDir] -> do
|
||||
-- prior to 6.9.x (when exactly) this must be InstalledPackageInfo only (not InstalledPackageInfo_ String)
|
||||
-- (packagedb :: [InstalledPackageInfo_ String] ) <- fmap read $ readFile inFile
|
||||
(packagedb :: [InstalledPackageInfo] ) <- fmap read $ readFile inFile
|
||||
mapM_ (\pi -> let fn = outDir </> (showPackageId $ package pi) ++ ".conf"
|
||||
in writeFile fn (show [pi])
|
||||
|
@ -1072,7 +1072,8 @@ rec {
|
||||
profiledCompiler = true;
|
||||
});
|
||||
|
||||
# This new ghc stuff is under heavy development and might change !
|
||||
# This new ghc stuff is under heavy development and will change !
|
||||
# ========= =======================================================
|
||||
|
||||
# usage: see ghcPkgUtil.sh - use setup-new2 because of PATH_DELIMITER
|
||||
# depreceated -> use functions defined in builderDefs
|
||||
@ -1095,43 +1096,206 @@ rec {
|
||||
stdenv = stdenvUsingSetupNew2;
|
||||
};
|
||||
|
||||
# args must contain src name buildInputs
|
||||
# using this derivation .. my system is dying (> 2.5 g memory usage -> segfault ?)
|
||||
# experimental !
|
||||
ghc_cabal_derivation_X =
|
||||
lib.sumArgs (
|
||||
x : ( let localDefs = (((builderDefs x)
|
||||
{ debug = true; }) null # end sumArgs
|
||||
); in with localDefs;
|
||||
stdenv.mkDerivation rec {
|
||||
inherit name propagatedBuildInputs;
|
||||
builder = writeScript (name + "-builder")
|
||||
(textClosure localDefs [ cabalBuild ]);
|
||||
}));
|
||||
|
||||
# args must contain src name buildInputs
|
||||
# classic expression style.. seems to work fine
|
||||
# used now
|
||||
ghc_cabal_derivation = args : null_ : with lib; with args;
|
||||
stdenvUsingSetupNew2.mkDerivation {
|
||||
inherit name propagatedBuildInputs src goSrcDir;
|
||||
phases = "unpackPhase buildPhase";
|
||||
buildInputs = (if (args ? buildInputs) then args.buildInputs else [])
|
||||
++ [ ghcPkgUtil ];
|
||||
buildPhase ="
|
||||
echo buildPhase is
|
||||
createEmptyPackageDatabaseAndSetupHook
|
||||
export GHC_PACKAGE_PATH
|
||||
|
||||
\$goSrcDir
|
||||
ghc --make Setup.*hs -o setup
|
||||
CABAL_SETUP=./setup
|
||||
|
||||
nix_ghc_pkg_tool join local-pkg-db
|
||||
|
||||
\$CABAL_SETUP configure --package-db=local-pkg-db
|
||||
\$CABAL_SETUP build
|
||||
\$CABAL_SETUP copy --destdir=\$out
|
||||
\$CABAL_SETUP register --gen-script
|
||||
sed -e \"s=/usr/local/lib=\$out/usr/local/lib=g\" \\
|
||||
-e \"s#bin/ghc-pkg --package-conf.*#bin/ghc-pkg --package-conf=\$PACKAGE_DB register -#\" \\
|
||||
-i register.sh
|
||||
./register.sh
|
||||
rm \${PACKAGE_DB}.old
|
||||
|
||||
ensureDir \"\$out/nix-support\"
|
||||
echo \"\$propagatedBuildInputs\" > \"\$out/nix-support/propagated-build-inputs\"
|
||||
";
|
||||
};
|
||||
|
||||
# this will change in the future
|
||||
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" "cd libraries/mtl" [ (__getAttr "base-3.0.1.0" ghc.core_libs) ]);
|
||||
# TODO enhance speed ! ?
|
||||
ghc68_extra_libs = ghc: rec {
|
||||
# name (using lowercase letters everywhere because using installing packages having different capitalization is discouraged) - this way there is not that much to remember?
|
||||
|
||||
cabal_darcs_name = "cabal--darcs";
|
||||
|
||||
# introducing p here to speed things up.
|
||||
# It merges derivations (defined below) and additional inputs. I hope that using as few nix functions as possible results in greates speed?
|
||||
# unfortunately with x; won't work because it forces nix to evaluate all attributes of x which would lead to infinite recursion
|
||||
pkgs = let x = ghc.all_libs // derivations; in {
|
||||
# ghc extra packages
|
||||
mtl = { name="mtl-1.1.0.0"; goSrcDir="libraries/mtl"; p_deps=[ x.base ]; src = ghc.extra_src; };
|
||||
parsec = { name="parsec-2.1.0.0"; goSrcDir="libraries/parsec"; p_deps=[ x.base ]; src = ghc.extra_src; };
|
||||
network = { name="network-2.1.0.0"; goSrcDir="libraries/network"; p_deps=[ x.base x.parsec x.haskell98 ]; src = ghc.extra_src; };
|
||||
regex_base = { name="regex-base-0.72.0.1"; goSrcDir="libraries/regex-base"; p_deps=[ x.base x.array x.bytestring x.haskell98 ]; src = ghc.extra_src; };
|
||||
regex_posix = { name="regex-posix-0.72.0.2"; goSrcDir="libraries/regex-posix"; p_deps=[ x.regex_base x.haskell98 ]; src = ghc.extra_src; };
|
||||
regex_compat = { name="regex-compat-0.71.0.1"; goSrcDir="libraries/regex-compat"; p_deps=[ x.base x.regex_posix x.regex_base x.haskell98 ]; src = ghc.extra_src; };
|
||||
stm = { name="stm-2.1.1.0"; goSrcDir="libraries/stm"; p_deps=[ x.base x.array ]; src = ghc.extra_src; };
|
||||
hunit = { name="HUnit-1.2.0.0"; goSrcDir="libraries/HUnit"; p_deps=[ x.base ]; src = ghc.extra_src; };
|
||||
quickcheck = { name="QuickCheck-1.1.0.0"; goSrcDir="libraries/QuickCheck"; p_deps=[x.base x.random]; src = ghc.extra_src; };
|
||||
|
||||
|
||||
# other pacakges (hackage etc)
|
||||
binary = rec { name = "binary-0.4.1"; p_deps = [ x.base x.bytestring x.containers x.array ];
|
||||
src = fetchurl { url = "http://hackage.haskell.org/packages/archive/binary/0.4.1/binary-0.4.1.tar.gz";
|
||||
sha256 = "0jg5i1k5fz0xp1piaaf5bzhagqvfl3i73hlpdmgs4gc40r1q4x5v"; };
|
||||
};
|
||||
# 1.13 is stable. There are more recent non stable versions
|
||||
haxml = rec { name = "HaXml-1.13.3"; p_deps = [ x.base x.rts x.directory x.process x.pretty x.containers x.filepath x.haskell98 ];
|
||||
src = fetchurl { url = "http://www.haskell.org/HaXml/${name}.tar.gz";
|
||||
sha256 = "08d9wy0rg9m66dd10x0zvkl74l25vxdakz7xp3j88s2gd31jp1v0"; };
|
||||
};
|
||||
xhtml = rec { name = "xhtml-3000.0.2.2"; p_deps = [ x.base ];
|
||||
src = fetchurl { url = "http://hackage.haskell.org/packages/archive/xhtml/3000.0.2.2/xhtml-3000.0.2.2.tar.gz";
|
||||
sha256 = "112mbq26ksh7r22y09h0xvm347kba3p4ns12vj5498fqqj333878"; };
|
||||
};
|
||||
html = rec { name = "html-1.0.1.1"; p_deps = [ x.base ];
|
||||
src = fetchurl { url = "http://hackage.haskell.org/packages/archive/html/1.0.1.1/html-1.0.1.1.tar.gz";
|
||||
sha256 = "10fayfm18p83zlkr9ikxlqgnzxg1ckdqaqvz6wp1xj95fy3p6yl1"; };
|
||||
};
|
||||
crypto = rec { name = "crypto-4.1.0"; p_deps = [ x.base x.array x.pretty x.quickcheck x.random x.hunit ];
|
||||
src = fetchurl { url = "http://hackage.haskell.org/packages/archive/Crypto/4.1.0/Crypto-4.1.0.tar.gz";
|
||||
sha256 = "13rbpbn6p1da6qa9m6f7dmkzdkmpnx6jiyyndzaz99nzqlrwi109"; };
|
||||
};
|
||||
hslogger = rec { name = "hslogger-1.0.4"; p_deps = [ x.containers x.directory x.mtl x.network x.process];
|
||||
src = fetchurl { url = "http://hackage.haskell.org/packages/archive/hslogger/1.0.4/hslogger-1.0.4.tar.gz";
|
||||
sha256 = "0kmz8xs1q41rg2xwk22fadyhxdg5mizhw0r4d74y43akkjwj96ar"; };
|
||||
};
|
||||
|
||||
|
||||
# HAPPS - Libraries
|
||||
http_darcs = { name="http-darcs"; p_deps = [x.network x.parsec];
|
||||
src = fetchdarcs { url = "http://darcs.haskell.org/http/"; md5 = "4475f858cf94f4551b77963d08d7257c"; };
|
||||
};
|
||||
syb_with_class_darcs = { name="syb-with-class-darcs"; p_deps = [x.template_haskell x.bytestring ];
|
||||
src = fetchdarcs { url = "http://happs.org/HAppS/syb-with-class"; md5 = "b42336907f7bfef8bea73bc36282d6ac"; };
|
||||
};
|
||||
|
||||
happs_data_darcs = { name="HAppS-Data-darcs"; p_deps=[ x.base x.mtl x.template_haskell x.syb_with_class_darcs x.haxml x.happs_util_darcs x.regex_compat x.bytestring x.pretty ];
|
||||
src = fetchdarcs { url = "http://happs.org/repos/HAppS-Data"; md5 = "10c505dd687e9dc999cb187090af9ba7"; };
|
||||
};
|
||||
happs_util_darcs = { name="HAppS-Util-darcs"; p_deps=[ x.base x.mtl x.hslogger x.template_haskell x.array x.bytestring x.old_time x.process x.directory ];
|
||||
src = fetchdarcs { url = "http://happs.org/repos/HAppS-Util"; md5 = "693cb79017e522031c307ee5e59fc250"; };
|
||||
};
|
||||
happs_state_darcs = { name="HAppS-State-darcs"; p_deps=[ x.base x.haxml
|
||||
x.mtl x.network x.stm x.template_haskell x.hslogger
|
||||
x.happs_util_darcs x.happs_data_darcs x.bytestring x.containers
|
||||
x.random x.old_time x.old_locale x.unix x.directory x.binary ];
|
||||
src = fetchdarcs { url = "http://happs.org/repos/HAppS-State";
|
||||
md5 = "956e5c293b60f4a98148fedc5fa38acc";
|
||||
};
|
||||
};
|
||||
happs_plugins_darcs = { name="HAppS-plugins-darcs"; p_deps=[ x.base x.mtl x.hslogger x.happs_util_darcs x.happs_data_darcs x.happs_state_darcs ];
|
||||
src = fetchdarcs { url = "http://happs.org/repos/HAppS-Util"; md5 = "693cb79017e522031c307ee5e59fc250"; };
|
||||
};
|
||||
# there is no .cabal yet
|
||||
#happs_smtp_darcs = { name="HAppS-smtp-darcs"; p_deps=[];
|
||||
#src = fetchdarcs { url = "http://happs.org/repos/HAppS-smtp"; md5 = "5316917e271ea1ed8ad261080bcb47db"; };
|
||||
#};
|
||||
|
||||
happs_ixset_darcs = { name="HAppS-IxSet-darcs"; p_deps=[ x.base x.mtl
|
||||
x.hslogger x.happs_util_darcs x.happs_state_darcs x.happs_data_darcs
|
||||
x.template_haskell x.syb_with_class_darcs x.containers ];
|
||||
src = fetchdarcs { url = "http://happs.org/repos/HAppS-IxSet";
|
||||
#md5 = "fa6b24517f09aa16e972f087430967fd";
|
||||
#tag = "0.9.2";
|
||||
# no tag
|
||||
md5 = "fa6b24517f09aa16e972f087430967fd";
|
||||
};
|
||||
};
|
||||
happs_darcs = { name="happs-darcs"; p_deps=[x.haxml x.parsec x.mtl
|
||||
x.network x.regex_compat x.hslogger x.happs_data_darcs
|
||||
x.happs_util_darcs x.happs_state_darcs x.happs_ixset_darcs x.http_darcs
|
||||
x.template_haskell x.xhtml x.html x.bytestring x.random
|
||||
x.containers x.old_time x.old_locale x.directory x.unix];
|
||||
src = fetchdarcs { url = "http://happs.org/repos/HAppS-HTTP"; md5 = "e1bb17eb30a39d30b8c34dffbf80edc2"; };
|
||||
};
|
||||
# we need recent version of cabal (because only this supports --pkg-config propably) Thu Feb 7 14:54:07 CET 2008
|
||||
# is be added to buildInputs automatically
|
||||
cabal_darcs = { name=cabal_darcs_name; p_deps = with ghc.all_libs; [base rts directory process pretty containers filepath];
|
||||
src = fetchdarcs { url = "http://darcs.haskell.org/cabal"; md5 = "8b0bc3c7f2676ce642f98b1568794cd6"; };
|
||||
};
|
||||
};
|
||||
toDerivation = attrs : with attrs;
|
||||
ghc_cabal_derivation {
|
||||
inherit name src;
|
||||
propagatedBuildInputs = p_deps ++ (lib.optional (attrs.name != cabal_darcs_name) derivations.cabal_darcs );
|
||||
goSrcDir = "cd ${if attrs ? goSrcDir then attrs.goSrcDir else "."}";
|
||||
patches = if attrs ? patches then attrs.patches else [];
|
||||
# add cabal, take deps either from this list or from ghc.core_libs
|
||||
} null;
|
||||
# result is { mtl = <deriv>;
|
||||
# "mtl-1.." = <the same deriv>
|
||||
# ...}
|
||||
# containing the derivations defined here and in ghc.all_libs
|
||||
derivations = with lib; builtins.listToAttrs (lib.concatLists ( lib.mapRecordFlatten
|
||||
( n : attrs : let d = (toDerivation attrs); in [ (nv n d) (nv attrs.name d) ] ) pkgs ) );
|
||||
}.derivations;
|
||||
|
||||
|
||||
# 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
|
||||
# So installing ghc libraries isn't done by nix-env -i package but by adding the lib to the libraries list below
|
||||
# the lib to the libraries list below
|
||||
# Doesn't create that much useless symlinks (you seldomly want to read the
|
||||
# .hi and .o files, right?
|
||||
ghcLibraryWrapper68 =
|
||||
let ghc = ghcsAndLibs.ghc68.ghc; in
|
||||
createGhcWrapper rec {
|
||||
ghcPackagedLibs = true;
|
||||
name = "ghc${ghc.version}_wrapper";
|
||||
suffix = "${ghc.version}wrapper";
|
||||
libraries = map ( a : __getAttr a ghcsAndLibs.ghc68.core_libs ) [
|
||||
"old-locale-1.0.0.0" "old-time-1.0.0.0" "filepath-1.1.0.0" "directory-1.0.0.0" "array-0.1.0.0" "containers-0.1.0.1"
|
||||
"hpc-0.5.0.0" "bytestring-0.9.0.1" "pretty-1.0.0.0" "packedstring-0.1.0.0" "template-haskell-2.2.0.0"
|
||||
"unix-2.3.0.0" "process-1.0.0.0" "readline-1.0.1.0" "Cabal-1.2.3.0" "random-1.0.0.0" "haskell98-1.0.1.0" "ghc-${ghc.version}"
|
||||
"array-0.1.0.0" "bytestring-0.9.0.1" "containers-0.1.0.1" "directory-1.0.0.0" "filepath-1.1.0.0"
|
||||
"ghc-${ghc.version}" "haskell98-1.0.1.0" "hpc-0.5.0.0" "old-locale-1.0.0.0" "old-time-1.0.0.0"
|
||||
"packedstring-0.1.0.0" "pretty-1.0.0.0" "process-1.0.0.0" "random-1.0.0.0"
|
||||
"readline-1.0.1.0" "rts-1.0" "unix-2.3.0.0" "base-3.0.1.0"
|
||||
] ++ map ( a : __getAttr a (ghc68_extra_libs ghcsAndLibs.ghc68 ) ) [
|
||||
"mtl-1.1.0.0"
|
||||
];
|
||||
# (flatten ghcsAndLibs.ghc68.core_libs);
|
||||
libraries =
|
||||
# core_libs distributed with this ghc version
|
||||
#(lib.flatten ghcsAndLibs.ghc68.core_libs)
|
||||
map ( a : __getAttr a ghcsAndLibs.ghc68.all_libs ) [
|
||||
"cabal" "array" "base" "bytestring" "containers" "containers" "directory"
|
||||
"filepath" "ghc-${ghc.version}" "haskell98" "hpc" "old_locale" "old_time"
|
||||
"old_time" "packedstring" "pretty" "process" "random" "readline" "rts"
|
||||
"template" "unix" "template_haskell" ]
|
||||
# some extra libs
|
||||
|
||||
++ (lib.flattenAttrs (ghc68_extra_libs ghcsAndLibs.ghc68) );
|
||||
# or specify the ones you want to install using this list (possible values see attributes in ghc68_extra_libs
|
||||
#++ map ( a : __getAttr a (ghc68_extra_libs ghcsAndLibs.ghc68 ) )
|
||||
#[ "mtl" "parsec" "cabal_darcs" "haxml" "network" "regex_base"
|
||||
#"regex_compat" "regex_posix" "stm" "hunit" "quickcheck" "crypto"
|
||||
#"hslogger" "http_darcs" "syb_with_class_darcs"
|
||||
#];
|
||||
# some additional libs
|
||||
inherit ghc;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user