next up previous contents
Next: Getting started Up: Darcs 0.9.17 David's advanced Previous: Introduction   Contents

Subsections

Building darcs

This chapter should walk you through the steps necesary to build darcs for yourself. There are in general two ways to build darcs. One is for building released versions from tarballs, and the other is to build the latest and greatest darcs, from the darcs repo itself.

Please let me know if you have any problems building darcs, or don't have problems described in this chapter and think there's something obsolete here, so I can keep this page up-to-date.

Prerequisites

To build darcs you will need to have ghc, the Glorious Glasgow Haskell Compiler. You should have at the very minimum version 5.04.2, but I myself only test it with 5.04.3. There are plans to phase out support for ghc5, so moving up to 6.0 is a good idea.

It is a good idea (but not required) to have a recent version of libcurl installed. If not, you will at least need to have either wget or curl installed if you want to be able to grab repos remotely over normal network protocols (ftp or http). You also might want to have scp available if you want to grab your repos over ssh...

To push patches, you will also need to have a working /usr/sbin/sendmail or /usr/lib/sendmail, which is provided by most mail transport agents, and is generally available on linux and BSD systems. It's also there on MacOS X. However, if you don't have this, it won't stop you from building darcs.

To use the diff command of darcs, a diff program supporting options -r (recursive diff) and -N (show new files as differences against an empty file) is required. The configure script will look for gdiff, gnudiff and diff in this order. You can force the use of another program by setting the DIFF environment variable before running configure.

To rebuild the documentation (which should not be necesary since it is included in html form with the tarballs), you will need to have latex installed, as well as latex2html if you want to build it in html form.

Building on MacOS X

To build on MacOS X, you will need the Apple Developer Tools and the ghc 6.0 package installed. There seems to be a problem with ghc and Apple's gcc 3.3, so you may need to run
% sudo gcc_select 3.1
to avoid crashes. I have also had to run autoconf once when the configure script failed.

Building on Microsoft Windows

I don't have Windows and don't know how to build darcs on it. It has been done, but I may have broken it recently... If you try building darcs on windows, whether you succeed or fail, please post on the darcs-users mailing list so we'll know how it went.

Building from tarball

If you get darcs from a tarball, the procedure (after unpacking the tarball itself) is as follows:
% ./configure
% make
% make install

There are options to configure that you may want to check out with

% ./configure --help

Building darcs from the repository

To build the latest darcs from its repository, you will first need a working copy of darcs. You can get darcs using:
% darcs get -v http://abridgegame.org/repos/darcs
and once you have the darcs repository you can bring it up to date with a
% darcs pull

The repository doesn't hold automatically generated files, which include the configure script and the HTML documentation. The documentation you can do without, but the configure script you have to generate using

% autoconf
Of course, this means you'll need to have autoconf installed.

After this the build process is the same as in the tarball case:

% ./configure
% make
% make install

Submitting patches to darcs

I know, this doesn't really belong in this chapter, but if you're using the repository version of darcs it's really easy to submit patches to me using darcs. In fact, even if you don't know any haskell, you could submit fixes or additions to this document (by editing building_darcs.tex) based on your experience building darcs...

To do so, just record your changes (which you made in the darcs repository)

% darcs record --no-test
making sure to give the patch a nice descriptive name. The --no-test options keeps darcs from trying to run the unit tests, which can be rather time-consuming. Then you can send the patch to me via email by
% darcs push
The darcs repository stores the email address to which patches should be pushed by default.


next up previous contents
Next: Getting started Up: Darcs 0.9.17 David's advanced Previous: Introduction   Contents
David Roundy 2004-02-21