1234567891011121314151617181920212223242526272829303132333435363738(** [string_to_fpath str] converts [str] into a [Fpath.t]. On Windows the
[str] is normalized to a regular Windows file path (ex. backslashes). *)letstring_to_norm_fpathstr=matchFpath.of_stringstrwithOkp->p|Error(`Msge)->failwithe(** [normalize_path] normalizes a path so on Windows it is a regular
Windows path with backslashes. *)letnormalize_pathstr=Fpath.(to_string(string_to_norm_fpathstr))typeinstall_files_source=|Opam_switch_prefixofFpath.t|Install_files_dirofFpath.ttypeinstall_files_type=Staging|Statictypepackage_selector=Package|Component(** [absdir_install_files ~component_name install_files_type install_files_source] is
the [component_name] component's static-files or staging-files directory
for Staging or Static [install_files_type], respectively *)letabsdir_install_files?(package_selector=Component)~component_nameinstall_files_typeinstall_files_source=letdo_opam_contextopam_switch_prefix=letstem=matchinstall_files_typewith|Staging->"staging-files"|Static->"static-files"inFpath.(opam_switch_prefix/"share"/(matchpackage_selectorwith|Component->"dkml-component-"^component_name|Package->"dkml-package-"^component_name)/stem)inmatchinstall_files_sourcewith|Opam_switch_prefixopam_switch_prefix->do_opam_contextopam_switch_prefix|Install_files_dirinstall_files->Fpath.(install_files/component_name)