2020-12-09 12:39:15 +00:00
|
|
|
{ lib, fetchurl, buildDunePackage, ocaml
|
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";
|
2023-08-22 20:05:09 +00:00
|
|
|
version = "2.2.1";
|
2020-12-09 12:39:15 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/ocaml/odoc/releases/download/${version}/odoc-${version}.tbz";
|
2023-08-22 20:05:09 +00:00
|
|
|
sha256 = "sha256-F4blO/CCT+HHx7gdKn2EaEal0RZ3lp5jljYfd6OBaAM=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
nativeBuildInputs = [ cppo ];
|
|
|
|
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";
|
|
|
|
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
|
|
|
};
|
|
|
|
}
|