ocaml / opam

opam is a source-based package manager. It supports multiple simultaneous compiler installations, flexible package constraints, and a Git-friendly development workflow.
https://opam.ocaml.org
Other
1.23k stars 350 forks source link

Feature Request: elvish support #3270

Open brabalan opened 6 years ago

brabalan commented 6 years ago

I use the elvish shell (https://elvish.io/) and I currently manually this code to set up my environment:

paths = [~/.opam/4.04.0/bin ~/bin /usr/local/bin /usr/bin /bin /usr/sbin /sbin]

E:CAML_LD_LIBRARY_PATH = /Users/schmitta/.opam/4.04.0/lib/stublibs
E:OPAMUTF8MSGS = 1
E:MANPATH = /Users/schmitta/.opam/4.04.0/man:
E:PERL5LIB = /Users/schmitta/.opam/4.04.0/lib/perl5
E:OCAML_TOPLEVEL_PATH = /Users/schmitta/.opam/4.04.0/lib/toplevel

Is it difficult to tweak opam config env to support this format?

dra27 commented 6 years ago

Supporting new shells is pretty straightforward, yes - would you like to have a go at a patch (either @AltGr or I happy to provide more pointers on where the changes need to go, but it's essentially adding a constructor to a type and then updating various match clauses)

brabalan commented 6 years ago

@dra27 I'd gladly give it a try, and I would happily have pointers to places to change. Should the PR be based on master?

rjbou commented 6 years ago

@brabalan Yes, PRs are based on master.

You can find two entrypoints for new shell support: OpamStd and OpamEnv. For needed external scripts files (copied in ~/.opam/opam-init/), they are here and you should add the in OpamScript like in this this commit.