From f60921aeede3ea43ea9c2cecf818934f1c6abbb9 Mon Sep 17 00:00:00 2001 From: toastal <561087+toastal@users.noreply.github.com> Date: Fri, 3 Nov 2023 19:42:04 +0000 Subject: [PATCH] =?UTF-8?q?ocamlPackages.eio:=200.12=20=E2=86=92=200.13=20?= =?UTF-8?q?(#265029)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit But hold onto 0.12 for OCaml 5.0 https://github.com/ocaml-multicore/eio/releases/tag/v0.13 --- .../development/ocaml-modules/eio/default.nix | 22 ++++++++++++++----- pkgs/development/ocaml-modules/eio/linux.nix | 1 - pkgs/development/ocaml-modules/eio/main.nix | 1 - pkgs/development/ocaml-modules/eio/posix.nix | 1 - 4 files changed, 17 insertions(+), 8 deletions(-) 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;