[darcs-users] GHC package for darcs

Craig M.Lennox list-darcs-users at cosmic.com
Sun Sep 26 23:00:20 UTC 2004


droundy at abridgegame.org (David Roundy) writes:
> >
> > Well, we already have the three: darcs itself, darcs_cgi, and the unit
> > tester.  It would be an interesting exercise to try to make those
> > three programs compile with nothing but themselves and a binary darcs
> > package.
> 
> Yes, indeed.  Patches (by yourself or others) to do this would be welcome
> (probably to darcs-unstable... can't afford to break the build
> system).

Excellent!  I've set up two repositories for my efforts towards this
goal;
        http://cosmic.com/repos/darcs-unstable
        http://cosmic.com/repos/darcs-pkg

The first repository contains my patches to darcs proper (against the
darcs-unstable repository on abridgegame.org).  The second repository
contains the build framework for making and installing the package
(including a Makefile which "darcs get"'s a copy of the darcs-unstable
repository).

I made a separate build framework for the darcs package to keep to a
minimum the number of patches against darcs-unstable while development
is in progress.  I also wanted to take advantage of GHC's hierarchical
module namespace (which is strongly recommended for packages), which
requires source files to follow a directory-naming structure and use
fully-qualified names in "module" and "import" statements.  To
minimise the impact on the current build system, source files are
copied from the darcs-unstable repository and run through a sed
script.

For my initial cut of the darcs package, I've concentrated primarily
on modules implementing "core" functionality (reading, manipulating,
commuting, and merging of patches, and support modules for these
functions).  There are 22 of these so far, which have been put into
the Darcs.Core.* namespace.  I also plan to have a Darcs.Term.* for
terminal support and a Darcs.Net.* for transferring patches from and
to remote repositories.

To facilitate this modularity, I've created two new modules in
darcs-unstable.  These are ColourPrinter (containing the
curses-dependent parts of Printer) and Motd (implementing show_motd so
that RepoPrefs doesn't need to import External).

Try it out, let me know what you think so far.

cheers,
Craig




More information about the darcs-users mailing list