Files
nixpkgs/pkgs/development/ocaml-modules/odoc/default.nix
rina 81cc39b691 ocamlPackages.odoc: remove cmdliner_1 override for 3.2 and newer
It's no longer needed after the test fixes in 3.2:

4fa086b11d

This moves the override into the `default.nix` so we can conditionally
apply the override for versions below 3.2.0.

Tested:

    nix-build -A ocamlPackages.odoc
2026-08-07 16:31:47 +10:00

67 lines
1.2 KiB
Nix

{
lib,
buildDunePackage,
ocaml-crunch,
astring,
cmdliner,
cmdliner_1,
cppo,
fpath,
tyxml,
markup,
yojson,
sexplib0,
jq,
odoc-parser,
ppx_expect,
bash,
fmt,
}:
buildDunePackage (self: {
pname = "odoc";
inherit (odoc-parser) version src;
nativeBuildInputs = [
cppo
ocaml-crunch
];
buildInputs = [
astring
(if lib.versionAtLeast self.version "3.2.0" then cmdliner else cmdliner_1)
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";
};
})