|
| 1 | +open B0_kit.V000 |
| 2 | +open B00_std |
| 3 | + |
| 4 | +(* OCaml library names *) |
| 5 | + |
| 6 | +let uuidm = B0_ocaml.libname "uuidm" |
| 7 | +let cmdliner = B0_ocaml.libname "cmdliner" |
| 8 | + |
| 9 | +(* Libraries *) |
| 10 | + |
| 11 | +let uuidm_lib = |
| 12 | + let srcs = Fpath.[`Dir (v "src")] in |
| 13 | + let requires = [] in |
| 14 | + B0_ocaml.lib uuidm ~doc:"The uuidm library" ~srcs ~requires |
| 15 | + |
| 16 | +(* Tests *) |
| 17 | + |
| 18 | +let test_exe src ~doc = |
| 19 | + let src = Fpath.v src in |
| 20 | + let srcs = Fpath.[`File src] in |
| 21 | + let meta = B0_meta.(empty |> tag test) in |
| 22 | + let requires = [ uuidm ] in |
| 23 | + B0_ocaml.exe (Fpath.basename ~no_ext:true src) ~srcs ~doc ~meta ~requires |
| 24 | + |
| 25 | +let test = test_exe "test/test.ml" ~doc:"Test suite" |
| 26 | +let perf = test_exe "test/perf.ml" ~doc:"Test performance" |
| 27 | + |
| 28 | +let uuidtrip = |
| 29 | + let doc = "Generates universally unique identifiers (UUIDs)" in |
| 30 | + let srcs = Fpath.[`File (v "test/uuidtrip.ml")] in |
| 31 | + let requires = [uuidm; cmdliner] in |
| 32 | + B0_ocaml.exe "uuidtrip" ~doc ~srcs ~requires |
| 33 | + |
| 34 | +(* Packs *) |
| 35 | + |
| 36 | +let default = |
| 37 | + let meta = |
| 38 | + let open B0_meta in |
| 39 | + empty |
| 40 | + |> tag B0_opam.tag |
| 41 | + |> add authors ["The uuidm programmers"] |
| 42 | + |> add maintainers [ "Daniel Bünzli <daniel.buenzl [email protected]>"] |
| 43 | + |> add homepage "https://erratique.ch/software/uuidm" |
| 44 | + |> add online_doc "https://erratique.ch/software/uuidm/doc/" |
| 45 | + |> add licenses ["ISC"] |
| 46 | + |> add repo "git+https://erratique.ch/repos/uuidm.git" |
| 47 | + |> add issues "https://github.com/dbuenzli/uuidm/issues" |
| 48 | + |> add description_tags |
| 49 | + ["uuid"; "codec"; "org:erratique"] |
| 50 | + |> add B0_opam.Meta.depopts ["cmdliner", ""] |
| 51 | + |> add B0_opam.Meta.conflicts |
| 52 | + [ "cmdliner", {|< "1.1.0"|}] |
| 53 | + |> add B0_opam.Meta.depends |
| 54 | + [ "ocaml", {|>= "4.08.0"|}; |
| 55 | + "ocamlfind", {|build|}; |
| 56 | + "ocamlbuild", {|build|}; |
| 57 | + "topkg", {|build & >= "1.0.3"|}; |
| 58 | + ] |
| 59 | + |> add B0_opam.Meta.build |
| 60 | + {|[["ocaml" "pkg/pkg.ml" "build" "--dev-pkg" "%{dev}%" |
| 61 | + "--with-cmdliner" "%{cmdliner:installed}%"]]|} |
| 62 | + in |
| 63 | + B0_pack.v "default" ~doc:"uuidm package" ~meta ~locked:true @@ |
| 64 | + B0_unit.list () |
0 commit comments