package opam-format
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Format library for opam 2.6
Install
dune-project
Dependency
Authors
-
David Allsopp
-
VVincent Bernardoff <vb@luminar.eu.org>
-
RRaja Boujbel <raja.boujbel@ocamlpro.com>
-
KKate Deplaix <kit-ty-kate@exn.st>
-
RRoberto Di Cosmo <roberto@dicosmo.org>
-
TThomas Gazagnaire <thomas@gazagnaire.org>
-
LLouis Gesbert <louis.gesbert@ocamlpro.com>
-
FFabrice Le Fessant <Fabrice.Le_fessant@inria.fr>
-
AAnil Madhavapeddy <anil@recoil.org>
-
GGuillem Rieu <guillem.rieu@ocamlpro.com>
-
RRalf Treinen <ralf.treinen@pps.jussieu.fr>
-
FFrederic Tuong <tuong@users.gforge.inria.fr>
Maintainers
Sources
2.6.0.tar.gz
md5=33de6843fe6e44bf715623fe5fa42d32
sha512=512fc80cf12d277c226bbeed14ce4aeef7ec4aeaa970e76dddf9fb763b310b0209284fd6c83773b3fa63e42c7f09ddf6e3c6b84a0db2de6cc9e58a933124f2b3
doc/src/opam-format/opamPath.ml.html
Source file opamPath.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300(**************************************************************************) (* *) (* Copyright 2012-2020 OCamlPro *) (* Copyright 2012 INRIA *) (* *) (* All rights reserved. This file is distributed under the terms of the *) (* GNU Lesser General Public License version 2.1, with the special *) (* exception on linking described in the file LICENSE. *) (* *) (**************************************************************************) open OpamTypes open OpamFilename.Op type t = dirname (* Returns a generic file, coerced by the .mli *) let ( /- ) dir f = OpamFile.make (dir // f) let config t = t /- OpamPathName.config_f let redirected t = t // "redirected-opamroot" let init_config_files () = List.map OpamFile.make [ OpamFilename.Dir.of_string (OpamStd.Sys.etc ()) // "opamrc"; OpamFilename.Dir.of_string (OpamStd.Sys.home ()) // ".opamrc"; ] let state_cache_dir t = t / OpamPathName.repo_d let state_cache t = state_cache_dir t // Printf.sprintf "state-%s.cache" (OpamVersion.magic ()) let lock t = t // OpamPathName.lock_f let config_lock t = t // "config.lock" (* let archives_dir t = t / "archives" let archive t nv = archives_dir t // (OpamPackage.to_string nv ^ "+opam.tar.gz") *) let repos_lock t = t / OpamPathName.repo_d // OpamPathName.lock_f let repos_config t = t / OpamPathName.repo_d /- "repos-config" let init t = t / "opam-init" let hooks_dir t = init t / OpamPathName.hooks_d let log t = t / OpamPathName.log_d let backup_file = let file = lazy Unix.( let tm = gmtime (Unix.gettimeofday ()) in Printf.sprintf "state-%04d%02d%02d%02d%02d%02d.export" (tm.tm_year+1900) (tm.tm_mon+1) tm.tm_mday tm.tm_hour tm.tm_min tm.tm_sec ) in fun () -> Lazy.force file let backup_dir t = t / "backup" let backup t = backup_dir t /- backup_file () let plugin_prefix = "opam-" let plugins t = t / OpamPathName.plugins_d let plugins_bin t = plugins t / "bin" let plugin_bin t name = let sname = OpamPackage.Name.to_string name ^ OpamStd.Sys.executable_name "" in let basename = if OpamCompat.String.starts_with ~prefix:plugin_prefix sname then sname else plugin_prefix ^ sname in plugins_bin t // basename let plugin t name = let sname = OpamPackage.Name.to_string name in assert (sname <> "bin"); plugins t / sname let last_env t = t / ".last-env" module type LAYOUT = sig type ctx val root : dirname -> ctx -> dirname val lib_dir : dirname -> ctx -> dirname end module Switch = struct let root t a = OpamSwitch.get_root t a (** Internal files and dirs with static location *) let meta_dirname = ".opam-switch" let meta t a = root t a / meta_dirname let lock t a = meta t a // OpamPathName.lock_f let backup_dir t a = meta t a / "backup" let backup t a = backup_dir t a /- backup_file () let selections t a = meta t a /- OpamPathName.switch_state let build_dir t a = meta t a / OpamPathName.build_d let build t a nv = build_dir t a / OpamPackage.to_string nv let remove_dir t a = meta t a / OpamPathName.remove_d let remove t a nv = remove_dir t a / OpamPackage.to_string nv let install_dir t a = meta t a / OpamPathName.install_d let install t a n = install_dir t a /- (OpamPackage.Name.to_string n ^ OpamPathName.install_suffix) let changes t a n = install_dir t a /- (OpamPackage.Name.to_string n ^ OpamPathName.changes_suffix) let reinstall t a = meta t a /- OpamPathName.reinstall_d let switch_config t a = meta t a /- OpamPathName.switch_config let config_dir t a = meta t a / OpamPathName.config_d let config t a n = config_dir t a /- (OpamPackage.Name.to_string n ^ OpamPathName.config_suffix) let sources_dir t a = meta t a / OpamPathName.sources_d let extra_files_dir t a = meta t a / "extra-files-cache" let extra_file t a h = extra_files_dir t a // OpamHash.contents h let sources t a nv = sources_dir t a / OpamPackage.to_string nv let pinned_package t a name = sources_dir t a / OpamPackage.Name.to_string name let env_filename = OpamPathName.environment_f let environment t a = meta t a /- env_filename let env_relative_to_prefix pfx = pfx / meta_dirname /- env_filename let nix_env t a = meta t a /- "nix.env" let installed_opams t a = meta t a / OpamPathName.packages_d let installed_opams_cache t a = meta t a / OpamPathName.packages_d // "cache" let installed_package_dir t a nv = installed_opams t a / OpamPackage.to_string nv let installed_opam t a nv = installed_package_dir t a nv /- OpamPathName.opam_f let installed_opam_files_dir t a nv = installed_package_dir t a nv / OpamPathName.files_d let mans = ["1";"1M";"2";"3";"4";"5";"6";"7";"9"] module DefaultF(L:LAYOUT) = struct let lib_dir = L.lib_dir let lib t a n = L.lib_dir t a / OpamPackage.Name.to_string n let stublibs t a = L.lib_dir t a / "stublibs" let toplevel t a = L.lib_dir t a / "toplevel" let doc_dir t a = L.root t a / "doc" let man_dir ?num t a = match num with | None -> L.root t a / "man" | Some n -> L.root t a / "man" / ("man" ^ n) let man_dirs t a = List.map (fun num -> man_dir ~num t a) mans let t a = L.root t a / "share" let t a n = share_dir t a / OpamPackage.Name.to_string n let etc_dir t a = L.root t a / "etc" let etc t a n = etc_dir t a / OpamPackage.Name.to_string n let doc t a n = doc_dir t a / OpamPackage.Name.to_string n let bin t a = L.root t a / "bin" let sbin t a = L.root t a / "sbin" end (** Visible files that can be redirected using [config/global-config.config] *) module Default = struct include DefaultF(struct type ctx = switch let root = root let lib_dir t a = root t a / "lib" end) end let lookup stdpath relative_to default config = let dir = OpamStd.Option.default default (OpamFile.Switch_config.path config stdpath) in if Filename.is_relative dir then if dir = "" then relative_to else relative_to / dir else OpamFilename.Dir.of_string dir let prefix t a c = lookup Prefix (root t a) "" c let lib_dir t a c = lookup Lib (prefix t a c) "lib" c let lib t a c n = lib_dir t a c / OpamPackage.Name.to_string n let stublibs t a c = lookup Stublibs (lib_dir t a c) "stublibs" c let toplevel t a c = lookup Toplevel (lib_dir t a c) "toplevel" c let doc_dir t a c = lookup Doc (prefix t a c) "doc" c let doc t a c n = doc_dir t a c / OpamPackage.Name.to_string n let man_dir ?num t a c = let base = lookup Man (prefix t a c) "man" c in match num with | None -> base | Some n -> base / ("man" ^ n) let man_dirs t a c = List.map (fun num -> man_dir ~num t a c) mans let t a c = lookup Share (prefix t a c) "share" c let t a c n = share_dir t a c / OpamPackage.Name.to_string n let etc_dir t a c = lookup Etc (prefix t a c) "etc" c let etc t a c n = etc_dir t a c / OpamPackage.Name.to_string n let bin t a c = lookup Bin (prefix t a c) "bin" c let sbin t a c = lookup Sbin (prefix t a c) "sbin" c let get_stdpath t a c = function | Prefix -> prefix t a c | Lib -> lib_dir t a c | Bin -> bin t a c | Sbin -> sbin t a c | Share -> share_dir t a c | Doc -> doc_dir t a c | Etc -> etc_dir t a c | Man -> man_dir t a c | Toplevel -> toplevel t a c | Stublibs -> stublibs t a c module Overlay = struct let dir t a = meta t a / OpamPathName.overlay_d let package t a n = dir t a / OpamPackage.Name.to_string n let opam t a n = package t a n /- OpamPathName.opam_f let tmp_opam t a n = package t a n /- "opam_" let url t a n = package t a n /- "url" let descr t a n = package t a n /- "descr" let files t a n = package t a n / OpamPathName.files_d end end module Builddir = struct let install builddir nv = builddir /- (OpamPackage.Name.to_string nv.name ^ OpamPathName.install_suffix) let config builddir nv = builddir /- (OpamPackage.Name.to_string nv.name ^ OpamPathName.config_suffix) end
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>