[darcs-users] darcs patch: Add a template for building the darcs.cabal file.

David Roundy droundy at darcs.net
Tue Oct 21 11:32:17 UTC 2008


On Tue, Oct 21, 2008 at 10:54:16AM +0000, Eric Kow wrote:
> Slight amendment (no make_changelog)
> 
> Tue Oct 21 11:46:13 BST 2008  Eric Kow <eric.kow at gmail.com>
>   * Add a template for building the darcs.cabal file.
>   This is slightly modified from Gwern Branwern's and Petr Rockai's
>   cabalisation work.

Applied, thanks!

But I'd prefer to cut out information that isn't used, such as data-files,
extra-source-files, other-modules, source-dirs, c-sources, etc, so that
this file is more compact and less likely to get out of date.  This should
ideally be done by someone who has cabal-install and can check that it
actually works.

David

> hunk ./darcs.cabal.in 1
> +Name:           darcs
> +version:        @DARCS_VERSION@
> +License:        GPL
> +License-file:   COPYING
> +Author:         David Roundy <droundy at darcs.net>, <darcs-devel at darcs.net>, et al.
> +Maintainer:     <darcs-users at darcs.net>
> +
> +Stability:      Experimental
> +Category:       Development
> +Synopsis:       David's Advanced Revision Control System
> +Description:    Darcs is a revision control system, along the lines of CVS or arch.
> +                That means that it keeps track of various revisions and branches of
> +                your project, allows for changes to propagate from one branch to another.
> +                Darcs is intended to be an _advanced_ revision control system.
> +                Darcs has two particularly distinctive features which differ from other,
> +                centralized, revision control systems:
> +                .
> +                * each copy of the source is a fully functional branch, and
> +                .
> +                * underlying darcs is a consistent and powerful theory of patches.
> +                .
> +                The Darcs repository can be found at <http://darcs.net/>.
> +Homepage:       http://darcs.net/
> +
> +Build-Type:     Custom
> +Cabal-Version:  >= 1.2
> +Tested-with:    GHC==6.8.2
>
> +data-files:      src/best_practices.tex, src/building_darcs.tex, src/configuring_darcs.tex,
> +                 src/features.tex, src/gpl.tex, src/switching.tex,
> +                 tools/cgi/README.in
> +extra-source-files:
> +                 -- C sources and headers. Are these redundant with c-sources:?
> +                 src/Crypt/sha2.c, src/Crypt/sha2.h, src/atomic_create.c,
> +                 src/atomic_create.h, src/c_compat.c, src/compat.h,
> +                 src/fpstring.c, src/fpstring.h, src/gadts.h,
> +                 src/hscurl.c, src/hscurl.h,
> +                 src/hslibwww.c, src/hslibwww.h,
> +                 src/impossible.h, src/maybe_relink.c, src/maybe_relink.h,
> +                 src/umask.c, src/umask.h,
> +                 -- Windows files
> +                 src/win32/send_email.c, src/win32/send_email.h, src/win32/sys/mman.h,
> +                 src/win32/CtrlC.hs, src/win32/System/Posix/Files.hsc,
> +                 src/win32/System/Posix/IO.hsc, src/win32/System/Posix.hs,
> +                 -- TODO: factor out these standalone executables to other sections
> +                 src/preproc.hs, src/darcsman.hs, src/unit.lhs,
> +                 -- The tools directory would make a sensible 'darcs-tools' package
> +                 tools/zsh_completion_new, tools/update_roundup.pl,
> +                 tools/zsh_completion_old, tools/cgi/darcs.cgi.in,
> +                 tools/cgi/cgi.conf.in, tools/cgi/xslt/repos.xslt,
> +                 tools/cgi/xslt/errors.xslt, tools/cgi/xslt/browse.xslt,
> +                 tools/cgi/xslt/common.xslt, tools/cgi/xslt/annotate.xslt,
> +                 tools/cgi/xslt/styles.css, tools/cgi/xslt/rss.xslt,
> +                 tools/cgi/xslt/patches.xslt, tools/cgi/xslt/errors.xml,
> +                 tools/cgi/README.in, tools/cygwin-wrapper.bash,
> +                 tools/upload.cgi, tools/darcs_completion
> +
> +flag terminfo
> +     description: Enables terminfo support. Required for colors.
> +flag curl
> +     description: Enables curl support.
> +flag threading
> +     description: Enables threaded runtime.
> +flag haskeline
> +     description: Enables haskeline support.
> +
> +Executable          darcs
> +    main-is:        darcs.lhs
> +    hs-source-dirs: src
> +    cpp-options:    -DHAVE_BYTESTRING
> +
> +    build-depends: regex-compat, mtl, parsec, html, QuickCheck, HUnit, utf8-string, bytestring
> +
> +    if impl(ghc >= 6.8)
> +        build-depends: base >= 3, old-time, directory, process, containers, array
> +
> +        if !os(windows)
> +           build-depends: unix
> +
> +    else
> +        build-depends: base < 3
> +
> +    -- We need optimizations and warnings, regardless of what Hackage says
> +    ghc-options:      -Wall -O2 -funbox-strict-fields
> +    ghc-prof-options: -prof -auto-all
> +
> +    extensions:     CPP, ForeignFunctionInterface
> +
> +    other-modules:  Ssh,
> +                    FastPackedString,
> +                    Crypt.SHA256, URL, HTTP,
> +                    Darcs.Patch.ReadMonads, Darcs.URL,
> +                    Darcs.FilePathUtils, Darcs.External, Darcs.RepoPath,
> +                    Darcs.Email, Darcs.Compat,
> +                    IsoDate, Exec,
> +                    CommandLine,
> +                    DateMatcher, OldDate,
> +                    Printer, Lcs, RegChars, UglyFileName,
> +                    Darcs.Sealed, Darcs.Resolution, Darcs.TheCommands,
> +                    Darcs.ColorPrinter, Darcs.Utils, Darcs.ArgumentDefaults,
> +                    Darcs.Patch, Darcs.PrintPatch, Darcs.SignalHandler,
> +                    Darcs.Lock, Darcs.FilePathMonad,
> +                    Darcs.Patch.Check, Darcs.Patch.FileName,
> +                    Darcs.Patch.Patchy, Darcs.Patch.Prim, Darcs.Patch.Commute,
> +                    Darcs.Patch.Properties, Darcs.Patch.Viewing, Darcs.Patch.Apply,
> +                    Darcs.Patch.Core, Darcs.Patch.Real, Darcs.Patch.Bundle,
> +                    Darcs.Patch.Choices, Darcs.Patch.TouchesFiles, Darcs.Patch.Permutations,
> +                    Darcs.Patch.QuickCheck, Darcs.Patch.MatchData, Darcs.Ordered,
> +                    Darcs.Patch.Test, Darcs.Patch.Set, Darcs.Patch.Show,
> +                    Darcs.Patch.Unit, Darcs.Patch.Info, Darcs.Patch.Match,
> +                    Darcs.Patch.Read, Darcs.Patch.Non, Darcs.Patch.Depends,
> +                    Darcs.Population, Darcs.Repository.Prefs, Darcs.Repository.Internal,
> +                    Darcs.Repository.DarcsRepo, Darcs.Repository.Pristine, Darcs.Repository.Motd,
> +                    Darcs.Repository.HashedRepo, Darcs.Repository.InternalTypes, Darcs.Repository.Format,
> +                    Darcs.Repository.Checkpoint, Darcs.Repository.ApplyPatches, Darcs.Repository.HashedIO,
> +                    Darcs.Global, Darcs.Bug,
> +                    Darcs.Commands.ShowContents, Darcs.Commands.Check, Darcs.Commands.Record,
> +                    Darcs.Commands.Remove, Darcs.Commands.Mv, Darcs.Commands.Convert,
> +                    Darcs.Commands.ShowRepo, Darcs.Commands.Apply, Darcs.Commands.Help,
> +                    Darcs.Commands.Tag, Darcs.Commands.Unrevert, Darcs.Commands.Optimize,
> +                    Darcs.Commands.ShowBug, Darcs.Commands.TransferMode, Darcs.Commands.ShowFiles,
> +                    Darcs.Commands.Dist, Darcs.Commands.Repair, Darcs.Commands.AmendRecord,
> +                    Darcs.Commands.Push, Darcs.Commands.ShowTags, Darcs.Commands.ShowAuthors,
> +                    Darcs.Commands.Replace, Darcs.Commands.Changes, Darcs.Commands.WhatsNew,
> +                    Darcs.Commands.Add, Darcs.Commands.Get, Darcs.Commands.Init,
> +                    Darcs.Commands.Put, Darcs.Commands.TrackDown, Darcs.Commands.Unrecord,
> +                    Darcs.Commands.Rollback, Darcs.Commands.Revert, Darcs.Commands.Annotate,
> +                    Darcs.Commands.Pull, Darcs.Commands.Diff, Darcs.Commands.Send,
> +                    Darcs.Commands.Show, Darcs.Commands.SetPref, Darcs.Commands.MarkConflicts,
> +                    Darcs.Arguments, Darcs.CommandsAux, Darcs.Test,
> +                    Darcs.Repository, Darcs.CheckFileSystem, Darcs.Flags,
> +                    Darcs.RemoteApply, Darcs.Progress, Darcs.Hopefully,
> +                    Darcs.SlurpDirectory, Darcs.Commands, Darcs.Diff,
> +                    Darcs.Show, Darcs.Match, Darcs.SelectChanges,
> +                    Darcs.PopulationData, Darcs.IO, English,
> +                    UTF8, SHA1, Workaround, Autoconf
> +
> +    if os(windows)
> +       hs-source-dirs: src/win32
> +       other-modules: CtrlC, System.Posix.Files, System.Posix.Files, System.Posix.IO, System.Posix
> +       c-sources: src/win32/sys/mman.h, src/win32/send_email.h,
> +                  src/win32/send_email.c
> +       cpp-options: -DNO_MMAP
> +
> +    c-sources:      src/atomic_create.c
> +                    src/c_compat.c
> +                    src/fpstring.c
> +                    src/maybe_relink.c
> +                    src/umask.c
> +                    src/Crypt/sha2.c
> +                    src/hscurl.c
> +    include-dirs:   src
> +
> +    -- zlib is mandatory; we need extra-libraries to fix FFI link errors
> +    extra-libraries: z
> +    if flag(threading)
> +       ghc-options: -threaded
> +    if flag(curl)
> +       extra-libraries: curl
> +       cpp-options: -DHAVE_CURL
> +       cc-options: -DHAVE_CURL
> +    else
> +       build-depends: HTTP
> +       cpp-options: -DHAVE_HTTP
> +    if flag(terminfo)
> +       build-depends: terminfo
> +       cpp-options: -DHAVE_TERMINFO
> +    if flag(haskeline)
> +       build-depends: haskeline
> +    if flag(curl) && !flag(threading)
> +       buildable: False


More information about the darcs-users mailing list