On Mon, Dec 9, 2013 at 10:04 AM, Daniel Bünzli <daniel.buenzli@erratique.ch> wrote:
Le dimanche, 8 décembre 2013 à 21:55, Anthony Tavener a écrit :
> Is there a simple example of an appropriate install process suitable for use with OPAM? I've tried looking at a few existing packages and the build+install process, as usual, is convoluted... not as obscure as autotools, but different for each project. Is findlib still applicable? Or some other means to query the system install directory?


For my packages I now generate an opam .install file at the root of the distribution. This .install file indicates the type of build artefacts you generated and where they are located. This lets opam figure out where it should put that. The advantage over using `findlib install` is that it also support installing binaries, man pages, documentation, configuration files, etc. Note that you still want your users to be able to use findlib for using your package so be sure to also install a META file (no need to use `findlib install` for that).



hi

Opam's .install files should be used only to fix packages whose installation is already broken or unsufficient, shouldn't it?

If you rely *only* on the .install, your package can be installed only with opam, it will break for other users (GODI, WODI, Manual Package Management™, etc.).
I think it's good hygiene to at least provide an ocamlfind-based installation of the libraries.


Cheers
Seb




 
At the moment for achieving this I use a very simple build script [2] that allows you to describe what you want (see [3]), builds what you describe with ocamlbuild and generates a corresponding .install file. The resulting opam file for this example is here [4] (the pkg-git invocation is for massaging the checkout when you pin the package).

Best,

Daniel

[1] See section 2.2.3 in https://github.com/OCamlPro/opam/raw/master/doc/dev-manual/dev-manual.pdf
[2] https://github.com/dbuenzli/xmlm/blob/master/pkg/pkg-builder
[3] https://github.com/dbuenzli/xmlm/blob/master/pkg/build
[4] https://github.com/dbuenzli/xmlm/blob/master/opam


--
Caml-list mailing list.  Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs