Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 153 lines (98 sloc) 5.345 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
e59adcc @dcoutts Improve the README, better install instructions
dcoutts authored
20 It requires three other Haskell packages that are not always installed:
743181b @dcoutts Update the README file
dcoutts authored
21
d2af878 @dcoutts Update the README
dcoutts authored
22 * Cabal (version 1.6 or later)
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
e59adcc @dcoutts Improve the README, better install instructions
dcoutts authored
33 In future, cabal-install will be part of the Haskell Platform so will not need
34 to be installed separately. In the mean time however you have to install it
35 manually. Since it is just an ordinary Cabal package it can be built in the
36 standard way, but to make it a bit easier we have partly automated the process:
4edeb40 @donsbot updated license / readme
donsbot authored
37
38
e59adcc @dcoutts Improve the README, better install instructions
dcoutts authored
39 Quickstart on Unix systems
40 --------------------------
743181b @dcoutts Update the README file
dcoutts authored
41
a7594fd @dcoutts Clarify the instructions in the README and bootstrap.sh
dcoutts authored
42 As a convenience for users on Unix systems there is a `bootstrap.sh` script
43 which will download and install each of the dependencies in turn.
e59adcc @dcoutts Improve the README, better install instructions
dcoutts authored
44
45 $ ./bootstrap.sh
46
47 It will download and install the above three dependencies. The script will
48 install the library packages into `$HOME/.cabal/` and the `cabal` program will
49 be installed into `$HOME/.cabal/bin/`.
50
51 You then have two choices:
52
53 * put `$HOME/.cabal/bin` on your `$PATH`
a7594fd @dcoutts Clarify the instructions in the README and bootstrap.sh
dcoutts authored
54 * move the `cabal` program somewhere that is on your `$PATH`
55
56 The next thing to do is to get the latest list of packages with:
57
58 $ cabal update
59
60 This will also create a default config file (if it does not already echo exist)
61 at `$HOME/.cabal/config`
62
63 By default cabal will install programs to `$HOME/.cabal/bin`. If you do not
64 want to add this directory to your `$PATH` then you can change the setting in
65 the config file, for example you could use:
66
67 symlink-bindir: $HOME/bin
e59adcc @dcoutts Improve the README, better install instructions
dcoutts authored
68
69
70 Quickstart on Windows systems
71 -----------------------------
72
d2af878 @dcoutts Update the README
dcoutts authored
73 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
74 it and put it somewhere on your `%PATH%`, for example
75 `C:\Program Files\Haskell\bin`.
e59adcc @dcoutts Improve the README, better install instructions
dcoutts authored
76
d2af878 @dcoutts Update the README
dcoutts authored
77 [cabal.exe]: http://haskell.org/cabal/release/cabal-install-latest/cabal.exe
e59adcc @dcoutts Improve the README, better install instructions
dcoutts authored
78
a7594fd @dcoutts Clarify the instructions in the README and bootstrap.sh
dcoutts authored
79 The next thing to do is to get the latest list of packages with
80
81 cabal update
82
83 This will also create a default config file (if it does not already echo exist)
84 at `C:\Documents and Settings\username\Application Data\cabal\config`
85
e59adcc @dcoutts Improve the README, better install instructions
dcoutts authored
86
87 Using cabal-install
88 ===================
89
90 There are two sets of commands: commands for working with a local project build
91 tree and ones for working with distributed released packages from hackage.
92
93 For a list of the full set of commands and the flags for each command see
94
95 $ cabal --help
96
97
98 Commands for developers for local build trees
99 ---------------------------------------------
100
101 The commands for local project build trees are almost exactly the same as the
102 `runghc Setup` command line interface that many people are already familiar
103 with. In particular there are the commands
104
105 cabal configure
106 cabal build
107 cabal haddock
108 cabal clean
109 cabal sdist
110
111 The `install` command is somewhat different. It is an all-in-one operation. If
112 you run
113
114 $ cabal install
115
116 in your build tree it will configure, build and install. It takes all the flags
117 that `configure` takes such as `--global` and `--prefix`.
118
119 In addition, if any dependencies are not installed it will download and install
120 them. If can also rebuild packages to ensure a consistent set of dependencies.
121
122
123 Commands for released hackage packages
124 --------------------------------------
125
126 $ cabal update
127
128 This command gets the latest list of packages from the hackage server.
129 Currently this command has to be run manually occasionally, in particular if
130 you want to install a newly released package.
131
132
133 $ cabal install xmonad
134
135 This is the eponymous command. It installs one or more named packages (and all
136 their dependencies) from hackage.
137
138 By default it installs the latest available version however you can optionally
139 specify exact versions or version ranges. For example `cabal install alex-2.2`
140 or `cabal install parsec < 3`.
141
142 $ cabal upgrade xmonad
143
144 This is a variation on the `install` command. Both mean to install the latest
145 version, the only difference is in the treatment of dependencies. The `install`
146 command tries to use existing installed versions of dependent packages while
147 the `upgrade` command tries to upgrade all the dependencies too.
148
149 $ cabal list xml
150
151 This does a search of the installed and available packages. It does a
152 case-insensitive substring match on the package name.
Something went wrong with that request. Please try again.