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