package dkml-install
Install
    
    dune-project
 Dependency
Authors
Maintainers
Sources
sha256=e48dddd64742d654c962be7138539ef3811298b1119a29e043553f07f7621960
    
    
  sha512=0c21208b0e8e046314139d30c26f194e4e767d14696ea3c3e0d3ddd7c5e777887f0ddd83188008824d14dd14d0ce89af92e72984d598541a418e1fbe248d2d0e
    
    
  doc/dkml-install.api/Dkml_install_api/Context/index.html
Module Dkml_install_api.ContextSource
Context is a module providing a record type for the context.
type t = {- path_eval : string -> Fpath.t;
- eval : string -> string;
- target_abi_v2 : Abi_v2.t;
- log_config : Log_config.t;
}t is the record type for the context.
Context Fields
The following fields are available from the context:
- ctx.path_eval "/some/path/expression"- Evaluates the given path expression, resolving any templates embedded in the expression. You may use slashes ("/") even on Windows; the evaluation of the expression will convert the path into native Windows (ex. C:\Program Files) or Unix format (ex. /usr/local/share). - An example expression is - "%{ocamlrun:share}/generic/bin/ocamlrun"which would be the location of ocamlrun.exe within the staging files directory.- Templates: - "%{prefix}"is the absolute path of the final installation directory. If you are following GNU directory standards, you should populate- "%{prefix}"with subdirectories "bin/", "share/", etc.
- "%{tmp}"is the absolute path to a temporary directory unique to the component that is currently being installed. No other component will use the same temporary directory.
- "%{_:share-generic}"is the absolute path to the ``generic`` Staging Files directory of the component currently being installed.
- "%{_:share-abi}"is the absolute path to the ``<abi>`` Staging Files of the component currently being installed, where ``<abi>`` is the ABI currently being installed
 - More templates available to all - ctxexcept- needs_admin ctx:- "%{COMPONENT_NAME:share-generic}"is the absolute path to the ``generic`` Staging Files of the named component. Only COMPONENT_NAMEs that are transitive dependencies of the currently-being-installed component will be resolved.
- "%{COMPONENT_NAME:share-abi}"is the absolute path to the ``<abi>`` Staging Files of the named component, where ``<abi>`` is the ABI currently being installed
 - Only COMPONENT_NAMEs that are transitive dependencies of the currently-being-installed component will be resolved. - Usually the staging files include a bytecode executable to run a component's installation logic. - Variations: - Staging Files: When dkml-install-runner.exe is run with the "--staging-files DIR"option then the staging directory is simply"<DIR>/<COMPONENT_NAME>". During an end-user installation the"--staging-files DIR"option is automatically used. When dkml-install-runner.exe is run with the"--opam-context"option then the staging directory is"$OPAM_SWITCH_PREFIX/share/dkml-component-<COMPONENT_NAME>/staging-files". You can use the"--opam-context"option to test your components in an Opam environment.
 
- ctx.eval "/some/expression"- Evaluates the given expression, resolving any templates embedded in the expression. - An example expression is - "%{components:all}".- All templates that are available with - path_evalare available with- eval. However unlike- path_evalthe- evalfunction will do no path conversions on Windows. In addition- evalhas templates that are not available in- path_eval.- Templates available to - evalbut not in- path_eval:- "%{name}"is the name of the component currently being installed
- "%{components:all}"is the space separated names of the components that are or will be installed
 
- ctx.target_abi_v2- The ABI for the end-user's machine from the list of V2 ABIs. You cannot rely on inspecting the OCaml bytecode interpreter since the interpreter is often compiled to 32-bit for maximum portability. When more ABIs are supported they will go into a future - ctx.host_abi_v3or later; for type-safety- ctx.target_abi_v2will give a- Result.Errorfor those new ABIs.- Values for the V2 ABI include: - * Android_arm64v8a * Android_arm32v7a * Android_x86 * Android_x86_64 * Darwin_arm64 * Darwin_x86_64 * Linux_arm64 * Linux_arm32v6 * Linux_arm32v7 * Linux_x86_64 * Linux_x86 * Windows_x86_64 * Windows_x86 
- ctx.log_config- The logging configuration. See the Logging section of - Dkml_install_apifor how to use it.