oasis2opam icon indicating copy to clipboard operation
oasis2opam copied to clipboard

Where does <pkg>.install belongs?

Open gildor478 opened this issue 8 years ago • 2 comments

Forking the discussion on #29

For .install, the OPAM manual indeed [talks about that file] (https://opam.ocaml.org/doc/Manual.html#packagenameinstall) without expressing a clear preference. A discussion — somewhere on Github I think — made clear however that <pkg>.install files are not welcome in the opam-repository in order not to "pollute" everybody with extra files that may not be useful for them.

Not sure to understand where the .install should be ?

  1. in the upstream source? I don't see the use of it in there. Except for OPAM, it won't be useful (hence polluting the source).
  2. in the OPAM repository? I thought it was a good option. If you can point me to the right place for the mentioned discussion. that would be nice.

gildor478 avatar Dec 09 '16 08:12 gildor478

It is 1. See https://github.com/ocaml/oasis2opam/issues/24

An alternative may be to add commands to the opam file to preserve (and then remove) the files. If oasis2opam becomes a plugin, ocaml setup.ml -install -opam (or similar) could just generate an <pkg>.install file for opam to use.

Chris00 avatar Dec 09 '16 11:12 Chris00

You mean that we should generate a .install when we actually install the files in OPAM?

I think that is totally do-able with an "Extra" plugin (just like the "META" plugin).

If we do it this way, the user will have to add this to its _oasis file:

Plugins: oasis2opam (0.7), META (0.4)...

This will add some code in setup.ml that can generate a .install and some extra configure flags (--enable-opam-install).

The opam file generated need to invoke

$ ocaml setup.ml -configure --enable-opam-install

During the install, it will generate an extra .install that can be used to uninstall (if I understand correctly).

I think in this case, you don't have to move setup.* into etc and you can focus on only what has been installed.

N.B: this kind of plugin is an OASIS plugin (activated inside _oasis, rather than on command line).

gildor478 avatar Dec 09 '16 12:12 gildor478