diff --git a/pkgs/development/ocaml-modules/uring/default.nix b/pkgs/development/ocaml-modules/uring/default.nix index 7ab261c06e12..6ee432359967 100644 --- a/pkgs/development/ocaml-modules/uring/default.nix +++ b/pkgs/development/ocaml-modules/uring/default.nix @@ -1,5 +1,7 @@ { lib, + ocaml, + version ? if lib.versionAtLeast ocaml.version "5.1" then "2.7.0" else "0.9", buildDunePackage, cstruct, dune-configurator, @@ -9,15 +11,28 @@ mdx, }: +let + param = + { + "0.9" = { + minimalOCamlVersion = "4.12"; + hash = "sha256-eXWIxfL9UsKKf4sanBjKfr6Od4fPDctVnkU+wjIXW0M="; + }; + "2.7.0" = { + minimalOCamlVersion = "5.1.0"; + hash = "sha256-mePi6/TXtxgtLYLyHRAdnRcgeldCVgUaPY+MZXSzC6U="; + }; + } + .${version}; +in buildDunePackage rec { pname = "uring"; - version = "0.9"; - - minimalOCamlVersion = "4.12"; + inherit version; + inherit (param) minimalOCamlVersion; src = fetchurl { url = "https://github.com/ocaml-multicore/ocaml-${pname}/releases/download/v${version}/${pname}-${version}.tbz"; - hash = "sha256-eXWIxfL9UsKKf4sanBjKfr6Od4fPDctVnkU+wjIXW0M="; + inherit (param) hash; }; propagatedBuildInputs = [