this repo has no description
1(* Driver layer *)
2
3let driver_layer_hash ~base_hash ~compiler_hashes =
4 Day11_layer.Hash.of_strings ([ "driver"; base_hash ] @ compiler_hashes)
5
6let driver_layer_name ~base_hash ~compiler_hashes =
7 let hash = driver_layer_hash ~base_hash ~compiler_hashes in
8 "doc-driver-" ^ String.sub hash 0 12
9
10let driver_build_script ~packages ~pin_commands =
11 let pins = String.concat "\n" pin_commands in
12 let install =
13 Printf.sprintf "opam install -y %s" (String.concat " " packages)
14 in
15 String.concat "\n" (
16 (if pins = "" then [] else [ pins ])
17 @ [ install ])
18
19let driver_exists ~layer_dir =
20 Day11_layer.Layer.exists { hash = ""; dir = layer_dir }
21
22let has_odoc_driver_voodoo ~layer_dir =
23 let bin = Fpath.(layer_dir / "fs" / "home" / "opam" / ".opam"
24 / "default" / "bin" / "odoc_driver_voodoo") in
25 Sys.file_exists (Fpath.to_string bin)
26
27(* Odoc layer *)
28
29let odoc_layer_hash ~base_hash ~ocaml_version ~compiler_hashes =
30 Day11_layer.Hash.of_strings
31 ([ "odoc"; base_hash; ocaml_version ] @ compiler_hashes)
32
33let odoc_layer_name ~base_hash ~ocaml_version ~compiler_hashes =
34 let hash = odoc_layer_hash ~base_hash ~ocaml_version ~compiler_hashes in
35 "doc-odoc-" ^ String.sub hash 0 12
36
37let odoc_build_script ~packages ~pin_commands =
38 driver_build_script ~packages ~pin_commands
39
40let odoc_exists ~layer_dir =
41 driver_exists ~layer_dir
42
43let has_odoc ~layer_dir =
44 let bin = Fpath.(layer_dir / "fs" / "home" / "opam" / ".opam"
45 / "default" / "bin" / "odoc") in
46 Sys.file_exists (Fpath.to_string bin)