summaryrefslogtreecommitdiff
path: root/pkgs/development/ocaml-modules/odoc/default.nix
blob: ab2f8557e0d6ef01ac34878a9321f326df1553eb (plain)
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
{
  lib,
  buildDunePackage,
  ocaml-crunch,
  astring,
  cmdliner,
  cppo,
  fpath,
  result,
  tyxml,
  markup,
  yojson,
  sexplib0,
  jq,
  odoc-parser,
  ppx_expect,
  bash,
  fmt,
}:

buildDunePackage {
  pname = "odoc";
  inherit (odoc-parser) version src;

  nativeBuildInputs = [
    cppo
    ocaml-crunch
  ];
  buildInputs = [
    astring
    cmdliner
    fpath
    tyxml
    odoc-parser
    fmt
  ];

  nativeCheckInputs = [
    bash
    jq
  ];
  checkInputs = [
    markup
    yojson
    sexplib0
    jq
    ppx_expect
  ];
  doCheck = true;

  preCheck = ''
    # some run.t files check the content of patchShebangs-ed scripts, so patch
    # them as well
    find test \( -name '*.sh' -o -name 'run.t' \)  -execdir sed 's@#!/bin/sh@#!${bash}/bin/sh@' -i '{}' \;
    patchShebangs test
  '';

  meta = {
    description = "Documentation generator for OCaml";
    mainProgram = "odoc";
    license = lib.licenses.isc;
    maintainers = [ lib.maintainers.vbgl ];
    homepage = "https://github.com/ocaml/odoc";
    changelog = "https://github.com/ocaml/odoc/blob/${odoc-parser.version}/CHANGES.md";
  };
}