diff options
author | Vincent Laporte <Vincent.Laporte@gmail.com> | 2023-08-17 21:06:14 +0200 |
---|---|---|
committer | Vincent Laporte <Vincent.Laporte@gmail.com> | 2023-08-17 21:06:14 +0200 |
commit | 428862de06da5bb7a402b945560dd1d021f4291f (patch) | |
tree | a7b6545ac18e97fc4a7f13415861fdac85dc099b /pkgs/development/ocaml-modules/odoc-parser | |
parent | 02bba6c619c91e8c8eef9ba1129d0eff31741445 (diff) |
ocamlPackages.odoc-parser: disable old versions for OCaml ≥ 5.0
and clean a bit
Diffstat (limited to 'pkgs/development/ocaml-modules/odoc-parser')
-rw-r--r-- | pkgs/development/ocaml-modules/odoc-parser/default.nix | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/pkgs/development/ocaml-modules/odoc-parser/default.nix b/pkgs/development/ocaml-modules/odoc-parser/default.nix index b653b111698f8..1c996973e1c29 100644 --- a/pkgs/development/ocaml-modules/odoc-parser/default.nix +++ b/pkgs/development/ocaml-modules/odoc-parser/default.nix @@ -1,4 +1,4 @@ -{ lib, fetchurl, buildDunePackage, astring, result, camlp-streams, version ? "2.0.0" }: +{ lib, fetchurl, buildDunePackage, ocaml, astring, result, camlp-streams, version ? "2.0.0" }: let param = { "2.0.0" = { @@ -11,27 +11,30 @@ let param = { }; "1.0.0" = { sha256 = "sha256-tqoI6nGp662bK+vE2h7aDXE882dObVfRBFnZNChueqE="; + max_version = "5.0"; extraBuildInputs = []; }; "0.9.0" = { sha256 = "sha256-3w2tG605v03mvmZsS2O5c71y66O3W+n3JjFxIbXwvXk="; + max_version = "5.0"; extraBuildInputs = []; }; }."${version}"; in +lib.throwIf (param ? max_version && lib.versionAtLeast ocaml.version param.max_version) + "odoc-parser ${version} is not available for OCaml ${ocaml.version}" + buildDunePackage rec { pname = "odoc-parser"; inherit version; - minimumOCamlVersion = "4.02"; + minimalOCamlVersion = "4.02"; src = fetchurl { url = "https://github.com/ocaml-doc/odoc-parser/releases/download/${version}/odoc-parser-${version}.tbz"; inherit (param) sha256; }; - useDune2 = true; - propagatedBuildInputs = [ astring result ] ++ param.extraBuildInputs; meta = { |