[opam-devel] Generating .install file

Daniel Bünzli daniel.buenzli at erratique.ch
Fri Jul 26 02:07:28 BST 2013


Le lundi, 8 juillet 2013 à 13:23, Daniel Bünzli a écrit :
> Yes it's hand written, I don't care, at least it's very explicit. It uses the functions of this *trivial* package-independent script:
>  
> https://github.com/dbuenzli/vg/blob/master/pkg/pkg-builder
I have improved that script to support all the new opam install sections. It can be found in this git repo:

https://github.com/dbuenzli/pkgopkg/blob/master/pkg/pkg-builder

which aggregates package development/publication tools I used to copy around in my packages. Note that a fun (haha) property of that repo is that it's both an opam repository and an opam package -- this allows me to quickly get my tools in an opam install.

A non trivial (but still pure ocaml) example of usage can be found here:

https://github.com/dbuenzli/webglue/blob/master/pkg/build

This project has a command line tool, an api, dynamically loaded plugins all build via ocamlbuild. Man pages are defined via cmdliner and the plugins themselves add man pages to the tool. Thus these pages can only be extracted once the tool and the plugin have been built.  

A call to `pkg/build true` builds the project and generates this [1] install file.  

Best,

Daniel

[1]

opam-version: "1"
lib: [
"_build/pkg/META" {"META"}
"_build/src/api/wg.mli" {"wg.mli"}
"_build/src/api/wg.cmi" {"wg.cmi"}
"_build/src/api/wg.cmx" {"wg.cmx"}
"_build/src/api/wg.cmxa" {"wg.cmxa"}
"_build/src/api/wg.cmxs" {"wg.cmxs"}
"_build/src/formats/w_css.cmxs" {"w_css.cmxs"}
"_build/src/formats/w_text.cmxs" {"w_text.cmxs"}
"_build/src/formats/w_files.cmxs" {"w_files.cmxs"}
"_build/src/formats/w_timestamp.cmxs" {"w_timestamp.cmxs"}
"_build/src/formats/w_sitemap.cmxs" {"w_sitemap.cmxs"}
"_build/src/formats/w_xml.cmxs" {"w_xml.cmxs"}
]
bin: [
"_build/src/tool/webglue.native" {"webglue"}
]
toplevel: [
]
share: [
"_build/share/dotemacs" {"dotemacs"}
"_build/share/example/home.map" {"example/home.map"}
"_build/share/example/locale-menus.map" {"example/locale-menus.map"}
"_build/share/example/text.map" {"example/text.map"}
]
doc: [
"_build/README.md" {"README.md"}
"_build/CHANGES.md" {"CHANGES.md"}
]
misc: [
]
stublibs: [
]
man: [
"_build/webglue.1" {"man1/webglue.1"}
"_build/webglue-content.1" {"man1/webglue-content.1"}
"_build/webglue-diagnose.1" {"man1/webglue-diagnose.1"}
"_build/webglue-get.1" {"man1/webglue-get.1"}
"_build/webglue-help.1" {"man1/webglue-help.1"}
"_build/webglue-set.1" {"man1/webglue-set.1"}
"_build/webglue-show.1" {"man1/webglue-show.1"}
"_build/webglue-uriset.1" {"man1/webglue-uriset.1"}
"_build/webglue- at -text.7" {"man7/webglue- at -text.7"}
"_build/webglue-directives.7" {"man7/webglue-directives.7"}
"_build/webglue-formats.5" {"man5/webglue-formats.5"}
"_build/webglue-s-expressions.5" {"man5/webglue-s-expressions.5"}
"_build/webglue-standard-uris.7" {"man7/webglue-standard-uris.7"}
"_build/w.css.5" {"man5/w.css.5"}
"_build/w.files.5" {"man5/w.files.5"}
"_build/w.map.5" {"man5/w.map.5"}
"_build/w.sitemap.5" {"man5/w.sitemap.5"}
"_build/w.text.5" {"man5/w.text.5"}
"_build/w.timestamp.5" {"man5/w.timestamp.5"}
"_build/w.xml.5" {"man5/w.xml.5"}
]









More information about the opam-devel mailing list