Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 154 lines (99 sloc) 5.408 kB
e59adcc @dcoutts Improve the README, better install instructions
dcoutts authored
1 The cabal-install package
2 =========================
4edeb40 @donsbot updated license / readme
donsbot authored
3
e59adcc @dcoutts Improve the README, better install instructions
dcoutts authored
4 [Cabal home page](http://www.haskell.org/cabal/)
4edeb40 @donsbot updated license / readme
donsbot authored
5
e59adcc @dcoutts Improve the README, better install instructions
dcoutts authored
6 The `cabal-install` package provides a command line tool called `cabal`. The
7 tool uses the `Cabal` library and provides a convenient user interface to the
8 Cabal/Hackage package build and distribution system. It can build and install
9 both local and remote packages, including dependencies.
4edeb40 @donsbot updated license / readme
donsbot authored
10
11
e59adcc @dcoutts Improve the README, better install instructions
dcoutts authored
12 Installation instructions for the cabal-install command line tool
13 =================================================================
743181b @dcoutts Update the README file
dcoutts authored
14
e59adcc @dcoutts Improve the README, better install instructions
dcoutts authored
15 The `cabal-install` package requires a number of other packages, most of which
16 come with a standard ghc installation. It requires the `network` package, which
17 is sometimes packaged separately by Linux distributions, for example on
18 debian or ubuntu it is in "libghc6-network-dev".
743181b @dcoutts Update the README file
dcoutts authored
19
5e8d120 @dcoutts Update the README
dcoutts authored
20 It requires a few other Haskell packages that are not always installed:
743181b @dcoutts Update the README file
dcoutts authored
21
5e8d120 @dcoutts Update the README
dcoutts authored
22 * Cabal (version 1.8 or later)
d2af878 @dcoutts Update the README
dcoutts authored
23 * HTTP (version 4000 or later)
24 * zlib (version 0.4 or later)
743181b @dcoutts Update the README file
dcoutts authored
25
e59adcc @dcoutts Improve the README, better install instructions
dcoutts authored
26 All of these are available from [Hackage](http://hackage.haskell.org).
743181b @dcoutts Update the README file
dcoutts authored
27
a5caf11 @dcoutts Note in the README that zlib needs the zlib C lib package
dcoutts authored
28 Note that on some Unix systems you may need to install an additional zlib
a7594fd @dcoutts Clarify the instructions in the README and bootstrap.sh
dcoutts authored
29 development package using your system package manager, for example on
30 debian or ubuntu it is in "zlib1g-dev". It is needed is because the
a5caf11 @dcoutts Note in the README that zlib needs the zlib C lib package
dcoutts authored
31 Haskell zlib package uses the system zlib C library and header files.
32
5e8d120 @dcoutts Update the README
dcoutts authored
33 The `cabal-install` package is now part of the Haskell Platform so you do not
34 usually need to install it separately. However if you are starting from a
35 minimal ghc installation then you need to install `cabal-install` manually.
36 Since it is just an ordinary Cabal package it can be built in the standard
37 way, but to make it a bit easier we have partly automated the process:
4edeb40 @donsbot updated license / readme
donsbot authored
38
39
e59adcc @dcoutts Improve the README, better install instructions
dcoutts authored
40 Quickstart on Unix systems
41 --------------------------
743181b @dcoutts Update the README file
dcoutts authored
42
a7594fd @dcoutts Clarify the instructions in the README and bootstrap.sh
dcoutts authored
43 As a convenience for users on Unix systems there is a `bootstrap.sh` script
44 which will download and install each of the dependencies in turn.
e59adcc @dcoutts Improve the README, better install instructions
dcoutts authored
45
46 $ ./bootstrap.sh
47
48 It will download and install the above three dependencies. The script will
49 install the library packages into `$HOME/.cabal/` and the `cabal` program will
50 be installed into `$HOME/.cabal/bin/`.
51
52 You then have two choices:
53
54 * put `$HOME/.cabal/bin` on your `$PATH`
a7594fd @dcoutts Clarify the instructions in the README and bootstrap.sh
dcoutts authored
55 * move the `cabal` program somewhere that is on your `$PATH`
56
57 The next thing to do is to get the latest list of packages with:
58
59 $ cabal update
60
61 This will also create a default config file (if it does not already echo exist)
62 at `$HOME/.cabal/config`
63
64 By default cabal will install programs to `$HOME/.cabal/bin`. If you do not
65 want to add this directory to your `$PATH` then you can change the setting in
66 the config file, for example you could use:
67
68 symlink-bindir: $HOME/bin
e59adcc @dcoutts Improve the README, better install instructions
dcoutts authored
69
70
71 Quickstart on Windows systems
72 -----------------------------
73
d2af878 @dcoutts Update the README
dcoutts authored
74 For Windows users we provide a pre-compiled [cabal.exe] program. Just download
a7594fd @dcoutts Clarify the instructions in the README and bootstrap.sh
dcoutts authored
75 it and put it somewhere on your `%PATH%`, for example
76 `C:\Program Files\Haskell\bin`.
e59adcc @dcoutts Improve the README, better install instructions
dcoutts authored
77
d2af878 @dcoutts Update the README
dcoutts authored
78 [cabal.exe]: http://haskell.org/cabal/release/cabal-install-latest/cabal.exe
e59adcc @dcoutts Improve the README, better install instructions
dcoutts authored
79
a7594fd @dcoutts Clarify the instructions in the README and bootstrap.sh
dcoutts authored
80 The next thing to do is to get the latest list of packages with
81
82 cabal update
83
84 This will also create a default config file (if it does not already echo exist)
85 at `C:\Documents and Settings\username\Application Data\cabal\config`
86
e59adcc @dcoutts Improve the README, better install instructions
dcoutts authored
87
88 Using cabal-install
89 ===================
90
91 There are two sets of commands: commands for working with a local project build
92 tree and ones for working with distributed released packages from hackage.
93
94 For a list of the full set of commands and the flags for each command see
95
96 $ cabal --help
97
98
99 Commands for developers for local build trees
100 ---------------------------------------------
101
102 The commands for local project build trees are almost exactly the same as the
103 `runghc Setup` command line interface that many people are already familiar
104 with. In particular there are the commands
105
106 cabal configure
107 cabal build
108 cabal haddock
109 cabal clean
110 cabal sdist
111
112 The `install` command is somewhat different. It is an all-in-one operation. If
113 you run
114
115 $ cabal install
116
117 in your build tree it will configure, build and install. It takes all the flags
118 that `configure` takes such as `--global` and `--prefix`.
119
120 In addition, if any dependencies are not installed it will download and install
121 them. If can also rebuild packages to ensure a consistent set of dependencies.
122
123
124 Commands for released hackage packages
125 --------------------------------------
126
127 $ cabal update
128
129 This command gets the latest list of packages from the hackage server.
130 Currently this command has to be run manually occasionally, in particular if
131 you want to install a newly released package.
132
133
134 $ cabal install xmonad
135
136 This is the eponymous command. It installs one or more named packages (and all
137 their dependencies) from hackage.
138
139 By default it installs the latest available version however you can optionally
140 specify exact versions or version ranges. For example `cabal install alex-2.2`
141 or `cabal install parsec < 3`.
142
143 $ cabal upgrade xmonad
144
145 This is a variation on the `install` command. Both mean to install the latest
146 version, the only difference is in the treatment of dependencies. The `install`
147 command tries to use existing installed versions of dependent packages while
148 the `upgrade` command tries to upgrade all the dependencies too.
149
150 $ cabal list xml
151
152 This does a search of the installed and available packages. It does a
153 case-insensitive substring match on the package name.
Something went wrong with that request. Please try again.