diff --git a/pkgs/development/ocaml-modules/eio/default.nix b/pkgs/development/ocaml-modules/eio/default.nix index 1f9e18e887e0..005364039e02 100644 --- a/pkgs/development/ocaml-modules/eio/default.nix +++ b/pkgs/development/ocaml-modules/eio/default.nix @@ -1,4 +1,6 @@ { lib +, ocaml +, version ? if lib.versionAtLeast ocaml.version "5.1" then "0.13" else "0.12" , buildDunePackage , bigstringaf , cstruct @@ -16,16 +18,26 @@ , mdx }: +let + param = { + "0.12" = { + minimalOCamlVersion = "5.0"; + hash = "sha256-2EhHzoX/t4ZBSWrSS+PGq1zCxohc7a1q4lfsrFnZJqA="; + }; + "0.13" = { + minimalOCamlVersion = "5.1"; + hash = "sha256-glN+4cWxgp/eggdhSk459WC9WCMyhBKQ7V73ZpHzr3A="; + }; + }."${version}"; +in buildDunePackage rec { pname = "eio"; - version = "0.12"; - - minimalOCamlVersion = "5.0"; - duneVersion = "3"; + inherit version; + inherit (param) minimalOCamlVersion; src = fetchurl { url = "https://github.com/ocaml-multicore/${pname}/releases/download/v${version}/${pname}-${version}.tbz"; - sha256 = "2EhHzoX/t4ZBSWrSS+PGq1zCxohc7a1q4lfsrFnZJqA="; + inherit (param) hash; }; propagatedBuildInputs = [ diff --git a/pkgs/development/ocaml-modules/eio/linux.nix b/pkgs/development/ocaml-modules/eio/linux.nix index 62f9800790b5..b376f709794a 100644 --- a/pkgs/development/ocaml-modules/eio/linux.nix +++ b/pkgs/development/ocaml-modules/eio/linux.nix @@ -10,7 +10,6 @@ buildDunePackage { inherit (eio) meta src version; minimalOCamlVersion = "5.0"; - duneVersion = "3"; dontStrip = true; diff --git a/pkgs/development/ocaml-modules/eio/main.nix b/pkgs/development/ocaml-modules/eio/main.nix index def30f2a0597..410e53551275 100644 --- a/pkgs/development/ocaml-modules/eio/main.nix +++ b/pkgs/development/ocaml-modules/eio/main.nix @@ -11,7 +11,6 @@ buildDunePackage { inherit (eio) meta src version; minimalOCamlVersion = "5.0"; - duneVersion = "3"; dontStrip = true; diff --git a/pkgs/development/ocaml-modules/eio/posix.nix b/pkgs/development/ocaml-modules/eio/posix.nix index 6c3042e65fae..e8dc4072bab1 100644 --- a/pkgs/development/ocaml-modules/eio/posix.nix +++ b/pkgs/development/ocaml-modules/eio/posix.nix @@ -11,7 +11,6 @@ buildDunePackage { inherit (eio) meta src version; minimalOCamlVersion = "5.0"; - duneVersion = "3"; dontStrip = true;