Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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