Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 160 lines (110 sloc) 4.027 kb
1a66463 @samoht Update README
samoht authored
1 # OPAM - A package manager for OCaml
3656b4d First commit
Fabrice Le Fessant authored
2
c5b08a5 @samoht Update README.md
samoht authored
3 OPAM is a package manager for OCaml, based on the
fd60381 @rdicosmo Fixed attibution for CUDF and DOSE
rdicosmo authored
4 [CUDF](http://mancoosi.org/cudf/) and the
5 [Dose](http://www.mancoosi.org/software/) libraries developped by the
6 [Mancoosi](http://www.mancoosi.org/) project, which are, among other
6bec3e9 @samoht Update master
samoht authored
7 things, used by Debian to manage their packages.
c5b08a5 @samoht Update README.md
samoht authored
8
9 ### Prerequisites:
f247b50 @samoht Update README
samoht authored
10
2ea165b @samoht Bump version to 0.3.2
samoht authored
11 * ocaml
17e1839 @samoht Update README.md
samoht authored
12 * curl or wget
cdb7aa8 @samoht Fix git and server backends
samoht authored
13 * git
14 * rsync
a7ec30c @tuong At upload time, the archive is sent everytime now.
tuong authored
15
c5b08a5 @samoht Update README.md
samoht authored
16 ### Compiling OPAM
84f4fc3 @samoht Update README.md
samoht authored
17
29a6804 @samoht Add install instructions
samoht authored
18 To compile `opam`, simply run:
f247b50 @samoht Update README
samoht authored
19
7600e90 @samoht Update README
samoht authored
20 ```
e82dec8 Updated README.md, deleting un-needed dependency to ocamlfind
Vincent Bernardoff authored
21 $ ./configure # (or ./configure --prefix=$HOME if you want to install under your $HOME)
17e1839 @samoht Update README.md
samoht authored
22 $ make
7600e90 @samoht Update README
samoht authored
23 ```
3656b4d First commit
Fabrice Le Fessant authored
24
6bec3e9 @samoht Update master
samoht authored
25 This will fetch the necessary archives if they are not already
26 downloaded and then build OPAM. If you just want to get the
27 necessary dependencies without compiling the project, run
28 `make clone`.
fb6191e @samoht Update README.md
samoht authored
29
17e1839 @samoht Update README.md
samoht authored
30 If you don't have `curl` installed on your system, you can run
31 `make FETCH=wget clone` before `make`.
32
29a6804 @samoht Add install instructions
samoht authored
33 ### Installing OPAM
34
e82dec8 Updated README.md, deleting un-needed dependency to ocamlfind
Vincent Bernardoff authored
35 To install opam simply run:
29a6804 @samoht Add install instructions
samoht authored
36
37 ```
e82dec8 Updated README.md, deleting un-needed dependency to ocamlfind
Vincent Bernardoff authored
38 $ make install
29a6804 @samoht Add install instructions
samoht authored
39 ```
40
e82dec8 Updated README.md, deleting un-needed dependency to ocamlfind
Vincent Bernardoff authored
41 or
29a6804 @samoht Add install instructions
samoht authored
42
43 ```
e82dec8 Updated README.md, deleting un-needed dependency to ocamlfind
Vincent Bernardoff authored
44 $ sudo make install
29a6804 @samoht Add install instructions
samoht authored
45 ```
46
e82dec8 Updated README.md, deleting un-needed dependency to ocamlfind
Vincent Bernardoff authored
47 if you need root privileges.
48
49 This way, opam binaries will be installed in `$prefix/bin`, where
50 prefix might have been specified during the ./configure phase.
d6ceb9f Modified README.md to reflect the changes in the Makefile
Vincent Bernardoff authored
51
c5b08a5 @samoht Update README.md
samoht authored
52 ### Using opam
7f510c5 @samoht Few makefile tweaks
samoht authored
53
c5b08a5 @samoht Update README.md
samoht authored
54 All of the OPAM state is held in the `~\.opam` directory in your home
55 directory, including compiler installations. You should never need to
56 switch to a root user to install packages. Package listings are
291de24 @samoht Update master
samoht authored
57 obtained through remote sources.
7f510c5 @samoht Few makefile tweaks
samoht authored
58
59 ```
17e1839 @samoht Update README.md
samoht authored
60 $ opam init
61 $ eval `opam config -env`
7600e90 @samoht Update README
samoht authored
62 ```
63
c5b08a5 @samoht Update README.md
samoht authored
64 The first command creates `~\.opam` and set-up `opam.ocamlpro.com` as
17e1839 @samoht Update README.md
samoht authored
65 default repository.
d222c5b @tuong [doc] update README and API
tuong authored
66 The second command updates your local environment
c5b08a5 @samoht Update README.md
samoht authored
67 to use the packages installed by OPAM. For convenience, you can add
68 this line in your `~/.profile`.
7600e90 @samoht Update README
samoht authored
69
70 ```
17e1839 @samoht Update README.md
samoht authored
71 $ opam list
7f510c5 @samoht Few makefile tweaks
samoht authored
72 ```
e04535c @samoht Add API documentation
samoht authored
73
c5b08a5 @samoht Update README.md
samoht authored
74 As expected, this command lists all the available packages. We can now
75 install some packages (for instance `lwt`):
e04535c @samoht Add API documentation
samoht authored
76
c5b08a5 @samoht Update README.md
samoht authored
77 ```
17e1839 @samoht Update README.md
samoht authored
78 $ opam install lwt
79 ```
80
81 OPAM is able to track optional dependencies. This mean that installing an
82 optional dependency of a package will recompile the package and all its
83 forward dependencies. For instance:
84
85 ```
b054136 @avsm fix typo in README
avsm authored
86 $ opam install react
17e1839 @samoht Update README.md
samoht authored
87 ```
88
89 will install `react`, will recompile `lwt` (with the right `./configure` options)
90 and all the packages which depend on `lwt`.
91
92
93 ### Installing on other OCaml compiler
94
95 OPAM also manages meta-data about OCaml compilers. So in order to install a new version
96 of the compiler, you can run:
97
98 ```
99 $ opam switch 4.00.0
100 $ eval `opam config -env`
101 ```
102
103 The first command will download and install ocaml-4.00.0, and the second command will
104 update the environment variables. You can then install packages -- they will be installed
105 on a different under `~/.opam/4.00.0`.
106
107 In order to come-back to the system-wide OCaml installation, simply run:
108
109 ```
110 $ opam switch system
111 $ eval `opam config -env`
c5b08a5 @samoht Update README.md
samoht authored
112 ```
7600e90 @samoht Update README
samoht authored
113
17e1839 @samoht Update README.md
samoht authored
114 You can use `opam switch -list` to display the list of available compilers.
115
116 ### Version pinning
117
118 ```
119 $ opam pin <package> </local/path>
120 ```
121
122 This command will use the content of `</local/path>` to compile `<package>`. This means
123 that the next time you will do `opam install <package>`, the compilation process will be
124 using a mirror of `</local/path>` instead of downloading the archive. This also means that
125 any modification to `</local/path>` will be picked up by `opam update`, and thus `opam upgrade`
126 will recompile `<package>` (and its forward dependencies) if needed.
127
128 To unpin a package, simply run:
129
130 ```
131 $ opam pin <package> none
132 ```
133
134 You can also pin a package to a specific version: `opam pin <package> <version>`
135
136 ### Repositories
137
138 OPAM supports multiple repositories.
139
140 ```
141 $ opam remote -list
142 ```
143
5ca91df @samoht Add auto-completion scripts
samoht authored
144 ### Auto-completion
145
146 `shell/` contains shell-scripts to add auto-completion to OPAM. The script is not
147 installed by default, so to activate the mode you can either:
148
149 * move it at the right location (depending on your OS, for instance
150 `/etc/auto-complete.d/opam` on Debian)
151
152 * copy it somewhere in you path and source it in your `.profile`.
17e1839 @samoht Update README.md
samoht authored
153
7600e90 @samoht Update README
samoht authored
154 ## Documentation
e04535c @samoht Add API documentation
samoht authored
155
67680ab Fixed a typo in README.md
Vincent Bernardoff authored
156 Some technical documentation is available in `doc`:
c5b08a5 @samoht Update README.md
samoht authored
157
158 * the API is available in `doc/html/`
159 * The design documents are available in `doc/specs/`
Something went wrong with that request. Please try again.