The Cabal library package

If you also want the cabal command-line program, you need the
cabal-install package in addition to this library.

Installing the Cabal library

If you already have the cabal program

In this case run:

$ cabal install

However, if you do not have an existing version of the cabal program,
you first must install the Cabal library. To avoid this bootstrapping
problem, you can install the Cabal library directly as described below.

Installing as root or Administrator

Compiling Setup rather than using runghc Setup is much faster and
works on Windows. For all packages other than Cabal itself, it is fine
to use runghc.

This will install into /usr/local on Unix, and on Windows it will
install into $ProgramFiles/Haskell. If you want to install elsewhere,
use the --prefix= flag at the configure step.

Using older versions of GHC and Cabal

It is recommended that you leave any pre-existing version of Cabal
installed. In particular, it is essential you keep the version that
came with GHC itself, since other installed packages require it (for
instance, the “ghc” API package).

Prior to GHC 6.4.2, however, GHC did not deal particularly well with
having multiple versions of packages installed at once. So if you are
using GHC 6.4.1 or older and you have an older version of Cabal
installed, you should probably remove it by running:

$ ghc-pkg unregister Cabal

or, if you had Cabal installed only for your user account, run:

$ ghc-pkg unregister Cabal --user

The filepath dependency

Cabal uses the filepath package, so it must be installed first.
GHC version 6.6.1 and later come with filepath, however, earlier
versions do not by default. If you do not already have filepath,
you need to install it. You can use any existing version of Cabal to do
that. If you have neither Cabal nor filepath, it is slightly
harder but still possible.

Bugs

Your help

To help Cabal’s development, it is enormously helpful to know from
Cabal’s users what their most pressing problems are with Cabal and
Hackage. You may have a favourite Cabal bug or limitation. Look at
Cabal’s bug tracker. Ensure that the problem is reported there and
adequately described. Comment on the issue to report how much of a
problem the bug is for you. Subscribe to the issues’s notifications to
discussed requirements and keep informed on progress. For feature
requests, it is helpful if there is a description of how you would
expect to interact with the new feature.

1.8.0.2 Duncan Coutts <duncan@haskell.org> December 2009 * Support for GHC-6.12 * New unique installed package IDs which use a package hash * Allow executables to depend on the lib within the same package * Dependencies for each component apply only to that component (previously applied to all the other components too) * Added new known license MIT and versioned GPL and LGPL * More liberal package version range syntax * Package registration files are now UTF8 * Support for LHC and JHC-0.7.2 * Deprecated RecordPuns extension in favour of NamedFieldPuns * Deprecated PatternSignatures extension in favor of ScopedTypeVariables * New VersionRange semantic view as a sequence of intervals * Improved package quality checks * Minor simplification in a couple Setup.hs hooks * Beginnings of a unit level testsuite using QuickCheck * Various bug fixes * Various internal cleanups

1.6.0.2 Duncan Coutts <duncan@haskell.org> February 2009 * New configure-time check for C headers and libraries * Added language extensions present in ghc-6.10 * Added support for NamedFieldPuns extension in ghc-6.8 * Fix in configure step for ghc-6.6 on Windows * Fix warnings in Path_pkgname.hs module on Windows * Fix for exotic flags in ld-options field * Fix for using pkg-config in a package with a lib and an executable * Fix for building haddock docs for exes that use the Paths module * Fix for installing header files in subdirectories * Fix for the case of building profiling libs but not ordinary libs * Fix read-only attribute of installed files on Windows * Ignore ghc -threaded flag when profiling in ghc-6.8 and older

1.6.0.1 Duncan Coutts <duncan@haskell.org> October 2008 * Export a compat function to help alex and happy

1.6.0.0 Duncan Coutts <duncan@haskell.org> October 2008 * Support for ghc-6.10 * Source control repositories can now be specified in .cabal files * Bug report URLs can be now specified in .cabal files * Wildcards now allowed in data-files and extra-source-files fields * New syntactic sugar for dependencies "build-depends: foo ==1.2.*" * New cabal_macros.h provides macros to test versions of dependencies * Relocatable bindists now possible on unix via env vars * New 'exposed' field allows packages to be not exposed by default * Install dir flags can now use $os and $arch variables * New --builddir flag allows multiple builds from a single sources dir * cc-options now only apply to .c files, not for -fvia-C * cc-options are not longer propagated to dependent packages * The cpp/cc/ld-options fields no longer use ',' as a separator * hsc2hs is now called using gcc instead of using ghc as gcc * New api for manipulating sets and graphs of packages * Internal api improvements and code cleanups * Minor improvements to the user guide * Miscellaneous minor bug fixes

1.1.3 Isaac Jones <ijones@syntaxpolice.org> Sept 2005 * WARNING: Interfaces not documented in the user's guide may change in future releases. * Move building of GHCi .o libs to the build phase rather than register phase. (from Duncan Coutts) * Use .tar.gz for source package extension * Uses GHC instead of cpphs if the latter is not available * Added experimental "command hooks" which completely override the default behavior of a command. * Some bugfixes

0.5 Isaac Jones <ijones@syntaxpolice.org> Wed Feb 19 2005 * WARNING: this is a pre-release and the interfaces are still likely to change until we reach a 1.0 release. * Hooks interfaces changed * Added preprocessors to user hooks * No more executable-modules or hidden-modules. Use "other-modules" instead. * Certain fields moved into BuildInfo, much refactoring * extra-libs -> extra-libraries * Added --gen-script to configure and unconfigure. * modules-ghc (etc) now ghc-modules (etc) * added new fields including "synopsis" * Lots of bug fixes * spaces can sometimes be used instead of commas * A user manual has appeared (Thanks, ross!) * for ghc 6.4, configures versionsed depends properly * more features to ./setup haddock

0.4 Isaac Jones <ijones@syntaxpolice.org> Sun Jan 16 2005

* Much thanks to all the awesome fptools hackers who have been working hard to build the Haskell Cabal!

* Interface Changes:

** WARNING: this is a pre-release and the interfaces are still likely to change until we reach a 1.0 release.

** Instead of Package.description, you should name your description files <something>.cabal. In particular, we suggest that you name it <packagename>.cabal, but this is not enforced (yet). Multiple .cabal files in the same directory is an error, at least for now.

** The "Modules" field is gone. Use "hidden-modules", "exposed-modules", and "executable-modules".

** Build-depends is now a package-only field, and can't go into executable stanzas. Build-depends is a package-to-package relationship.

** Some new fields. Use the Source.

* New Features

** Cabal is now included as a package in the CVS version of fptools. That means it'll be released as "-package Cabal" in future versions of the compilers, and if you are a bleeding-edge user, you can grab it from the CVS repository with the compilers.

** Hugs compatibility and NHC98 compatibility should both be improved.

** Hooks Interface / Autoconf compatibility: Most of the hooks interface is hidden for now, because it's not finalized. I have exposed only "defaultMainWithHooks" and "defaultUserHooks". This allows you to use a ./configure script to preprocess "foo.buildinfo", which gets merged with "foo.cabal". In future releases, we'll expose UserHooks, but we're definitely going to change the interface to those. The interface to the two functions I've exposed should stay the same, though.

** ./setup haddock is a baby feature which pre-processes the source code with hscpp and runs haddock on it. This is brand new and hardly tested, so you get to knock it around and see what you think.

** Some commands now actually implement verbosity.

** The preprocessors have been tested a bit more, and seem to work OK. Please give feedback if you use these.