Version 39 (modified by wjt, 20 months ago)

correct "it's" to "its"

Cabal Install

cabal-install is the command-line interface for Cabal.

It provides commands for installing cabal packages, including downloading packages from HackageDB and determining the dependencies among packages. It also provides commands for developers to configure, build, test and upload packages to HackageDB.

Download

Cabal install is included in the haskell platform:

 http://hackage.haskell.org/platform/

You can also download it directly from its hackage page:

 http://hackage.haskell.org/package/cabal-install

Bugs

Go to the front page for instructions on reporting bugs in Cabal, cabal-install or the hackage site.

Development version

Head branch darcs repositories:

Note: The cabal repo now includes both the Cabal library and the cabal-install tool.

The current development version is quite usable but if you find any surprises please report them in this trac.

Stable branch darcs repositories:

Usage

Usage: cabal [GLOBAL FLAGS]
   or: cabal COMMAND [FLAGS]

Global flags:
 -h --help            Show this help text
 -V --version         Print version information
    --numeric-version Print just the version number

Commands:
  install      Installs a list of packages.
  list         List available packages on the server (cached).
  update       Updates list of known packages
  fetch        Downloads packages for later installation or study.
  upload       Uploads source packages to Hackage
  configure    Prepare to build the package.
  build        Make this package ready for installation.
  copy         Copy the files into the install locations.
  haddock      Generate Haddock HTML documentation.
  clean        Clean up after a build.
  sdist        Generate a source distribution file (.tar.gz).
  hscolour     Generate HsColour colourised code, in HTML format.
  register     Register this package with the compiler.
  test         Run the test suite, if any (configure with UserHooks).

Typical step for installing Cabal packages:
  cabal install [PACKAGES]

Occasionally you need to update the list of available packages:
  cabal update

For more information about a command, try 'cabal COMMAND --help'.
This program is the command line interface to the Haskell Cabal Infrastructure.
See http://www.haskell.org/cabal/ for more information.

See the  cabal page for more complete usage information.

There is bash command line completion support available, though currently that requires installing manually.

Quick Installation on Unix

wget http://hackage.haskell.org/packages/archive/cabal-install/0.8.2/cabal-install-0.8.2.tar.gz
tar -zxf cabal-install-0.8.2.tar.gz
cd cabal-install-0.8.2
sh ./bootstrap.sh

You will now have the cabal binary in $HOME/.cabal/bin. You should also add this directory to your $PATH.

In cabal-install 0.6 and later you can get cabal to automatically symlink binaries into another directory, eg $HOME/bin which can be done instead of changing the $PATH. To use this feature edit ~/.cabal/config and see the symlink-bindir field.

Note: cabal-install 0.6 uses a new default ~/.cabal/config file which is somewhat self-documenting in that it lists all the valid (non-deprecated) fields along with their default values. If you previously used cabal-install 0.5.1 or earlier then you will not see the new format, so you may like to back up your existing config, let cabal-install 0.6 re-create the default config and then merge back any local changes. On Windows the configuration file is named $HOME/Application Data/cabal/config.

Reply to note: As of 19 April 2009, cabal-install does not actually create ~/.cabal/config. In order to have a config file, you must first run cabal update or similar.

Ubuntu Intrepid Ibex 8.10

These packages must be installed to run successfully bootstrap.sh:

  • ghc6
  • libghc6-parsec-dev
  • libghc6-network-dev
  • libghc6-http-dev
  • libghc6-mtl-dev
  • zlib1g-dev

You can execute this command to satisfy these dependencies:

sudo apt-get install ghc6 libghc6-parsec-dev libghc6-network-dev libghc6-http-dev libghc6-mtl-dev zlib1g-dev

Troubleshooting

 Storage and Identification of Cabalized Packages: "This article describes where library packages for GHC are stored, how GHC remembers them, and corollaries. Cabal tries to abstract this away from you, but the abstraction leaks. ... This article is Linux-centric." Highly recommended.