Subject: [PATCH 5/5] gnu: ocaml-eio: Update to 0.12.

From: Benjamin <[email-masked]>
Date: Sun, 14 Jul 2024 13:49:52 +0200

* gnu/packages/ocaml.scm (ocaml-eio): Update to 0.12.
[propagated-inputs]: Remove ocaml-lwt, ocaml-logs, and ocaml-odoc; add
ocaml-domain-local-await.
[native-inputs]: Remove ocaml-astring and ocaml-alcotest; add ocaml-odoc.
* gnu/packages/ocaml.scm (ocaml-eio-luv): Remove ocaml-eio-luv.
* gnu/packages/ocaml.scm (ocaml-eio-main): Update to 0.12.

Change-Id: I0445cb1d181deacda827516c9b42104aa77bcad0
---
 gnu/packages/ocaml.scm | 56 +++++++++++++++++-------------------------
 1 file changed, 23 insertions(+), 33 deletions(-)

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 0660c3d3d4..01f5d57faf 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -3207,7 +3207,7 @@ (define-public ocaml-domain-local-await
 (define ocaml-eio
   (package
     (name "ocaml-eio")
-    (version "0.8.1")
+    (version "0.12")
     (home-page "https://github.com/ocaml-multicore/eio")
     (source
      (origin
@@ -3217,24 +3217,21 @@ (define ocaml-eio
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256 (base32
-                "02q9i5wbb2497vd4ypc9d9p4zi3lmx0rsv8faiy7h8dnnzbjjf4z"))))
+                "1havn2h3c0748mj8ic7jn32kswb7sigavnbvxdqf37qn7cx91ilr"))))
     (build-system dune-build-system)
     (arguments `(#:package "eio"))
     (propagated-inputs (list ocaml-bigstringaf
                              ocaml-cstruct
-                             ocaml-lwt
+                             ocaml-domain-local-await
                              ocaml-lwt-dllist
-                             ocaml-logs
                              ocaml-optint
                              ocaml-psq
                              ocaml-fmt
                              ocaml-hmap
-                             ocaml-mtime
-                             ocaml-odoc))
-    (native-inputs (list ocaml-astring
-                         ocaml-crowbar
-                         ocaml-alcotest
-                         ocaml-mdx))
+                             ocaml-mtime))
+    (native-inputs (list ocaml-odoc
+                         ocaml-mdx
+                         ocaml-crowbar))
     (synopsis "Effect-based direct-style IO API for OCaml")
     (description "This package provides an effect-based IO API for multicore
 OCaml with fibers.")
@@ -3243,20 +3240,6 @@ (define ocaml-eio
 (define-public ocaml5.0-eio
   (package-with-ocaml5.0 ocaml-eio))
 
-(define ocaml-eio-luv
-  (package
-    (inherit ocaml-eio)
-    (name "ocaml-eio-luv")
-    (arguments `(#:package "eio_luv"))
-    (propagated-inputs (list ocaml-eio ocaml-luv))
-    (native-inputs (list ocaml-mdx))
-    (synopsis "Libuv-based backend for Ocaml Eio")
-    (description "@code{Eio_luv} provides a cross-platform backend for
-@code{Ocaml Eio}'s APIs using luv (libuv)")))
-
-(define-public ocaml5.0-eio-luv
-  (package-with-ocaml5.0 ocaml-eio-luv))
-
 (define-public ocaml-unionfind
   (package
     (name "ocaml-unionfind")
@@ -3320,16 +3303,24 @@ (define ocaml-eio-linux
   (package
     (inherit ocaml-eio)
     (name "ocaml-eio-linux")
-    (arguments `(#:package "eio_linux"))
+    (arguments `(
+       #:package "eio_linux"
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'fix-test-path
+                     (lambda* (#:key outputs #:allow-other-keys)
+                       (substitute* "lib_eio_linux/tests/spawn.md"
+                                    (("/usr/bin/env") (which "env"))))))))
     (propagated-inputs
-     (list ocaml-eio
-           ocaml-uring
+     (list ocaml-uring
+           ocaml-fmt
            ocaml-logs
-           ocaml-fmt))
+           ocaml-eio))
     (native-inputs
-     (list ocaml-mdx
-           ocaml-alcotest
-           ocaml-mdx))
+     (list ocaml-odoc
+           ocaml-cmdliner
+           ocaml-mdx
+           ocaml-alcotest))
     (synopsis "Linux backend for ocaml-eio")
     (description "@code{Eio_linux} provides a Linux io-uring backend for
 @code{Ocaml Eio} APIs, plus a low-level API that can be used directly
@@ -3347,10 +3338,9 @@ (define ocaml-eio-main
                  #:tests? #f))
     (propagated-inputs
      (list ocaml-eio
-           ocaml-eio-luv
            ocaml-eio-linux))
     (native-inputs
-     (list ocaml-mdx))
+     (list ocaml-odoc))
     (synopsis "Eio backend selector")
     (description "@code{Eio_main} selects an appropriate backend (e.g.
 @samp{eio_linux} or @samp{eio_luv}), depending on your platform.")))
-- 
2.45.2