about summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/ocaml-modules')
-rw-r--r--pkgs/development/ocaml-modules/arp/default.nix4
-rw-r--r--pkgs/development/ocaml-modules/bdd/default.nix36
-rw-r--r--pkgs/development/ocaml-modules/bisect_ppx/default.nix16
-rw-r--r--pkgs/development/ocaml-modules/class_group_vdf/default.nix9
-rw-r--r--pkgs/development/ocaml-modules/cohttp/default.nix6
-rw-r--r--pkgs/development/ocaml-modules/cohttp/lwt-jsoo.nix31
-rw-r--r--pkgs/development/ocaml-modules/cohttp/top.nix16
-rw-r--r--pkgs/development/ocaml-modules/conduit/async.nix2
-rw-r--r--pkgs/development/ocaml-modules/dates_calc/default.nix33
-rw-r--r--pkgs/development/ocaml-modules/facile/default.nix7
-rw-r--r--pkgs/development/ocaml-modules/gsl/default.nix39
-rw-r--r--pkgs/development/ocaml-modules/hack_parallel/default.nix4
-rw-r--r--pkgs/development/ocaml-modules/janestreet/0.12.nix12
-rw-r--r--pkgs/development/ocaml-modules/janestreet/default.nix12
-rw-r--r--pkgs/development/ocaml-modules/janestreet/janePackage.nix2
-rw-r--r--pkgs/development/ocaml-modules/janestreet/janePackage_0_12.nix2
-rw-r--r--pkgs/development/ocaml-modules/lablgl/default.nix11
-rw-r--r--pkgs/development/ocaml-modules/lwt/camlp4.nix3
-rw-r--r--pkgs/development/ocaml-modules/lwt/default.nix7
-rw-r--r--pkgs/development/ocaml-modules/mdx/default.nix4
-rw-r--r--pkgs/development/ocaml-modules/morbig/default.nix35
-rw-r--r--pkgs/development/ocaml-modules/nonstd/default.nix7
-rw-r--r--pkgs/development/ocaml-modules/ocaml-migrate-parsetree/1.8.x.nix2
-rw-r--r--pkgs/development/ocaml-modules/ocplib-endian/default.nix7
-rw-r--r--pkgs/development/ocaml-modules/ppx_monad/default.nix32
-rw-r--r--pkgs/development/ocaml-modules/ppx_tools_versioned/default.nix2
-rw-r--r--pkgs/development/ocaml-modules/slug/default.nix34
-rw-r--r--pkgs/development/ocaml-modules/tcpip/default.nix1
-rw-r--r--pkgs/development/ocaml-modules/unisim_archisec/default.nix21
-rw-r--r--pkgs/development/ocaml-modules/uring/default.nix53
30 files changed, 384 insertions, 66 deletions
diff --git a/pkgs/development/ocaml-modules/arp/default.nix b/pkgs/development/ocaml-modules/arp/default.nix
index 63c1e090662cb..7184ef49bc1e8 100644
--- a/pkgs/development/ocaml-modules/arp/default.nix
+++ b/pkgs/development/ocaml-modules/arp/default.nix
@@ -1,4 +1,5 @@
 { lib
+, stdenv
 , buildDunePackage
 , fetchurl
 , cstruct
@@ -48,7 +49,8 @@ buildDunePackage rec {
     mirage-time
   ];
 
-  doCheck = true;
+  ## NOTE: As of 18 april 2023 and ARP version 3.0.0, tests fail on Darwin.
+  doCheck = ! stdenv.isDarwin;
   checkInputs = [
     alcotest
     mirage-clock-unix
diff --git a/pkgs/development/ocaml-modules/bdd/default.nix b/pkgs/development/ocaml-modules/bdd/default.nix
new file mode 100644
index 0000000000000..358d92d3505dc
--- /dev/null
+++ b/pkgs/development/ocaml-modules/bdd/default.nix
@@ -0,0 +1,36 @@
+{ lib
+, buildDunePackage
+, fetchFromGitHub
+, stdlib-shims
+}:
+
+buildDunePackage {
+  pname = "bdd";
+  version = "unstable-2022-07-14";
+
+  duneVersion = "3";
+
+  src = fetchFromGitHub {
+    owner = "backtracking";
+    repo = "ocaml-bdd";
+    rev = "6d1b1d3c24e5784b87e599a00230ce652acb2dcc";
+    hash = "sha256-3mJZlAFQsI7AgrNQOe6N94CDfX5gXYqQBooV0jcoYEA=";
+  };
+
+  # Fix build with OCaml 4.02
+  postPatch = ''
+    substituteInPlace lib/bdd.ml \
+      --replace "Buffer.truncate Format.stdbuf 0;" "Buffer.clear Format.stdbuf;"
+  '';
+
+  propagatedBuildInputs = [
+    stdlib-shims
+  ];
+
+  meta = with lib; {
+    description = "Quick implementation of a Binary Decision Diagrams (BDD) library for OCaml";
+    homepage = "https://github.com/backtracking/ocaml-bdd";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ wegank ];
+  };
+}
diff --git a/pkgs/development/ocaml-modules/bisect_ppx/default.nix b/pkgs/development/ocaml-modules/bisect_ppx/default.nix
index 4ecfea79e155f..3e581b4b86615 100644
--- a/pkgs/development/ocaml-modules/bisect_ppx/default.nix
+++ b/pkgs/development/ocaml-modules/bisect_ppx/default.nix
@@ -2,31 +2,27 @@
 
 buildDunePackage rec {
   pname = "bisect_ppx";
-  version = "2.8.1";
+  version = "2.8.2";
 
   src = fetchFromGitHub {
     owner = "aantron";
     repo = "bisect_ppx";
     rev = version;
-    sha256 = "sha256-pOeeSxzUF1jXQjA71atSZALdgQ2NB9qpKo5iaDnPwhQ=";
+    hash = "sha256-Uc5ZYL6tORcCCvCe9UmOnBF68FqWpQ4bc48fTQwnfis=";
   };
 
-  patches = lib.optionals (lib.versionAtLeast ppxlib.version "0.26.0") [
-    # Ppxlib >= 0.26.0 compatibility
+  patches = [
+    # Ppxlib >= 0.28.0 compatibility
     # remove when a new version is released
     (fetchpatch {
-      name = "${pname}-${version}-ppxlib-0.26-compatibility.patch";
-      url = "https://patch-diff.githubusercontent.com/raw/aantron/bisect_ppx/pull/400.patch";
-      sha256 = "sha256-WAn6+d6pMUr79LVugOENuh9s0gbVEcTg0rxXMz1P3ak=";
-    })
-    (fetchpatch {
       name = "${pname}-${version}-ppxlib-0.28-compatibility.patch";
       url = "https://github.com/anmonteiro/bisect_ppx/commit/cc442a08e3a2e0e18deb48f3a696076ac0986728.patch";
       sha256 = "sha256-pPHhmtd81eWhQd4X0gfZNPYT75+EkurwivP7acfJbNc=";
     })
   ];
 
-  minimalOCamlVersion = "4.08";
+  minimalOCamlVersion = "4.11";
+  duneVersion = "3";
 
   buildInputs = [
     cmdliner
diff --git a/pkgs/development/ocaml-modules/class_group_vdf/default.nix b/pkgs/development/ocaml-modules/class_group_vdf/default.nix
index f59ad1448a9f6..57f8023f79f15 100644
--- a/pkgs/development/ocaml-modules/class_group_vdf/default.nix
+++ b/pkgs/development/ocaml-modules/class_group_vdf/default.nix
@@ -4,7 +4,7 @@
 , alcotest, bisect_ppx
 }:
 
-buildDunePackage rec {
+buildDunePackage (rec {
   pname = "class_group_vdf";
   version = "0.0.4";
   duneVersion = "3";
@@ -43,8 +43,13 @@ buildDunePackage rec {
   meta = {
     description = "Verifiable Delay Functions bindings to Chia's VDF";
     homepage = "https://gitlab.com/nomadic-labs/tezos";
-    broken = stdenv.isDarwin && stdenv.isx86_64;
     license = lib.licenses.mit;
     maintainers = [ lib.maintainers.ulrikstrid ];
   };
 }
+# Darwin sdk on intel target 10.12 (2016) at the time of writing. It is likely that host will be at least 10.14 (2018). This fix allow it to build and run on 10.14 and build on 10.12 (but don't run).
+// lib.optionalAttrs (lib.versionOlder stdenv.hostPlatform.darwinMinVersion "10.14" && stdenv.hostPlatform.isMacOS && stdenv.hostPlatform.isx86_64) {
+  preHook = ''
+    export MACOSX_DEPLOYMENT_TARGET=10.14
+  '';
+})
diff --git a/pkgs/development/ocaml-modules/cohttp/default.nix b/pkgs/development/ocaml-modules/cohttp/default.nix
index fcbed191ad6f2..4747b7b8ef4c7 100644
--- a/pkgs/development/ocaml-modules/cohttp/default.nix
+++ b/pkgs/development/ocaml-modules/cohttp/default.nix
@@ -6,14 +6,14 @@
 
 buildDunePackage rec {
   pname = "cohttp";
-  version = "5.0.0";
+  version = "5.1.0";
 
   minimalOCamlVersion = "4.08";
   duneVersion = "3";
 
   src = fetchurl {
-    url = "https://github.com/mirage/ocaml-cohttp/releases/download/v${version}/cohttp-${version}.tbz";
-    sha256 = "sha256-/W/0uGyBg1XWGzoIYoWW2/UX1qfabo7exIG7BlPKWgU=";
+    url = "https://github.com/mirage/ocaml-cohttp/releases/download/v${version}/cohttp-v${version}.tbz";
+    sha256 = "sha256-mINgeBO7DSsWd84gYjQNUQFqbh8KBZ+S2bYI/iVWMAc=";
   };
 
   buildInputs = [ jsonm ppx_sexp_conv ];
diff --git a/pkgs/development/ocaml-modules/cohttp/lwt-jsoo.nix b/pkgs/development/ocaml-modules/cohttp/lwt-jsoo.nix
new file mode 100644
index 0000000000000..611abb7751ba7
--- /dev/null
+++ b/pkgs/development/ocaml-modules/cohttp/lwt-jsoo.nix
@@ -0,0 +1,31 @@
+{ lib, buildDunePackage
+, cohttp, cohttp-lwt, logs, lwt, js_of_ocaml, js_of_ocaml-ppx, js_of_ocaml-lwt
+, nodejs, lwt_ppx
+}:
+
+buildDunePackage {
+  pname = "cohttp-lwt-jsoo";
+  inherit (cohttp-lwt) version src;
+
+  duneVersion = "3";
+
+  propagatedBuildInputs = [
+    cohttp
+    cohttp-lwt
+    logs
+    lwt
+    js_of_ocaml
+    js_of_ocaml-ppx
+    js_of_ocaml-lwt
+  ];
+
+  doCheck = true;
+  checkInputs = [
+    nodejs
+    lwt_ppx
+  ];
+
+  meta = cohttp-lwt.meta // {
+    description = "CoHTTP implementation for the Js_of_ocaml JavaScript compiler";
+  };
+}
diff --git a/pkgs/development/ocaml-modules/cohttp/top.nix b/pkgs/development/ocaml-modules/cohttp/top.nix
new file mode 100644
index 0000000000000..0a8f54871b1b7
--- /dev/null
+++ b/pkgs/development/ocaml-modules/cohttp/top.nix
@@ -0,0 +1,16 @@
+{ lib, buildDunePackage, cohttp }:
+
+buildDunePackage {
+  pname = "cohttp-top";
+  inherit (cohttp) version src;
+
+  duneVersion = "3";
+
+  propagatedBuildInputs = [ cohttp ];
+
+  doCheck = true;
+
+  meta = cohttp.meta // {
+    description = "CoHTTP toplevel pretty printers for HTTP types";
+  };
+}
diff --git a/pkgs/development/ocaml-modules/conduit/async.nix b/pkgs/development/ocaml-modules/conduit/async.nix
index a110e6dc16775..249635d14bb81 100644
--- a/pkgs/development/ocaml-modules/conduit/async.nix
+++ b/pkgs/development/ocaml-modules/conduit/async.nix
@@ -1,4 +1,4 @@
-{ lib, buildDunePackage, async, async_ssl, ppx_sexp_conv, ppx_here, uri, conduit
+{ lib, buildDunePackage, async, async_ssl ? null, ppx_sexp_conv, ppx_here, uri, conduit
 , core, ipaddr, ipaddr-sexp, sexplib
 }:
 
diff --git a/pkgs/development/ocaml-modules/dates_calc/default.nix b/pkgs/development/ocaml-modules/dates_calc/default.nix
new file mode 100644
index 0000000000000..4a2b9f176822b
--- /dev/null
+++ b/pkgs/development/ocaml-modules/dates_calc/default.nix
@@ -0,0 +1,33 @@
+{ lib, fetchFromGitHub, buildDunePackage
+, alcotest, qcheck
+}:
+
+buildDunePackage rec {
+  pname = "dates_calc";
+  version = "0.0.4";
+
+  minimalOCamlVersion = "4.11";
+  duneVersion = "3";
+
+  src = fetchFromGitHub {
+    owner = "catalalang";
+    repo = "dates-calc";
+    rev = version;
+    sha256 = "sha256-tpKOoPVXkg/k+NW5R8A4fGAKhdMn9UcqMogCjafJuw4=";
+  };
+
+  propagatedBuildInputs = [];
+
+  doCheck = true;
+  checkInputs = [
+    alcotest
+    qcheck
+  ];
+
+  meta = {
+    description = "A date calculation library";
+    license = lib.licenses.asl20;
+    maintainers = [ lib.maintainers.niols ];
+    homepage = "https://github.com/catalalang/dates-calc";
+  };
+}
diff --git a/pkgs/development/ocaml-modules/facile/default.nix b/pkgs/development/ocaml-modules/facile/default.nix
index 3eab7d3417fcf..488a7d151d1b1 100644
--- a/pkgs/development/ocaml-modules/facile/default.nix
+++ b/pkgs/development/ocaml-modules/facile/default.nix
@@ -1,5 +1,8 @@
 { lib, fetchurl, buildDunePackage, ocaml }:
 
+lib.throwIf (lib.versionAtLeast ocaml.version "5.0")
+  "facile is not available for OCaml ≥ 5.0"
+
 buildDunePackage rec {
   pname = "facile";
   version = "1.1.4";
@@ -11,8 +14,8 @@ buildDunePackage rec {
 
   doCheck = true;
 
-  useDune2 = lib.versionAtLeast ocaml.version "4.12";
-  postPatch = lib.optionalString useDune2 "dune upgrade";
+  duneVersion = if lib.versionAtLeast ocaml.version "4.12" then "2" else "1";
+  postPatch = lib.optionalString (duneVersion != "1") "dune upgrade";
 
   meta = {
     homepage = "http://opti.recherche.enac.fr/facile/";
diff --git a/pkgs/development/ocaml-modules/gsl/default.nix b/pkgs/development/ocaml-modules/gsl/default.nix
index 4588d0c04b047..02a49fd71773f 100644
--- a/pkgs/development/ocaml-modules/gsl/default.nix
+++ b/pkgs/development/ocaml-modules/gsl/default.nix
@@ -1,18 +1,43 @@
-{ lib, stdenv, fetchurl, buildDunePackage, pkg-config, gsl, darwin, dune-configurator }:
+{ lib, stdenv, fetchFromGitHub, fetchpatch, buildDunePackage, pkg-config, gsl, darwin, dune-configurator }:
 
 buildDunePackage rec {
   pname = "gsl";
   version = "1.24.3";
 
-  useDune2 = true;
+  minimalOCamlVersion = "4.12";
 
-  minimumOCamlVersion = "4.08";
-
-  src = fetchurl {
-    url = "https://github.com/mmottl/gsl-ocaml/releases/download/${version}/gsl-${version}.tbz";
-    sha256 = "1mpzcgbrha2l8iikqbmn32668v2mnnsykxg5n5jgs0qnskn2nvrn";
+  src = fetchFromGitHub {
+    owner = "mmottl";
+    repo = "gsl-ocaml";
+    rev = version;
+    hash = "sha256-I+u7lFEredt8ZLiba8x904eTgSUdZq82/e82B+/GIlo=";
   };
 
+  patches = [
+    # Switched to Dune lang 2.7
+    (fetchpatch {
+      url = "https://github.com/mmottl/gsl-ocaml/commit/be0f6933f16fea6d6fb2e39178816974be4c3724.patch";
+      sha256 = "sha256-G/4JT8XPYw+oNJEwJ9zRdUBwtNUHL+T8/htCb3qfuT8=";
+    })
+    # Fix dune rules
+    (fetchpatch {
+      url = "https://github.com/mmottl/gsl-ocaml/commit/0b38a22d9813de27eab5caafafeabd945f298b5e.patch";
+      sha256 = "sha256-S6OUDase2kR7V6fizaev5huqEAIM5QOkx3n18rj4y3w=";
+    })
+    # Updated opam file
+    (fetchpatch {
+      url = "https://github.com/mmottl/gsl-ocaml/commit/b749455b76501c9e3623e05d659565eab7292602.patch";
+      sha256 = "sha256-/GACjI3cRCApyGyk1kQp0rB/Hae8DIR9zs6q9KiS1ZQ=";
+    })
+    # Used new OCaml 4.12 C-macros
+    (fetchpatch {
+      url = "https://github.com/mmottl/gsl-ocaml/commit/cca79ea56a7ee83a4c67b432decdaef3de8c9d30.patch";
+      sha256 = "sha256-bsIKkvj9W8oAYSvP6ZfbqSgt5fSirc780O08WBhVRmI=";
+    })
+  ];
+
+  duneVersion = "3";
+
   nativeBuildInputs = [ pkg-config ];
   buildInputs = [ dune-configurator gsl ];
   propagatedBuildInputs = lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Accelerate ];
diff --git a/pkgs/development/ocaml-modules/hack_parallel/default.nix b/pkgs/development/ocaml-modules/hack_parallel/default.nix
index afd49b8716562..6ce3288f647b9 100644
--- a/pkgs/development/ocaml-modules/hack_parallel/default.nix
+++ b/pkgs/development/ocaml-modules/hack_parallel/default.nix
@@ -3,8 +3,8 @@
 buildDunePackage rec {
   pname = "hack_parallel";
   version = "1.0.1";
-  useDune2 = true;
-  minimumOcamlVersion = "4.04.1";
+  duneVersion = "3";
+  minimalOCamlVersion = "4.08";
 
   src = fetchFromGitHub {
     owner = "rvantonder";
diff --git a/pkgs/development/ocaml-modules/janestreet/0.12.nix b/pkgs/development/ocaml-modules/janestreet/0.12.nix
index c3b4b0c6d7051..8d7943af42b6d 100644
--- a/pkgs/development/ocaml-modules/janestreet/0.12.nix
+++ b/pkgs/development/ocaml-modules/janestreet/0.12.nix
@@ -377,18 +377,6 @@ with self;
     propagatedBuildInputs = [ async_extra textutils ];
   };
 
-  async_ssl = janePackage {
-    pname = "async_ssl";
-    hash = "02ard8x5q5c42d9jdqmyzfx624yjq8cxxmvq3zb82hf6p8cc57ml";
-    meta = {
-      description = "An Async-pipe-based interface with OpenSSL";
-      # ctypes no longer works with dune 1
-      # dune 2 no longer supports jbuild
-      broken = true;
-    };
-    propagatedBuildInputs = [ async ctypes openssl ];
-  };
-
   async_find = janePackage {
     pname = "async_find";
     hash = "0qsz9f15s5rlk6za10s810v6nlkdxg2g9p1827lcpa7nhjcpi673";
diff --git a/pkgs/development/ocaml-modules/janestreet/default.nix b/pkgs/development/ocaml-modules/janestreet/default.nix
index ee906a7225017..b0ab637bfba39 100644
--- a/pkgs/development/ocaml-modules/janestreet/default.nix
+++ b/pkgs/development/ocaml-modules/janestreet/default.nix
@@ -413,18 +413,6 @@ with self;
     meta.description = "Shell helpers for Async";
   };
 
-  async_ssl = janePackage {
-    pname = "async_ssl";
-    hash = "1p83fzfla4rb820irdrz3f2hp8kq5zrhw47rqmfv6qydlca1bq64";
-    propagatedBuildInputs = [ async ctypes openssl ];
-    meta = {
-      description = "Async wrappers for SSL";
-      # ctypes no longer works with dune 1
-      # dune 2 no longer supports jbuild
-      broken = true;
-    };
-  };
-
   sexp_pretty = janePackage {
     pname = "sexp_pretty";
     hash = "0xskahjggbwvvb82fn0jp1didxbgpmgks76xhwp9s3vqkhgz6918";
diff --git a/pkgs/development/ocaml-modules/janestreet/janePackage.nix b/pkgs/development/ocaml-modules/janestreet/janePackage.nix
index 9552268abc2e0..f4cef99046adf 100644
--- a/pkgs/development/ocaml-modules/janestreet/janePackage.nix
+++ b/pkgs/development/ocaml-modules/janestreet/janePackage.nix
@@ -5,7 +5,7 @@
 buildDunePackage (args // {
   inherit version buildInputs;
 
-  useDune2 = false;
+  duneVersion = "1";
 
   minimalOCamlVersion = "4.04";
 
diff --git a/pkgs/development/ocaml-modules/janestreet/janePackage_0_12.nix b/pkgs/development/ocaml-modules/janestreet/janePackage_0_12.nix
index d61f1b6d41c2d..5ab455ddff3e7 100644
--- a/pkgs/development/ocaml-modules/janestreet/janePackage_0_12.nix
+++ b/pkgs/development/ocaml-modules/janestreet/janePackage_0_12.nix
@@ -5,7 +5,7 @@
 buildDunePackage (args // {
   inherit version;
 
-  useDune2 = false;
+  duneVersion = "1";
 
   minimalOCamlVersion = "4.07";
 
diff --git a/pkgs/development/ocaml-modules/lablgl/default.nix b/pkgs/development/ocaml-modules/lablgl/default.nix
index 55dd88d7246b8..cb885b7b069c7 100644
--- a/pkgs/development/ocaml-modules/lablgl/default.nix
+++ b/pkgs/development/ocaml-modules/lablgl/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchFromGitHub, ocaml, findlib, libGLU, libGL, freeglut } :
+{ lib, stdenv, fetchFromGitHub, ocaml, findlib, libGLU, libGL, freeglut, darwin } :
 
 if lib.versionOlder ocaml.version "4.03"
 then throw "lablgl is not available for OCaml ${ocaml.version}"
@@ -19,7 +19,13 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ ocaml findlib ];
   buildInputs = [ freeglut ];
-  propagatedBuildInputs = [ libGLU libGL ];
+  propagatedBuildInputs = [
+    libGLU
+    libGL
+  ] ++ lib.optionals stdenv.isDarwin [
+    darwin.apple_sdk.frameworks.GLUT
+    darwin.apple_sdk.libs.Xplugin
+  ];
 
   patches = [ ./Makefile.config.patch ./META.patch ];
 
@@ -46,6 +52,5 @@ stdenv.mkDerivation rec {
     license = licenses.gpl2;
     maintainers = with maintainers; [ pSub vbgl ];
     mainProgram = "lablglut";
-    broken = stdenv.isDarwin;
   };
 }
diff --git a/pkgs/development/ocaml-modules/lwt/camlp4.nix b/pkgs/development/ocaml-modules/lwt/camlp4.nix
index e48d7cfa185a8..de8252c55549b 100644
--- a/pkgs/development/ocaml-modules/lwt/camlp4.nix
+++ b/pkgs/development/ocaml-modules/lwt/camlp4.nix
@@ -11,10 +11,11 @@ buildDunePackage rec {
     sha256 = "1lv8z6ljfy47yvxmwf5jrvc5d3dc90r1n291x53j161sf22ddrk9";
   };
 
-  useDune2 = false;
+  duneVersion = "1";
 
   minimalOCamlVersion = "4.02";
 
+  nativeBuildInputs = [ camlp4 ];
   propagatedBuildInputs = [ camlp4 ];
 
   preBuild = "rm META.lwt_camlp4";
diff --git a/pkgs/development/ocaml-modules/lwt/default.nix b/pkgs/development/ocaml-modules/lwt/default.nix
index 8004cfcd4bb42..cf631fd08e415 100644
--- a/pkgs/development/ocaml-modules/lwt/default.nix
+++ b/pkgs/development/ocaml-modules/lwt/default.nix
@@ -1,5 +1,5 @@
 { lib, fetchFromGitHub, libev, buildDunePackage
-, cppo, dune-configurator, ocplib-endian
+, ocaml, cppo, dune-configurator, ocplib-endian
 }:
 
 buildDunePackage rec {
@@ -15,6 +15,11 @@ buildDunePackage rec {
     sha256 = "sha256-XstKs0tMwliCyXnP0Vzi5WC27HKJGnATUYtbbQmH1TE=";
   };
 
+  postPatch = lib.optionalString (lib.versionAtLeast ocaml.version "5.0") ''
+    substituteInPlace src/unix/dune \
+      --replace "libraries bigarray lwt" "libraries lwt"
+  '';
+
   nativeBuildInputs = [ cppo ];
   buildInputs = [ dune-configurator ];
   propagatedBuildInputs = [ libev ocplib-endian ];
diff --git a/pkgs/development/ocaml-modules/mdx/default.nix b/pkgs/development/ocaml-modules/mdx/default.nix
index 02ef06044457a..85a1a798b4782 100644
--- a/pkgs/development/ocaml-modules/mdx/default.nix
+++ b/pkgs/development/ocaml-modules/mdx/default.nix
@@ -6,14 +6,14 @@
 
 buildDunePackage rec {
   pname = "mdx";
-  version = "2.2.1";
+  version = "2.3.0";
 
   minimalOCamlVersion = "4.08";
   duneVersion = "3";
 
   src = fetchurl {
     url = "https://github.com/realworldocaml/mdx/releases/download/${version}/mdx-${version}.tbz";
-    hash = "sha256-8J7XM/5EYWBfApdzdIpjU9Ablb5l65hrzOF9bdr1Cdg=";
+    hash = "sha256-MqCDmBAK/S0ueYi8O0XJtplxJx96twiFHe04Q8lHBmE=";
   };
 
   nativeBuildInputs = [ cppo ];
diff --git a/pkgs/development/ocaml-modules/morbig/default.nix b/pkgs/development/ocaml-modules/morbig/default.nix
new file mode 100644
index 0000000000000..013fa2e233a1b
--- /dev/null
+++ b/pkgs/development/ocaml-modules/morbig/default.nix
@@ -0,0 +1,35 @@
+{ lib, buildDunePackage, fetchFromGitHub
+, menhir, menhirLib, ppx_deriving_yojson, visitors, yojson
+}:
+
+buildDunePackage rec {
+  pname = "morbig";
+  version = "0.11.0";
+
+  src = fetchFromGitHub {
+    owner = "colis-anr";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-fOBaJHHP/Imi9UDLflI52OdKDcmMxpl+NH3pfofmv/o=";
+  };
+
+  duneVersion = "3";
+
+  nativeBuildInputs = [
+    menhir
+  ];
+
+  propagatedBuildInputs = [
+    menhirLib
+    ppx_deriving_yojson
+    visitors
+    yojson
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/colis-anr/${pname}";
+    description = "A static parser for POSIX Shell";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ niols ];
+  };
+}
diff --git a/pkgs/development/ocaml-modules/nonstd/default.nix b/pkgs/development/ocaml-modules/nonstd/default.nix
index 696cdff52196a..748196bf28e26 100644
--- a/pkgs/development/ocaml-modules/nonstd/default.nix
+++ b/pkgs/development/ocaml-modules/nonstd/default.nix
@@ -1,5 +1,8 @@
 { lib, fetchzip, buildDunePackage, ocaml }:
 
+lib.throwIf (lib.versionAtLeast ocaml.version "5.0")
+  "nonstd is not available for OCaml ≥ 5.0"
+
 buildDunePackage rec {
   pname = "nonstd";
   version = "0.0.3";
@@ -11,8 +14,8 @@ buildDunePackage rec {
     sha256 = "0ccjwcriwm8fv29ij1cnbc9win054kb6pfga3ygzdbjpjb778j46";
   };
 
-  useDune2 = lib.versionAtLeast ocaml.version "4.12";
-  postPatch = lib.optionalString useDune2 "dune upgrade";
+  duneVersion = if lib.versionAtLeast ocaml.version "4.12" then "2" else "1";
+  postPatch = lib.optionalString (duneVersion != "1") "dune upgrade";
   doCheck = true;
 
   meta = with lib; {
diff --git a/pkgs/development/ocaml-modules/ocaml-migrate-parsetree/1.8.x.nix b/pkgs/development/ocaml-modules/ocaml-migrate-parsetree/1.8.x.nix
index 009d95992fb74..daed1a7fbffbf 100644
--- a/pkgs/development/ocaml-modules/ocaml-migrate-parsetree/1.8.x.nix
+++ b/pkgs/development/ocaml-modules/ocaml-migrate-parsetree/1.8.x.nix
@@ -8,7 +8,7 @@ buildDunePackage rec {
    pname = "ocaml-migrate-parsetree";
    version = "1.8.0";
 
-   useDune2 = lib.versionAtLeast ocaml.version "4.08";
+   duneVersion = if lib.versionAtLeast ocaml.version "4.08" then "3" else "1";
 
    src = fetchFromGitHub {
      owner = "ocaml-ppx";
diff --git a/pkgs/development/ocaml-modules/ocplib-endian/default.nix b/pkgs/development/ocaml-modules/ocplib-endian/default.nix
index 1e657fce8dd11..285e8de84b397 100644
--- a/pkgs/development/ocaml-modules/ocplib-endian/default.nix
+++ b/pkgs/development/ocaml-modules/ocplib-endian/default.nix
@@ -1,4 +1,4 @@
-{ lib, buildDunePackage, fetchFromGitHub, cppo }:
+{ lib, buildDunePackage, fetchFromGitHub, ocaml, cppo }:
 
 buildDunePackage rec {
   version = "1.2";
@@ -11,6 +11,11 @@ buildDunePackage rec {
     sha256 = "sha256-THTlhOfXAPaqTt1qBkht+D67bw6M175QLvXoUMgjks4=";
   };
 
+  postPatch = lib.optionalString (lib.versionAtLeast ocaml.version "5.0") ''
+    substituteInPlace src/dune \
+      --replace "libraries ocplib_endian bigarray" "libraries ocplib_endian"
+  '';
+
   minimalOCamlVersion = "4.03";
 
   nativeBuildInputs = [ cppo ];
diff --git a/pkgs/development/ocaml-modules/ppx_monad/default.nix b/pkgs/development/ocaml-modules/ppx_monad/default.nix
new file mode 100644
index 0000000000000..6c71dcb26c5f4
--- /dev/null
+++ b/pkgs/development/ocaml-modules/ppx_monad/default.nix
@@ -0,0 +1,32 @@
+{ lib, fetchFromGitHub, buildDunePackage
+, ppxlib
+}:
+
+buildDunePackage rec {
+  pname = "ppx_monad";
+  version = "0.2.0";
+
+  duneVersion = "3";
+
+  src = fetchFromGitHub {
+    owner = "niols";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-cbguAddSlUxBK7pmT7vNmtJW9TrVZZjdSJRMT3lqxOA=";
+  };
+
+  propagatedBuildInputs = [
+    ppxlib
+  ];
+
+  doCheck = true;
+  checkInputs = [
+  ];
+
+  meta = {
+    description = "An OCaml Syntax Extension for all Monadic Syntaxes";
+    license = lib.licenses.lgpl3Plus;
+    maintainers = [ lib.maintainers.niols ];
+    homepage = "https://github.com/niols/${pname}";
+  };
+}
diff --git a/pkgs/development/ocaml-modules/ppx_tools_versioned/default.nix b/pkgs/development/ocaml-modules/ppx_tools_versioned/default.nix
index 59ac187a67184..78915135a0c71 100644
--- a/pkgs/development/ocaml-modules/ppx_tools_versioned/default.nix
+++ b/pkgs/development/ocaml-modules/ppx_tools_versioned/default.nix
@@ -4,7 +4,7 @@ buildDunePackage rec {
   pname = "ppx_tools_versioned";
   version = "5.4.0";
 
-  useDune2 = true;
+  duneVersion = "3";
 
   src = fetchFromGitHub {
     owner = "ocaml-ppx";
diff --git a/pkgs/development/ocaml-modules/slug/default.nix b/pkgs/development/ocaml-modules/slug/default.nix
new file mode 100644
index 0000000000000..2ae81209b5496
--- /dev/null
+++ b/pkgs/development/ocaml-modules/slug/default.nix
@@ -0,0 +1,34 @@
+{ lib, fetchFromGitHub, buildDunePackage
+, re, uunf, uuseg
+, alcotest
+}:
+
+buildDunePackage rec {
+  pname = "slug";
+  version = "1.0.1";
+
+  duneVersion = "3";
+
+  src = fetchFromGitHub {
+    owner = "thangngoc89";
+    repo = "ocaml-slug";
+    rev = version;
+    sha256 = "sha256-pIk/0asSyibXbwmBSBuLwl2SS9aw6dNDDvwO+1VJGf8=";
+  };
+
+  propagatedBuildInputs = [
+    re
+    uunf
+    uuseg
+  ];
+
+  doCheck = true;
+  checkInputs = [ alcotest ];
+
+  meta = {
+    description = "Url safe slug generator for OCaml";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.niols ];
+    homepage = "https://github.com/thangngoc89/ocaml-slug";
+  };
+}
diff --git a/pkgs/development/ocaml-modules/tcpip/default.nix b/pkgs/development/ocaml-modules/tcpip/default.nix
index 90100c2d5b57d..30710bfae2650 100644
--- a/pkgs/development/ocaml-modules/tcpip/default.nix
+++ b/pkgs/development/ocaml-modules/tcpip/default.nix
@@ -63,6 +63,7 @@ buildDunePackage rec {
     mirage-clock-unix
     ipaddr-cstruct
   ];
+  __darwinAllowLocalNetworking = true;
 
   meta = with lib; {
     description = "OCaml TCP/IP networking stack, used in MirageOS";
diff --git a/pkgs/development/ocaml-modules/unisim_archisec/default.nix b/pkgs/development/ocaml-modules/unisim_archisec/default.nix
new file mode 100644
index 0000000000000..a5b364312d417
--- /dev/null
+++ b/pkgs/development/ocaml-modules/unisim_archisec/default.nix
@@ -0,0 +1,21 @@
+{ lib, buildDunePackage, fetchurl }:
+
+buildDunePackage rec {
+  pname = "unisim_archisec";
+  version = "0.0.5";
+
+  src = fetchurl {
+    url = "https://github.com/binsec/unisim_archisec/releases/download/0.0.5/unisim_archisec-0.0.5.tbz";
+    sha256 = "sha256-94Ky7rtR8oFTtWshTYaY6gyJdqrY3QKMF7qTkZQweXQ=";
+  };
+
+  duneVersion = "3";
+
+  meta = {
+    homepage = "https://binsec.github.io";
+    downloadPage = "https://github.com/binsec/unisim_archisec";
+    description = "UNISIM-VP DBA decoder";
+    license = lib.licenses.bsd3;
+    maintainers = [ lib.maintainers.david-hamelin ];
+  };
+}
diff --git a/pkgs/development/ocaml-modules/uring/default.nix b/pkgs/development/ocaml-modules/uring/default.nix
new file mode 100644
index 0000000000000..b6cc3e4c99453
--- /dev/null
+++ b/pkgs/development/ocaml-modules/uring/default.nix
@@ -0,0 +1,53 @@
+{ lib
+, buildDunePackage
+, cstruct
+, dune-configurator
+, fetchurl
+, fmt
+, optint
+, mdx
+}:
+
+buildDunePackage rec {
+  pname = "uring";
+  version = "0.5";
+
+  minimalOCamlVersion = "4.12";
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/ocaml-multicore/ocaml-uring/releases/download/v${version}/${pname}-${version}.tbz";
+    sha256 = "106w7mabqihdhj4csk9jfqag220rwhqdp5lapn0xmw2035scvxvk";
+  };
+
+  propagatedBuildInputs = [
+    cstruct
+    fmt
+    optint
+  ];
+
+  buildInputs = [
+    dune-configurator
+  ];
+
+  checkInputs = [
+    mdx
+  ];
+
+  nativeCheckInputs = [
+    mdx.bin
+  ];
+
+  doCheck = true;
+
+  dontStrip = true;
+
+  meta = {
+    homepage = "https://github.com/ocaml-multicore/ocaml-${pname}";
+    changelog = "https://github.com/ocaml-multicore/ocaml-${pname}/raw/v${version}/CHANGES.md";
+    description = "Bindings to io_uring for OCaml";
+    license = with lib.licenses; [ isc mit ];
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ toastal ];
+  };
+}