Module Topkg_opam.Install

opam install file.

A module to generate opam install files.

Reference. Syntax and semantics of opam install files.

opam install files

type field = [
  1. | `Bin
  2. | `Doc
  3. | `Etc
  4. | `Lib
  5. | `Lib_root
  6. | `Libexec
  7. | `Libexec_root
  8. | `Man
  9. | `Misc
  10. | `Sbin
  11. | `Share
  12. | `Share_root
  13. | `Stublibs
  14. | `Toplevel
  15. | `Unknown of string
]

The type for opam install file fields.

type move

The type for file moves.

val move : ?maybe:bool -> ?dst:Topkg_fpath.t -> Topkg_fpath.t -> move

move ~maybe ~dst src moves src to dst, where dst is a path relative to the directory corresponding to the field. If maybe is true (defaults to false), then src may not exist, otherwise an install error will occur if the file doesn't exist.

type t = [ `Header of string option ] * (field * move) list

The type for opam install files. An optional starting header comment and a list of field moves.

val to_string : t -> string

to_string t is t as syntactically valid opam install file.