I have a project, which offers different features in different git branches. I believe, this is mostly done to simplify external dependencies (that is someone who wants to work with sqlite will not depend on modules for mysql and so on). Unfortunately, the functionality I need does not reside in master.
Is there a way to tell OPAM to fetch the project from a specific branch when installing? If not how might it be possible to add such project into OPAM?
Your libraries are installed to the directory returned by opam var lib , which is by default ~/. opam/<switch>/lib .
opam switch set sets the default switch globally. The shell hook, when enabled, synchronises the current shell session with this switch, unless the current directory is a local switch, when that local switch is used instead.
Use opam switch <version> to switch to a different OCaml version, or opam switch <name> --alias-of <version> to name the new switch as you like. Don't forget to run the advertised eval $(opam config env) to update your PATH accordingly.
Use opam pin
. Put the branch name after a #
, e.g. to use my "checksum" branch of the OCaml tcpip
library instead of the upstream one:
$ opam pin tcpip https://github.com/talex5/mirage-tcpip.git#checksum
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With