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