1{
2 lib,
3 buildDunePackage,
4 ocaml,
5 ocaml-crunch,
6 astring,
7 cmdliner,
8 cppo,
9 fpath,
10 result,
11 tyxml,
12 markup,
13 yojson,
14 sexplib0,
15 jq,
16 odoc-parser,
17 ppx_expect,
18 bash,
19 fmt,
20}:
21
22buildDunePackage rec {
23 pname = "odoc";
24 inherit (odoc-parser) version src;
25
26 nativeBuildInputs = [
27 cppo
28 ocaml-crunch
29 ];
30 buildInputs = [
31 astring
32 cmdliner
33 fpath
34 result
35 tyxml
36 odoc-parser
37 fmt
38 ];
39
40 nativeCheckInputs = [
41 bash
42 jq
43 ];
44 checkInputs = [
45 markup
46 yojson
47 sexplib0
48 jq
49 ppx_expect
50 ];
51 doCheck = lib.versionAtLeast ocaml.version "4.08" && lib.versionOlder yojson.version "2.0";
52
53 preCheck = ''
54 # some run.t files check the content of patchShebangs-ed scripts, so patch
55 # them as well
56 find test \( -name '*.sh' -o -name 'run.t' \) -execdir sed 's@#!/bin/sh@#!${bash}/bin/sh@' -i '{}' \;
57 patchShebangs test
58 '';
59
60 meta = {
61 description = "Documentation generator for OCaml";
62 mainProgram = "odoc";
63 license = lib.licenses.isc;
64 maintainers = [ lib.maintainers.vbgl ];
65 homepage = "https://github.com/ocaml/odoc";
66 changelog = "https://github.com/ocaml/odoc/blob/${version}/CHANGES.md";
67 };
68}