[Nix-dev] Merging haskell stuff - missing features?
Marc Weber
marco-oweber at gmx.de
Sun May 11 14:14:30 CEST 2008
Andres Loeh, can you add the features you'd like to have /add somehow
to make haskell experience even better?
Maybe you can take the time to help creating a small roadmap merging the
haskell stuff. Think of all differences (file layout) etc..
My code features:
* splitting core library packages
* get ghc-pkg dependencies from GHC_PACKAGE_PATH (beeing a list
of databases only containing one library)
either by patched cabal version or by creating a local package
db on the fly (nix_ghc_pkg_tool join local-db)
* installing tags
* choose libraries to *register* (note 1)
* adding your local libraries only adding them to .nixpkgs/config.nix
* installes helper applications provided by libs along with the
library (eg Xtract HaXml)
* compiling with profiling support (.nixpkgs/config.nix)
* installing different sets of libraries (do you need this?)
* install latest ghc version from cabal sources (not that important)
things to do / to improve
* add support for adding cabal flags per package (-fflag=value)
* tidy up/ add some more documentation?
* which is the best way to choose the libraries you want? (note 1)
* better support for adding C libraries as dependencies (I'm
using a manual patchPhase using sed.. :(
Doing this properly means patching cabal
* everything is done manually (except getting darcs sources)
* make xmonad compile .. (-> add xlibs)
installing a wrapper pro / cons:\
pro:
only one derivation to install (and some binaries) (less files in .nix-profile/..)
no need to to register packages
contra:
installing might take more time than only installing on
library.. So you are forced to switch tasks when adding a new
expression
you need to start ghc*6.8.2wrapper (you can use aliases or the
wrapper names could be changed)
I personally don't care about hugs. But cabal of course does.
So I'm not sure wether it makes sense to get a baseic cabal install all no
matter which compiler function.
I've put all libraries into one bigger file.. because I was to lazy to
create many. But it only contains necessary stuff (buildinputs, name,
src and patches). I hope this is fine.
Which features would you add to get more valuable haskell experience
using nix?
Probably expressions should be automatically generated from hackage..
If we start this we still need to feed in a list of patches per package
to fix Setup.hs files and add library dependencies. I think it's better
to fix Setup.hs files compared to using older cabal versions.
I think intsalling libraries should be as easy as
either using "all" or [ "pkg1" "pkg2" ... ] to your personal .nixpkgs/config.nix
this will be added to (note 1) in the near future..
Do you have another suggestion?
Marc Weber
note 1:
You define your wrapper this way
instead of lib.flattenAttrs ... (means install all availible packages)
you can pick only ["Cabal" "hdbc-mysql"] etc.
# 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
# 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
ghcWrapper rec {
ghcPackagedLibs = true;
name = "ghc${ghc.version}_wrapper";
suffix = "${ghc.version}wrapper";
libraries =
# core_libs distributed with this ghc version
(lib.flattenAttrs ghcsAndLibs.ghc68.core_libs)
# (map ( a : __getAttr a ghcsAndLibs.ghc68.core_libs ) [ "cabal"
# "mtl" "base" ]
# some extra libs
++ (lib.flattenAttrs (ghc68extraLibs ghcsAndLibs.ghc68) );
# ++ map ( a : __getAttr a (ghc68extraLibs ghcsAndLibs.ghc68 ) )
# [ "mtl" "parsec" ... ]
inherit ghc;
};
More information about the nix-dev
mailing list