1{ lib, buildDunePackage, ocaml
2, ocaml-crunch
3, astring, cmdliner, cppo, fpath, result, tyxml
4, markup, yojson, sexplib0, jq
5, odoc-parser, ppx_expect, bash, fmt
6}:
7
8buildDunePackage rec {
9 pname = "odoc";
10 inherit (odoc-parser) version src;
11
12 nativeBuildInputs = [ cppo ocaml-crunch ];
13 buildInputs = [ astring cmdliner fpath result tyxml odoc-parser fmt ];
14
15 nativeCheckInputs = [ bash jq ];
16 checkInputs = [ markup yojson sexplib0 jq ppx_expect ];
17 doCheck = lib.versionAtLeast ocaml.version "4.08"
18 && lib.versionOlder yojson.version "2.0";
19
20 preCheck = ''
21 # some run.t files check the content of patchShebangs-ed scripts, so patch
22 # them as well
23 find test \( -name '*.sh' -o -name 'run.t' \) -execdir sed 's@#!/bin/sh@#!${bash}/bin/sh@' -i '{}' \;
24 patchShebangs test
25 '';
26
27 meta = {
28 description = "A documentation generator for OCaml";
29 mainProgram = "odoc";
30 license = lib.licenses.isc;
31 maintainers = [ lib.maintainers.vbgl ];
32 homepage = "https://github.com/ocaml/odoc";
33 changelog = "https://github.com/ocaml/odoc/blob/${version}/CHANGES.md";
34 };
35}