cabal-install: The command-line interface for Cabal and Hackage.

[ bsd3, distribution, library, program ] [ Propose Tags ] [ Report a vulnerability ]

The 'cabal' command-line program simplifies the process of managing Haskell software by automating the fetching, configuration, compilation and installation of Haskell libraries and programs.


[Skip to Readme]

Flags

Automatic Flags
NameDescriptionDefault
old-base

Old, monolithic base

Disabled
bytestring-in-baseEnabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Versions [RSS] 0.4.0, 0.5.0, 0.5.1, 0.5.2, 0.6.0, 0.6.2, 0.6.4, 0.8.0, 0.8.2, 0.10.0, 0.10.2, 0.14.0, 0.14.1, 1.16.0, 1.16.0.1, 1.16.0.2, 1.16.1.0, 1.18.0, 1.18.0.1, 1.18.0.2, 1.18.0.3, 1.18.0.4, 1.18.0.5, 1.18.0.6, 1.18.0.7, 1.18.0.8, 1.18.1.0, 1.18.2.0, 1.20.0.0, 1.20.0.1, 1.20.0.2, 1.20.0.3, 1.20.0.4, 1.20.0.5, 1.20.0.6, 1.20.1.0, 1.20.2.0, 1.22.0.0, 1.22.0.1, 1.22.2.0, 1.22.3.0, 1.22.4.0, 1.22.5.0, 1.22.6.0, 1.22.7.0, 1.22.8.0, 1.22.9.0, 1.24.0.0, 1.24.0.1, 1.24.0.2, 2.0.0.0, 2.0.0.1, 2.2.0.0, 2.4.0.0, 2.4.1.0, 3.0.0.0, 3.2.0.0, 3.4.0.0, 3.4.1.0, 3.6.0.0, 3.6.2.0, 3.8.1.0, 3.10.1.0, 3.10.2.0, 3.10.2.1, 3.10.3.0, 3.12.1.0
Dependencies array (>=0.1 && <0.4), base (>=2 && <2.2 || >=3.0 && <5), bytestring (>=0.9), Cabal (>=1.8 && <1.9), containers (>=0.1 && <0.4), directory (>=1 && <1.1), filepath (>=1.0), HTTP (>=4000.0.2 && <4001), network (>=1 && <2.6), old-time (>=1 && <1.1), pretty (>=1 && <1.1), process (>=1 && <1.1), random (>=1 && <1.1), time (>=1.1 && <1.2), unix (>=1.0 && <2.5), Win32 (>=2 && <3), zlib (>=0.4 && <0.6) [details]
Tested with ghc ==6.6.1, ghc ==6.8.2, ghc ==6.10.4, ghc ==6.12.1
License BSD-3-Clause
Copyright 2005 Lemmih <lemmih@gmail.com> 2006 Paolo Martini <paolo@nemail.it> 2007 Bjorn Bringert <bjorn@bringert.net> 2007 Isaac Potoczny-Jones <ijones@syntaxpolice.org> 2008-2009 Duncan Coutts <duncan@haskell.org>
Author Lemmih <lemmih@gmail.com> Paolo Martini <paolo@nemail.it> Bjorn Bringert <bjorn@bringert.net> Isaac Potoczny-Jones <ijones@syntaxpolice.org> Duncan Coutts <duncan@haskell.org>
Maintainer cabal-devel@haskell.org
Revised Revision 1 made by AdamBergmark at 2015-05-07T15:09:05Z
Category Distribution
Home page http://www.haskell.org/cabal/
Bug tracker http://hackage.haskell.org/trac/hackage/
Source repo head: darcs get http://darcs.haskell.org/cabal-install/
this: darcs get http://darcs.haskell.org/cabal-branches/cabal-install-0.8/ --tag 0.8.0
Uploaded by DuncanCoutts at 2009-12-20T00:50:38Z
Distributions Arch:3.6.2.0, Debian:3.0.0.0, Fedora:3.8.1.0, FreeBSD:1.22.6.0, LTSHaskell:3.10.3.0, NixOS:3.12.1.0, Stackage:3.10.3.0, openSUSE:3.10.3.0
Reverse Dependencies 4 direct, 0 indirect [details]
Executables cabal
Downloads 260321 total (418 in the last 30 days)
Rating 2.5 (votes: 11) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2016-12-09 [all 8 reports]

Readme for cabal-install-0.8.0

[back to package description]
The cabal-install package
=========================

[Cabal home page](http://www.haskell.org/cabal/)

The `cabal-install` package provides a command line tool called `cabal`. The
tool uses the `Cabal` library and provides a convenient user interface to the
Cabal/Hackage package build and distribution system. It can build and install
both local and remote packages, including dependencies.


Installation instructions for the cabal-install command line tool
=================================================================

The `cabal-install` package requires a number of other packages, most of which
come with a standard ghc installation. It requires the `network` package, which
is sometimes packaged separately by Linux distributions, for example on
debian or ubuntu it is in "libghc6-network-dev".

It requires a few other Haskell packages that are not always installed:

 * Cabal  (version 1.8  or later)
 * HTTP   (version 4000 or later)
 * zlib   (version 0.4  or later)

All of these are available from [Hackage](http://hackage.haskell.org).

Note that on some Unix systems you may need to install an additional zlib
development package using your system package manager, for example on
debian or ubuntu it is in "zlib1g-dev". It is needed is because the
Haskell zlib package uses the system zlib C library and header files.

The `cabal-install` package is now part of the Haskell Platform so you do not
usually need to install it separately. However if you are starting from a
minimal ghc installation then you need to install `cabal-install` manually.
Since it is just an ordinary Cabal package it can be built in the standard
way, but to make it a bit easier we have partly automated the process:


Quickstart on Unix systems
--------------------------

As a convenience for users on Unix systems there is a `bootstrap.sh` script
which will download and install each of the dependencies in turn.

    $ ./bootstrap.sh

It will download and install the above three dependencies. The script will
install the library packages into `$HOME/.cabal/` and the `cabal` program will
be installed into `$HOME/.cabal/bin/`.

You then have two choices:

 * put `$HOME/.cabal/bin` on your `$PATH`
 * move the `cabal` program somewhere that is on your `$PATH`

The next thing to do is to get the latest list of packages with:

    $ cabal update

This will also create a default config file (if it does not already echo exist)
at `$HOME/.cabal/config`

By default cabal will install programs to `$HOME/.cabal/bin`. If you do not
want to add this directory to your `$PATH` then you can change the setting in
the config file, for example you could use:

    symlink-bindir: $HOME/bin


Quickstart on Windows systems
-----------------------------

For Windows users we provide a pre-compiled [cabal.exe] program. Just download
it and put it somewhere on your `%PATH%`, for example
`C:\Program Files\Haskell\bin`.

[cabal.exe]: http://haskell.org/cabal/release/cabal-install-latest/cabal.exe

The next thing to do is to get the latest list of packages with

    cabal update

This will also create a default config file (if it does not already echo exist)
at `C:\Documents and Settings\username\Application Data\cabal\config`


Using cabal-install
===================

There are two sets of commands: commands for working with a local project build
tree and ones for working with distributed released packages from hackage.

For a list of the full set of commands and the flags for each command see

    $ cabal --help


Commands for developers for local build trees
---------------------------------------------

The commands for local project build trees are almost exactly the same as the
`runghc Setup` command line interface that many people are already familiar
with. In particular there are the commands

    cabal configure
    cabal build
    cabal haddock
    cabal clean
    cabal sdist

The `install` command is somewhat different. It is an all-in-one operation. If
you run

    $ cabal install

in your build tree it will configure, build and install. It takes all the flags
that `configure` takes such as `--global` and `--prefix`.

In addition, if any dependencies are not installed it will download and install
them. If can also rebuild packages to ensure a consistent set of dependencies.


Commands for released hackage packages
--------------------------------------

    $ cabal update

This command gets the latest list of packages from the hackage server.
Currently this command has to be run manually occasionally, in particular if
you want to install a newly released package. 


    $ cabal install xmonad

This is the eponymous command. It installs one or more named packages (and all
their dependencies) from hackage.

By default it installs the latest available version however you can optionally
specify exact versions or version ranges. For example `cabal install alex-2.2`
or `cabal install parsec < 3`.

    $ cabal upgrade xmonad

This is a variation on the `install` command. Both mean to install the latest
version, the only difference is in the treatment of dependencies. The `install`
command tries to use existing installed versions of dependent packages while
the `upgrade` command tries to upgrade all the dependencies too.

    $ cabal list xml

This does a search of the installed and available packages. It does a
case-insensitive substring match on the package name.