2020-12-09 12:39:15 +00:00
|
|
|
{ lib, fetchurl, buildDunePackage, ocaml
|
2024-05-15 15:35:15 +00:00
|
|
|
, ocaml-crunch
|
2020-04-24 23:36:52 +00:00
|
|
|
, astring, cmdliner, cppo, fpath, result, tyxml
|
2022-08-12 12:06:08 +00:00
|
|
|
, markup, yojson, sexplib0, jq
|
|
|
|
, odoc-parser, ppx_expect, bash, fmt
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildDunePackage rec {
|
|
|
|
pname = "odoc";
|
2024-05-15 15:35:15 +00:00
|
|
|
inherit (odoc-parser) version src;
|
2020-12-09 12:39:15 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
nativeBuildInputs = [ cppo ocaml-crunch ];
|
2023-02-09 11:40:11 +00:00
|
|
|
buildInputs = [ astring cmdliner fpath result tyxml odoc-parser fmt ];
|
2020-12-09 12:39:15 +00:00
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
nativeCheckInputs = [ bash jq ];
|
|
|
|
checkInputs = [ markup yojson sexplib0 jq ppx_expect ];
|
2022-09-09 14:08:57 +00:00
|
|
|
doCheck = lib.versionAtLeast ocaml.version "4.08"
|
|
|
|
&& lib.versionOlder yojson.version "2.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
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
|
|
|
|
'';
|
2020-12-09 12:39:15 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = {
|
|
|
|
description = "A documentation generator for OCaml";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "odoc";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = lib.licenses.isc;
|
|
|
|
maintainers = [ lib.maintainers.vbgl ];
|
2020-12-09 12:39:15 +00:00
|
|
|
homepage = "https://github.com/ocaml/odoc";
|
2023-08-22 20:05:09 +00:00
|
|
|
changelog = "https://github.com/ocaml/odoc/blob/${version}/CHANGES.md";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|