evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / development / ocaml-modules / odoc-parser / default.nix
blob5d22d2d71238479b36699125b4e12d77f2cd5189
1 { lib, fetchurl, buildDunePackage, ocaml, astring, result, camlp-streams, version ? "2.4.2" }:
3 let param = {
4   "2.4.2" = {
5     sha256 = "sha256-Vjz9uybsijDnN6nPKFoG4LuulT9I4lu7D2n3qZwrpAs=";
6   };
7   "2.0.0" = {
8     sha256 = "sha256-QHkZ+7DrlXYdb8bsZ3dijZSqGQc0O9ymeLGIC6+zOSI=";
9   };
10   "1.0.1" = {
11     sha256 = "sha256-orvo5CAbYOmAurAeluQfK6CwW6P1C0T3WDfoovuQfSw=";
12   };
13   "1.0.0" = {
14     sha256 = "sha256-tqoI6nGp662bK+vE2h7aDXE882dObVfRBFnZNChueqE=";
15     max_version = "5.0";
16   };
17   "0.9.0" = {
18     sha256 = "sha256-3w2tG605v03mvmZsS2O5c71y66O3W+n3JjFxIbXwvXk=";
19     max_version = "5.0";
20   };
21 }."${version}"; in
23 lib.throwIf (param ? max_version && lib.versionAtLeast ocaml.version param.max_version)
24   "odoc-parser ${version} is not available for OCaml ${ocaml.version}"
26 buildDunePackage rec {
27   pname = "odoc-parser";
28   inherit version;
30   minimalOCamlVersion = "4.02";
32   src = fetchurl {
33     url = if lib.versionAtLeast version "2.4"
34       then "https://github.com/ocaml/odoc/releases/download/${version}/odoc-${version}.tbz"
35       else "https://github.com/ocaml-doc/odoc-parser/releases/download/${version}/odoc-parser-${version}.tbz";
36     inherit (param) sha256;
37   };
39   propagatedBuildInputs = [ astring result ] ++
40     lib.optional (lib.versionAtLeast version "1.0.1") camlp-streams;
42   meta = {
43     description = "Parser for Ocaml documentation comments";
44     license = lib.licenses.isc;
45     maintainers = [ ];
46     homepage = "https://github.com/ocaml-doc/odoc-parser";
47     changelog = "https://github.com/ocaml-doc/odoc-parser/raw/${version}/CHANGES.md";
48   };