package b0

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module B0_opamSource

opam support.

See the b0 b0 opam manual for more details.

opam

Sourcetype t

The type for opam.

Sourceval get : ?search:B0_std.Cmd.tool_search -> ?cmd:B0_std.Cmd.t -> unit -> (t, string) result

get ~search cmd () looks for the opam command cmd (defaults to Cmd.tool "opam") in search (defaults to Os.Cmd.get ?search).

opam files

Sourcemodule File : sig ... end

opam file generation.

Metadata

These metadata keys can be specified to define opam file fields. Some of the metadata is covered by standard keys. The full map is documented in File.pkg_of_meta.

Sourcetype pkg_spec = string * string

The type for package specifications. A package name and a filtered package formula, use "" if you don't have any constraint.

Sourceval tag : bool B0_meta.key

tag indicates the entity is related to opam. Adding this tag to a pack makes it represent an opam package for b0's opam tooling.

Sourceval available : string B0_meta.key

available is an opam available: field value. This is a raw string in opam sntax that defines the whole field.

Sourceval build : string B0_meta.key

build is an opam build: field value. This is a raw string in opam syntax that defines the whole field. Used to override automatic opam file generation, see pkg_meta_of_pack.

Sourceval build_env : string B0_meta.key

build_env is an opam build-env: field value. This a raw string in opam syntax that defines the whole field.

Sourceval depends : pkg_spec list B0_meta.key

depends is an opam depends: field value. Used to override automatic opam file dependency generation, see pkg_meta_of_pack.

Sourceval depopts : pkg_spec list B0_meta.key

depopts is an opam depopts: field value.

Sourceval conflicts : pkg_spec list B0_meta.key

conflicts is an opam conflicts: field value.

Sourceval file_addendum : File.t B0_meta.key

file_addendum is an opam file fragment appended at the end of a generated opam file. See B0_opam.File.pkg_of_meta.

Sourceval install : string B0_meta.key

install is an opam install: field value. This is a raw string in opam syntax that defines the whole field. Used to override automatic opam file generation, see pkg_meta_of_pack.

Sourceval name : string B0_meta.key

name is an opam name: field value. Use to override automatic opam package name generation, see pkg_meta_of_pack.

Sourceval pin_depends : (string * string) list B0_meta.key

pin_depends is an opam pin-depends: field value.

Sourceval x_maintenance_intent : string list B0_meta.key

x_maintenance_intent is an x-maintenance-intent: field value.

Package derivation

Sourceval pkg_name_of_pack : B0_pack.t -> string

pkg_name_of_pack p derives an opam package name for p. This is either in order:

  1. The name field of p's meta, if defined.
  2. The B0_pack.basename of p if not equal to "default".
  3. The basename of p's scope directory.
Sourceval pkg_meta_of_pack : B0_pack.t -> B0_meta.t

pkg_meta_of_pack p is opam package metadata for pack p ready to be used with File.pkg_of_meta to derive an opam package file.

This is p's metadata with the following fields added if they are unspecified:

.opam unit

Sourceval unit : B0_unit.t

unit is the unit of the .opam action.

See b0 -- .opam --help and the b0 opam manual for more information.