package oasis

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

Package definition

This module contains all the types used to build an OASIS package. A package is described by an '_oasis' file.

  • author Sylvain Le Gall

Aliases

type name = string

Standard name.

type package_name = string

Standard name.

Name of a package, see package.

type url = string

Name of a package, see package.

Standard URL.

type unix_dirname = string

Standard URL.

UNIX directory name.

type unix_filename = string

UNIX directory name.

UNIX file name.

type host_dirname = string

UNIX file name.

Host directory name.

type host_filename = string

Host directory name.

Host file name.

type prog = string

Host file name.

Program.

type arg = string

Program.

Command line argument.

type args = arg list

Command line argument.

Command line arguments.

type command_line = prog * args

Command line arguments.

Command line.

type findlib_name = string

Package name for findlib, doesn't contain '.'.

type findlib_full = string

Package name + path for findlib, made of several findlib name concatenated with '.'.

OASIS package definition

type compiled_object =
  1. | Byte
    (*

    Always use byte code.

    *)
  2. | Native
    (*

    Always use native code.

    *)
  3. | Best
    (*

    Use either byte or native, depending ocamlopt availability.

    *)

Compilation type.

type dependency =
  1. | FindlibPackage of findlib_full * OASISVersion.comparator option
    (*

    External findlib package.

    *)
  2. | InternalLibrary of name
    (*

    Section library of the given name.

    *)

Package dependency.

type tool =
  1. | ExternalTool of name
    (*

    External tool.

    *)
  2. | InternalExecutable of name
    (*

    Section executable of the given name.

    *)

Tool dependency.

type vcs =
  1. | Darcs
    (*

    Darcs

    *)
  2. | Git
    (*

    Git

    *)
  3. | Svn
    (*

    Subversion

    *)
  4. | Cvs
    (*

    CVS

    *)
  5. | Hg
    (*

    Mercurial

    *)
  6. | Bzr
    (*

    Bazaar

    *)
  7. | Arch
    (*

    GNU arch

    *)
  8. | Monotone
    (*

    Monotone

    *)
  9. | OtherVCS of url
    (*

    Anything else, follow URL for description.

    *)

Possible VCS.

type 'a conditional = 'a OASISExpr.choices

Conditional value, last expression that evaluate to true define the value.

type plugin_kind = [
  1. | `Configure
  2. | `Build
  3. | `Doc
  4. | `Test
  5. | `Install
  6. | `Extra
]

Plugin kind.

type plugin_data_purpose = [
  1. | `Configure
  2. | `Build
  3. | `Install
  4. | `Clean
  5. | `Distclean
  6. | `Install
  7. | `Uninstall
  8. | `Test
  9. | `Doc
  10. | `Extra
  11. | `Other of string
]

Additional data to allow registration of more than one data property per plugin. See OASISPlugin.data_new_property

type 'a plugin = 'a * name * OASISVersion.t option

Plugin definition, plugin type depends on which fields this types is used for.

type all_plugin = plugin_kind plugin
type plugin_data = (all_plugin * plugin_data_purpose * (unit -> unit)) list

Property list storage for plugin data

type custom = {
  1. pre_command : command_line option conditional;
    (*

    Run before.

    *)
  2. post_command : command_line option conditional;
    (*

    Run after.

    *)
}

Set of command lines to run before and after a step.

type common_section = {
  1. cs_name : name;
    (*

    Name of the section.

    *)
  2. cs_data : PropList.Data.t;
  3. cs_plugin_data : plugin_data;
    (*

    Property list attached to the section.

    *)
}

Common attributes for sections.

type build_section = {
  1. bs_build : bool conditional;
    (*

    Build this section.

    *)
  2. bs_install : bool conditional;
    (*

    Install this section.

    *)
  3. bs_path : unix_dirname;
    (*

    Top level location of the sources.

    *)
  4. bs_compiled_object : compiled_object;
    (*

    What kind of compilation.

    *)
  5. bs_build_depends : dependency list;
    (*

    List of dependencies.

    *)
  6. bs_build_tools : tool list;
    (*

    List of build tools.

    *)
  7. bs_interface_patterns : OASISSourcePatterns.t list;
    (*

    Patterns used to locate interface source filesi (.mli).

    *)
  8. bs_implementation_patterns : OASISSourcePatterns.t list;
    (*

    Patterns used to locate implementation source files (.ml).

    *)
  9. bs_c_sources : unix_filename list;
    (*

    C sources, relative to bs_path.

    *)
  10. bs_data_files : (unix_filename * unix_filename option) list;
    (*

    Data files and their install location, relative to bs_path.

    *)
  11. bs_findlib_extra_files : unix_filename list;
    (*

    Extra files to install with findlib.

    *)
  12. bs_ccopt : args conditional;
    (*

    Options for -ccopt.

    *)
  13. bs_cclib : args conditional;
    (*

    Options for -cclib.

    *)
  14. bs_dlllib : args conditional;
    (*

    Options for -dllib.

    *)
  15. bs_dllpath : args conditional;
    (*

    Options for -dllpath.

    *)
  16. bs_byteopt : args conditional;
    (*

    Option to pass to ocamlc.

    *)
  17. bs_nativeopt : args conditional;
    (*

    Option to pass to ocamlopt.

    *)
}

Common attributes for Executable and Library sections.

type library = {
  1. lib_modules : string list;
    (*

    List of modules exported by the library.

    *)
  2. lib_pack : bool;
    (*

    Are we building a packed library?

    *)
  3. lib_internal_modules : string list;
    (*

    List of modules not-exported by the library, but compiled along.

    *)
  4. lib_findlib_parent : findlib_name option;
    (*

    Name of the findlib parent, if any.

    *)
  5. lib_findlib_name : findlib_name option;
    (*

    Findlib name of this library, this name is used to refer to this library in build dependencies.

    *)
  6. lib_findlib_directory : unix_dirname option;
    (*

    Findlib sub-directory where the library will be installed. This directory is actually relative to the directory of the findlib parent.

    *)
  7. lib_findlib_containers : findlib_name list;
    (*

    Name of virtual containers (empty findlib package) between findlib parent and findlib name

    *)
}

Library definition.

type object_ = {
  1. obj_modules : string list;
  2. obj_findlib_fullname : findlib_name list option;
    (*

    Findlib name of this library, this name is used to refer to this library in build dependencies.

    *)
  3. obj_findlib_directory : unix_dirname option;
}

Object definition.

type executable = {
  1. exec_custom : bool;
    (*

    Use -custom ocamlc option.

    *)
  2. exec_main_is : unix_filename;
    (*

    Main file to compile, dependencies should be guessed by build system.

    *)
}

Executable definition.

type flag = {
  1. flag_description : string option;
    (*

    Short description.

    *)
  2. flag_default : bool conditional;
    (*

    Default value.

    *)
}

Command line flag definition.

type source_repository = {
  1. src_repo_type : vcs;
    (*

    Repository type.

    *)
  2. src_repo_location : url;
    (*

    Where to fetch the source, using appropriate VCS tool.

    *)
  3. src_repo_browser : url option;
    (*

    Where to browse the source, using web browser.

    *)
  4. src_repo_module : string option;
    (*

    Depending on VCS, which module (e.g. CVS).

    *)
  5. src_repo_branch : string option;
    (*

    Depending on VCS, which branch (e.g. git).

    *)
  6. src_repo_tag : string option;
    (*

    Depending on VCS, which tag (e.g. tag for darcs, git or svn).

    *)
  7. src_repo_subdir : unix_filename option;
    (*

    Depending on VCS, which sub directory (e.g. svn).

    *)
}

Source repository definition.

type test = {
  1. test_type : [ `Test ] plugin;
    (*

    Plugin to run the test, default custom.

    *)
  2. test_command : command_line conditional;
    (*

    Command to run the test, may depend on the plugin meaning.

    *)
  3. test_custom : custom;
    (*

    Custom command lines to run before and after.

    *)
  4. test_working_directory : unix_filename option;
    (*

    Which working directorty to chdir in.

    *)
  5. test_run : bool conditional;
    (*

    Should we run the test.

    *)
  6. test_tools : tool list;
    (*

    Tools required for this test.

    *)
}

Test definition.

type doc_format =
  1. | HTML of unix_filename
    (*

    HTML files and their main entry point (e.g. HTML "index.html")

    *)
  2. | DocText
    (*

    Plain text.

    *)
  3. | PDF
    (*

    Portable document format.

    *)
  4. | PostScript
  5. | Info of unix_filename
    (*

    Info files and their main entry point.

    *)
  6. | DVI
  7. | OtherDoc
    (*

    Anything else.

    *)

Document formats.

type doc = {
  1. doc_type : [ `Doc ] plugin;
    (*

    Plugin to build this document, default none.

    *)
  2. doc_custom : custom;
    (*

    Custom command lines ommand to before and after.

    *)
  3. doc_build : bool conditional;
    (*

    Build this document.

    *)
  4. doc_install : bool conditional;
    (*

    Install this document.

    *)
  5. doc_install_dir : unix_filename;
    (*

    Where to install this document.

    *)
  6. doc_title : string;
    (*

    What is the title of this document.

    *)
  7. doc_authors : string list;
    (*

    Who are the authors of this document.

    *)
  8. doc_abstract : string option;
    (*

    Abstract of this document.

    *)
  9. doc_format : doc_format;
    (*

    Format of this document.

    *)
  10. doc_data_files : (unix_filename * unix_filename option) list;
    (*

    All data files and where they should be install, by default to doc_install_dir

    *)
  11. doc_build_tools : tool list;
    (*

    Tools required to generate this document.

    *)
}

Document definition.

type section =
  1. | Library of common_section * build_section * library
  2. | Object of common_section * build_section * object_
  3. | Executable of common_section * build_section * executable
  4. | Flag of common_section * flag
  5. | SrcRepo of common_section * source_repository
  6. | Test of common_section * test
  7. | Doc of common_section * doc

All sections and their attributes.

type section_kind = [
  1. | `Library
  2. | `Object
  3. | `Executable
  4. | `Flag
  5. | `SrcRepo
  6. | `Test
  7. | `Doc
]
type package = {
  1. oasis_version : OASISVersion.t;
    (*

    OASIS version used to write this package.

    *)
  2. ocaml_version : OASISVersion.comparator option;
    (*

    OCaml version required for this package.

    *)
  3. findlib_version : OASISVersion.comparator option;
    (*

    Findlib version required for this package.

    *)
  4. alpha_features : string list;
    (*

    Alpha features enabled for this package.

    *)
  5. beta_features : string list;
    (*

    Beta features enabled for this package.

    *)
  6. name : package_name;
    (*

    Name of this package.

    *)
  7. version : OASISVersion.t;
    (*

    Version of this package.

    *)
  8. license : OASISLicense.t;
    (*

    License of this package.

    *)
  9. license_file : unix_filename option;
    (*

    File containing the license of this package.

    *)
  10. copyrights : string list;
    (*

    Copyright holders (e.g. companies or people).

    *)
  11. maintainers : string list;
    (*

    People actually taking care of this package (e.g. subset of copyright holders)

    *)
  12. authors : string list;
    (*

    Real people who wrote this package, not their companies.

    *)
  13. homepage : url option;
    (*

    Location of the package homepage.

    *)
  14. bugreports : url option;
    (*

    Location of the page to report bugs.

    *)
  15. synopsis : string;
    (*

    Short description of the package.

    *)
  16. description : OASISText.t option;
    (*

    Long description of the package.

    *)
  17. tags : string list;
    (*

    List of tags.

    *)
  18. categories : url list;
    (*

    List of categories that the package belong to.

    *)
  19. conf_type : [ `Configure ] plugin;
    (*

    Plugin to configure, default internal.

    *)
  20. conf_custom : custom;
    (*

    Actions around configure step.

    *)
  21. build_type : [ `Build ] plugin;
    (*

    Plugin to build, default ocamlbuild.

    *)
  22. build_custom : custom;
    (*

    Actions around build step.

    *)
  23. install_type : [ `Install ] plugin;
    (*

    Plugin to install/uninstall, default internal.

    *)
  24. install_custom : custom;
    (*

    Actions around install step.

    *)
  25. uninstall_custom : custom;
    (*

    Actions around uninstall step.

    *)
  26. clean_custom : custom;
    (*

    Actions around clean step.

    *)
  27. distclean_custom : custom;
    (*

    Actions aroudn distclean step.

    *)
  28. files_ab : unix_filename list;
    (*

    Files to generate by replacing token in it after configure step.

    *)
  29. sections : section list;
    (*

    All sections (libraries, executables, tests...).

    *)
  30. plugins : [ `Extra ] plugin list;
    (*

    Extra plugins applied.

    *)
  31. disable_oasis_section : unix_filename list;
    (*

    Files which should not have OASIS Section comments and digests

    *)
  32. schema_data : PropList.Data.t;
  33. plugin_data : plugin_data;
    (*

    Property list attached to this package.

    *)
}

OASIS package, what an '_oasis' file contains.

Quickstart questions

type 'a quickstart_level =
  1. | NoChoice of 'a
    (*

    Don't ask question, use provided value.

    *)
  2. | Beginner
    (*

    Ask the question to a beginner and above.

    *)
  3. | Intermediate
    (*

    Ask the question to an intermediate user and above.

    *)
  4. | Expert
    (*

    Ask the question to an expert.

    *)

Quickstart level. Not exported.

type 'a quickstart_question =
  1. | Field
    (*

    Short text.

    *)
  2. | Text
    (*

    Long text, may use editor for it.

    *)
  3. | Choices of 'a list
    (*

    Multiple choices in a list.

    *)
  4. | ExclusiveChoices of 'a list
    (*

    Pick a single choice in the list.

    *)

Howto ask questions in quickstart. Not exported.

ODN functions

TODO: rewrite.

These functions allow to generate setup.ml standalone code, by serializing OCaml data using OCaml notation. They are not exported.

See the OCaml data notation project

val odn_of_unix_dirname : unix_dirname -> OASISDataNotation.t
val odn_of_unix_filename : unix_filename -> OASISDataNotation.t
val odn_of_command_line : (prog * args) -> OASISDataNotation.t
val odn_of_conditional : ('a -> OASISDataNotation.t) -> 'a OASISExpr.choices -> OASISDataNotation.t
val odn_of_package : package -> OASISDataNotation.t
OCaml

Innovation. Community. Security.