package opam-format

  1. Overview
  2. Docs

Compiler version $opam/compilers/. Deprecated, only used to upgrade old data

include IO_FILE
type t

File contents

val format_version : OpamVersion.t
val empty : t

Empty file

val write : t typed_file -> t -> unit

Write some contents to a file

val read : t typed_file -> t

Read file contents. Raise an error if the file does not exist.

val read_opt : t typed_file -> t option

Returns None on non-existing file

val safe_read : t typed_file -> t

Read file contents. Return empty if the file does not exist.

val read_from_channel : ?filename:t typed_file -> in_channel -> t
val read_from_string : ?filename:t typed_file -> string -> t
val write_to_channel : ?filename:t typed_file -> out_channel -> t -> unit
val write_to_string : ?filename:t typed_file -> t -> string
type compiler = string
type compiler_version = string
val create_preinstalled : compiler -> compiler_version -> OpamTypes.name list -> OpamTypes.env_update list -> t

Create a pre-installed compiler description file

val preinstalled : t -> bool

Is it a pre-installed compiler description file

val opam_version : t -> OpamTypes.opam_version

Get OPAM version

val name : t -> compiler

Return the compiler name

val version : t -> compiler_version

Return the compiler version

val src : t -> OpamTypes.url option

Return the url of the compiler

val patches : t -> OpamTypes.url list

Return the list of patches to apply

val configure : t -> string list

Options to give to the "./configure" command

val make : t -> string list

Options to give to the "make" command

val build : t -> OpamTypes.command list

Options to give to build the package. If this one is provided, nothing should be specified for configure and make.

val packages : t -> OpamTypes.formula

Packages to install immediately after the creation of OCaml

val env : t -> OpamTypes.env_update list

Environment variable to set-up before running commands in the subtree

val tags : t -> string list
val with_src : OpamTypes.url option -> t -> t
val with_patches : OpamTypes.url list -> t -> t
val with_configure : string list -> t -> t
val with_make : string list -> t -> t
val with_build : OpamTypes.command list -> t -> t
val with_packages : OpamTypes.formula -> t -> t
val to_package : ?package:OpamTypes.package -> t -> Descr.t option -> OPAM.t

Converts a compiler definition to package metadata. For compat. If package is unspecified, a package named "ocaml" is created for "standard" compilers (when the compiler name doesn't contain a "+" and is equal to the compiler version); otherwise, a package "ocaml-VARIANT" is created with "VARIANT" the part of the compiler name on the right of the "+". In both case, the version corresponds to the OCaml version and is version comp.