Haskell related Debian packages

David Roundy droundy@jdj5.mit.edu
Thu, 12 Dec 2002 13:47:51 -0500


...

> So I'm considering sticking the *.lhs files for HUnit, for example, in
> /usr/share/hunit.  Then people can alter their Makefiles to include
> that directory in either hugs or ghc, but I see one problem with that:
> GHC would want to compile the source files, and stick them in
> /usr/share/hunit, but would be unable to (because of permissions
> problems when users compile).

Yes, it does seem that you'd want the libraries to be installed in binary
form for ghc (and probably if it supports it, nhc).  Among other things,
libraries should be compiled with as much optimization as possible, while
the user may not want to do the same with his code (which he has to
repeatedly recompile).

> The package could install binary files, but then it would build-depend
> on ghc which doesn't exist for several Debian platforms.  So I guess
> it could check to see if ghc is installed on the building computer and
> stick binaries in /usr/lib.

This would create problems with buildd's would it not, since if you don't
build-depend on ghc, it won't be installed on the building computers?

> Another option would be to compile packages for GHC in the post-install
> script if ghc is installed, and stick those installed files in
> /usr/lib, and the .hs files in /usr/share/hugs98/extentions if hugs is
> installed.

I vote for this.  The only hairy issue is that this would mean that the
order of installation of packages would be important, which does not sound
like a good idea at all.  :(

It seems that things might be optimal if there were some sort of registry
system, where the library packages could "inform" the compilers that they
have packages available and the compilers could complete the installation
themselves.  I think that the emacsen do something like this.  If I had to
implement it, I'd stick all the libraries in /usr/share/haskell-src or
something, and then have all the compilers (at least ghc and hugs) provide
a "install libraries" script which would look in that directory and install
(either by compiling, symlinking or copying) the libraries in the right
place.  This script would be called both in the postinst and the postrm (to
remove the compiled libraries) of all libraries and also the compilers.  Of
course, this assumes you can get the hugs and ghc maintainers to agree on
the system.  Although even if just ghc does it, it will at least solve the
problems wrt order of installation.
-- 
David Roundy
http://civet.berkeley.edu/droundy/