OpamFile.OPAMSourceOPAM files
type t = private {opam_version : OpamTypes.opam_version;name : OpamTypes.name option;version : OpamTypes.version option;depends : OpamTypes.filtered_formula;depopts : OpamTypes.filtered_formula;conflicts : OpamTypes.filtered_formula;conflict_class : OpamTypes.name list;available : OpamTypes.filter;flags : OpamTypes.package_flag list;env : (OpamTypes.spf_unresolved, OpamTypes.euok_writeable) OpamTypes.env_update
list;build : OpamTypes.command list;run_test : OpamTypes.command list;install : OpamTypes.command list;remove : OpamTypes.command list;substs : OpamTypes.basename list;patches : (OpamTypes.basename * OpamTypes.filter option) list;build_env : (OpamTypes.spf_unresolved, OpamTypes.euok_writeable)
OpamTypes.env_update
list;features : (OpamVariable.t * OpamTypes.filtered_formula * string) list;extra_sources : (OpamTypes.basename * URL.t) list;messages : (string * OpamTypes.filter option) list;post_messages : (string * OpamTypes.filter option) list;depexts : (OpamSysPkg.Set.t * OpamTypes.filter) list;libraries : (string * OpamTypes.filter option) list;syntax : (string * OpamTypes.filter option) list;dev_repo : OpamTypes.url option;pin_depends : (OpamTypes.package * OpamTypes.url) list;maintainer : string list;license : string list;homepage : string list;doc : string list;bug_reports : string list;extensions : OpamParserTypes.FullPos.value OpamStd.String.Map.t;url : URL.t option;descr : Descr.t option;metadata_dir : (OpamTypes.repository_name option * string) option;extra_files : (OpamFilename.Base.t * OpamHash.t) list option;locked : string option;format_errors : (string * OpamPp.bad_format) list;ocaml_version : (OpamFormula.relop * string) OpamFormula.formula option;os : (bool * string) OpamTypes.generic_formula;deprecated_build_test : OpamTypes.command list;deprecated_build_doc : OpamTypes.command list;}Create an opam file
Returns the opam value (including url, descr) with all non-effective (i.e. user-directed information that doesn't change opam's view on the package) fields set to their empty values. Useful for comparisons.
Returns true if the effective parts of the two package definitions are equal.
Compares two package definitions, ignoring the virtual fields bound to file location (metadata_dir...)
Prints the format errors that were found when the file was read
Get OPAM version.
Package name
Package version
The informations in both the name and version fields, as a package
Availability formula (OS + compiler constraints)
File substitutions
val build_env :
t ->
(OpamTypes.spf_unresolved, [> OpamTypes.euok_writeable ])
OpamTypes.env_update
listList of environment variables to set-up for the build
List of command to run for building the package
List of command to run for installing the package
List of command to run for removing the package
Package dependencies
Optional dependencies
External dependencies
All extended "x-" fields as a map
Parse a single extended field (reports proper file position)
Package conflicts
Contents of the 'features' field
List of exported libraries
List of exported syntax extensions
Patches
Commands to build and run the tests
Commands to build the documentation
Commands to build the tests
Messages to display before taking action
Messages to display at end of install
The package flags that are present for this package.
Check the package for the given flag. Allows flags specified through tags for compatibility
val env :
t ->
(OpamTypes.spf_unresolved, [> OpamTypes.euok_writeable ])
OpamTypes.env_update
listThe environment variables that this package exports
Related metadata directory (either repository name + relative path, or absolute path; not an actual field of the file, linked to the file location). This can be used to locate e.g. the files/ overlays
val get_metadata_dir :
repos_roots:(OpamTypes.repository_name -> OpamTypes.dirname) ->
t ->
OpamTypes.dirname optionGets the resolved metadata dir, given a mapping of repository names to their roots
Names and hashes of the files below files/
val get_extra_files :
repos_roots:(OpamTypes.repository_name -> OpamTypes.dirname) ->
t ->
(OpamTypes.filename * OpamTypes.basename * OpamHash.t) listLooks up the extra files, and returns their full paths, relative path to the package source, and hash. Doesn't check the hashes.
Returns the errors that were found when parsing the file, associated to their fields (that were consequently ignored)
Sets the opam version
The package source repository address
construct as name
construct as version
Construct as depends
Construct as depopts
Construct as build
Construct as remove
Construct as libraries
Replace the syntax field of the given OPAM file.
Construct as substs
val with_build_env :
(OpamTypes.spf_unresolved, OpamTypes.euok_writeable) OpamTypes.env_update
list ->
t ->
tConstruct as patches
Construct using depexts
val with_env :
(OpamTypes.spf_unresolved, OpamTypes.euok_writeable) OpamTypes.env_update
list ->
t ->
tIf synopsis is not already set, split the string and use the first line as synopsis.
val to_string_with_preserved_format :
?format_from:t typed_file ->
?format_from_string:string ->
t typed_file ->
t ->
stringPrints to a string, while keeping the format of the original file as much as possible. The original format is read from the given format_from_string, the file format_from, or the output file if it exists
val write_with_preserved_format :
?format_from:t typed_file ->
?format_from_string:string ->
t typed_file ->
t ->
unitWrites an opam file, but preserving the existing formatting as much as possible. The original format is read from the given format_from_string, the file format_from, or the output file if it exists
Low-level values used for linting and similar processing
Allow 'flag:xxx' tags as flags, for compat
val sections :
(t, (string option * OpamParserTypes.FullPos.opamfile_item list) list)
OpamFormat.I.fields_defDoesn't handle package name encoded in directory name
Returns the raw print-AST contents of the file
Returns all fields of the file as print-AST. Fields within sections are accessed through dot-separated paths (e.g. url.checksum)
Gets the print-AST for a single field in the file structure. Fields within sections can be accessed through section.field.
x-field name for path rewriting on windows