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