How to install
Install with opam
If drom
is available in your opam repository, you can just call:
opam install drom
Build and install with dune
Checkout the sources of drom
in a directory.
You need a switch with at least version 4.07.0
of OCaml,
you can for example create it with:
opam switch create 4.10.0
Then, you need to install all the dependencies:
opam install --deps-only .
Finally, you can build the package and install it:
eval $(opam env)
dune build
dune install
Note that a Makefile
is provided, it contains the following
targets:
build
: build the codeinstall
: install the generated filesbuild-deps
: install opam dependenciessphinx
: build sphinx documentation (from thesphinx/
directory)dev-deps
: build development dependencies, in particularocamlformat
,odoc
andmerlin
doc
: build documentation withodoc
fmt
: format the code usingocamlformat
test
: run tests
Installing drom
globally
There are two recommendend approaches to using drom globally.
User profile shell function
The simplest way to use drom
globally is through a shell
function.
function drom () {
opam config exec --switch=SWITCH -- drom "$@";
}
The value for SWITCH
can easily be obtained via
opam switch -s show
.
Global binary
To be installed globally, drom
will need to locate its data
files, in particular its skeleton and license files. This files are
usually installed in $OPAM_SWITCH_PREFIX/share/drom
when
drom
is installed through opam
.
Once you have copied drom
executable in a global location
(/usr/local/bin/drom
for example), you should do one of these
two actions:
Set the
DROM_SHARE_DIR
environment variable to the location to the share dir containing its files ($HOME/.opam/4.10.0/share/drom
for example ifdrom
was installed in switch4.10.0
)Edit
$HOME/.config/drom/config
and define theshare-dir
option. For example:share-dir = "/home/user/.opam/4.10.0/share/drom"
Note
On MacOS the configuration file is can be found in the following location:
$HOME/Library/Application Support/com.ocamlpro.drom/config
Note that you can also copy drom
’s share directory to a global
location if don’t want the files to be removed accidentally by an
opam
operation.