[opam-devel] specifying environment variables in opam package

Louis Gesbert louis.gesbert at ocamlpro.com
Sat Apr 16 03:56:30 BST 2016


Le vendredi 15 avril 2016, 14:33:15 Ashish Agarwal a écrit :
> I noticed that opam sets PERL5LIB. Can someone explain why.

The answer is here: https://github.com/ocaml/opam/pull/755

> I actually need
> to add to this path when a certain package is installed. Does opam allow
> that?

Opam 2.0 does! ☺
There is a new `setenv:` field, which follows the same syntax as the old comp 
file `env:` field. It is a list of environment updates as documented at:
  http://opam.ocaml.org/doc/Manual.html#Environmentupdates

Packages depending on this package should properly see the new environment 
variable, and the user will be prompted to re-run `eval $(opam config env)` on 
changes.


More information about the opam-devel mailing list