From 2167711d5ef63b43388b45250a2f70ef94b724bf Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Mon, 6 Oct 2025 22:12:31 +0200 Subject: [PATCH 1/7] ocamlPackages.notty: fix for OCaml 5.4 --- pkgs/development/ocaml-modules/notty/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/development/ocaml-modules/notty/default.nix b/pkgs/development/ocaml-modules/notty/default.nix index 26ed24c5f322..1fb11ee9737e 100644 --- a/pkgs/development/ocaml-modules/notty/default.nix +++ b/pkgs/development/ocaml-modules/notty/default.nix @@ -2,6 +2,7 @@ lib, buildDunePackage, fetchurl, + fetchpatch, cppo, uutf, lwt, @@ -18,6 +19,12 @@ buildDunePackage rec { sha256 = "sha256-dGWfsUBz20Q4mJiRqyTyS++Bqkl9rBbZpn+aHJwgCCQ="; }; + # Compatibility with OCaml 5.4 + patches = fetchpatch { + url = "https://github.com/pqwy/notty/commit/a4d62f467e257196a5192da2184bd021dfd948b7.patch"; + hash = "sha256-p1eUuCvQKLj8uBeGyT2+i9WOYy4rk84pf9L3QioJDNY="; + }; + nativeBuildInputs = [ cppo ]; propagatedBuildInputs = [ From 1e55f8db32136bc8c286245bf5aeecacc8d1e741 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Mon, 6 Oct 2025 22:12:34 +0200 Subject: [PATCH 2/7] ocamlPackages.xtmpl_ppx: fix for OCaml 5.4 --- pkgs/development/ocaml-modules/xtmpl/ppx.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/development/ocaml-modules/xtmpl/ppx.nix b/pkgs/development/ocaml-modules/xtmpl/ppx.nix index 3206c31bac17..749a83bb6201 100644 --- a/pkgs/development/ocaml-modules/xtmpl/ppx.nix +++ b/pkgs/development/ocaml-modules/xtmpl/ppx.nix @@ -9,6 +9,12 @@ buildDunePackage { inherit (xtmpl) src version; + # Fix for ppxlib ≥ 0.37 + postPatch = '' + substituteInPlace ppx/ppx_xtmpl.ml --replace-fail 'Parse.longident b' \ + 'Astlib.Longident.parse s' + ''; + buildInputs = [ ppxlib xtmpl From 6f67b4d54dc614cd10d76dadde302120691bf155 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Mon, 6 Oct 2025 22:12:37 +0200 Subject: [PATCH 3/7] ocamlPackages.ocf_ppx: fix for OCaml 5.4 --- pkgs/development/ocaml-modules/ocf/ppx.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/development/ocaml-modules/ocf/ppx.nix b/pkgs/development/ocaml-modules/ocf/ppx.nix index a01c36942ea9..891bde287a9d 100644 --- a/pkgs/development/ocaml-modules/ocf/ppx.nix +++ b/pkgs/development/ocaml-modules/ocf/ppx.nix @@ -1,4 +1,5 @@ { + fetchpatch, buildDunePackage, ocf, ppxlib, @@ -10,7 +11,14 @@ buildDunePackage { inherit (ocf) src version; - duneVersion = "3"; + patches = [ + # Support for ppxlib ≥ 0.37 + (fetchpatch { + url = "https://framagit.org/zoggy/ocf/-/commit/38b1f6420e5c01b3ea6b2fed99b6b62e4c848dc0.patch"; + hash = "sha256-GymTdK/dOYGianvNIKkl9OhBGW+4dX5TqAkQuEF5FmA="; + includes = [ "*.ml" ]; + }) + ]; buildInputs = [ ppxlib From 904eda08ed23151982e9cec29b0bd5255a967ed9 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Mon, 6 Oct 2025 22:12:40 +0200 Subject: [PATCH 4/7] ocamlPackages.bistro: fix meta.broken --- pkgs/development/ocaml-modules/bistro/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/ocaml-modules/bistro/default.nix b/pkgs/development/ocaml-modules/bistro/default.nix index a861414c4a27..e717ae737d51 100644 --- a/pkgs/development/ocaml-modules/bistro/default.nix +++ b/pkgs/development/ocaml-modules/bistro/default.nix @@ -48,6 +48,6 @@ buildDunePackage rec { description = "Build and execute typed scientific workflows"; maintainers = [ lib.maintainers.vbgl ]; license = lib.licenses.gpl2; - meta.broken = lib.versionAtLeast ppxlib.version "0.36"; + broken = lib.versionAtLeast ppxlib.version "0.36"; }; } From 94f636550b55c81b8126468763cb131a48fde7df Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Mon, 6 Oct 2025 22:12:43 +0200 Subject: [PATCH 5/7] =?UTF-8?q?ocamlPackages.morbig:=20disable=20for=20OCa?= =?UTF-8?q?ml=20=E2=89=A5=205.4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ocaml-modules/morbig/default.nix | 55 ++++++++++--------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/pkgs/development/ocaml-modules/morbig/default.nix b/pkgs/development/ocaml-modules/morbig/default.nix index 76150f19cf18..5d95d4eaaf85 100644 --- a/pkgs/development/ocaml-modules/morbig/default.nix +++ b/pkgs/development/ocaml-modules/morbig/default.nix @@ -1,5 +1,6 @@ { lib, + ocaml, buildDunePackage, fetchFromGitHub, menhir, @@ -9,34 +10,36 @@ yojson, }: -buildDunePackage rec { - pname = "morbig"; - version = "0.11.0"; +lib.throwIf (lib.versionAtLeast ocaml.version "5.4") + "morbig is not available for OCaml ${ocaml.version}" - src = fetchFromGitHub { - owner = "colis-anr"; - repo = pname; - rev = "v${version}"; - sha256 = "sha256-fOBaJHHP/Imi9UDLflI52OdKDcmMxpl+NH3pfofmv/o="; - }; + buildDunePackage + rec { + pname = "morbig"; + version = "0.11.0"; - duneVersion = "3"; + src = fetchFromGitHub { + owner = "colis-anr"; + repo = pname; + rev = "v${version}"; + hash = "sha256-fOBaJHHP/Imi9UDLflI52OdKDcmMxpl+NH3pfofmv/o="; + }; - nativeBuildInputs = [ - menhir - ]; + nativeBuildInputs = [ + menhir + ]; - propagatedBuildInputs = [ - menhirLib - ppx_deriving_yojson - visitors - yojson - ]; + propagatedBuildInputs = [ + menhirLib + ppx_deriving_yojson + visitors + yojson + ]; - meta = with lib; { - homepage = "https://github.com/colis-anr/${pname}"; - description = "Static parser for POSIX Shell"; - license = licenses.gpl3Plus; - maintainers = with maintainers; [ niols ]; - }; -} + meta = with lib; { + homepage = "https://github.com/colis-anr/${pname}"; + description = "Static parser for POSIX Shell"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ niols ]; + }; + } From 65f869a0e6486479d6a94e9d6a32df0093e2456c Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Tue, 7 Oct 2025 04:00:04 +0200 Subject: [PATCH 6/7] ocamlPackages.kcas: disable tests with OCaml 5.4 --- pkgs/development/ocaml-modules/kcas/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/development/ocaml-modules/kcas/default.nix b/pkgs/development/ocaml-modules/kcas/default.nix index f1945790168c..707fdc095b58 100644 --- a/pkgs/development/ocaml-modules/kcas/default.nix +++ b/pkgs/development/ocaml-modules/kcas/default.nix @@ -2,6 +2,7 @@ lib, buildDunePackage, fetchurl, + ocaml, domain-local-await, domain-local-timeout, alcotest, @@ -29,7 +30,7 @@ buildDunePackage rec { backoff ]; - doCheck = true; + doCheck = !lib.versionAtLeast ocaml.version "5.4"; nativeCheckInputs = [ mdx.bin ]; checkInputs = [ alcotest From 6e07221e4da4f3ee10b668b6a999c2e1707d4469 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Mon, 6 Oct 2025 22:12:46 +0200 Subject: [PATCH 7/7] ocaml-ng.ocamlPackages_5_4: init at 5.4.0 --- pkgs/development/compilers/ocaml/5.4.nix | 6 ++++++ .../ocaml-modules/ocaml-lsp/jsonrpc.nix | 9 ++++++++- .../ocaml-modules/ocaml-lsp/lsp.nix | 4 +++- .../ocaml-modules/ppxlib/default.nix | 19 ++++++++++++++----- pkgs/development/tools/ocaml/merlin/4.x.nix | 2 ++ pkgs/top-level/ocaml-packages.nix | 2 ++ 6 files changed, 35 insertions(+), 7 deletions(-) create mode 100644 pkgs/development/compilers/ocaml/5.4.nix diff --git a/pkgs/development/compilers/ocaml/5.4.nix b/pkgs/development/compilers/ocaml/5.4.nix new file mode 100644 index 000000000000..966b24944e90 --- /dev/null +++ b/pkgs/development/compilers/ocaml/5.4.nix @@ -0,0 +1,6 @@ +import ./generic.nix { + major_version = "5"; + minor_version = "4"; + patch_version = "0"; + sha256 = "sha256-36qKLhHHmbwXZdi+9EkRQG7l9IAwJxkDgqk5+IyRImY="; +} diff --git a/pkgs/development/ocaml-modules/ocaml-lsp/jsonrpc.nix b/pkgs/development/ocaml-modules/ocaml-lsp/jsonrpc.nix index 576db0dfe2b9..f9aab2144986 100644 --- a/pkgs/development/ocaml-modules/ocaml-lsp/jsonrpc.nix +++ b/pkgs/development/ocaml-modules/ocaml-lsp/jsonrpc.nix @@ -9,7 +9,9 @@ lib, ocaml, version ? - if lib.versionAtLeast ocaml.version "5.3" then + if lib.versionAtLeast ocaml.version "5.4" then + "1.24.0" + else if lib.versionAtLeast ocaml.version "5.3" then "1.23.1" else if lib.versionAtLeast ocaml.version "5.2" then "1.21.0" @@ -26,6 +28,11 @@ let params = { + "1.24.0" = { + name = "lsp"; + minimalOCamlVersion = "5.3"; + sha256 = "sha256-TVoaIVf2EvbALY+DjZferKX4GyOt08XOpcts7Ot7N1c="; + }; "1.23.1" = { name = "lsp"; minimalOCamlVersion = "5.3"; diff --git a/pkgs/development/ocaml-modules/ocaml-lsp/lsp.nix b/pkgs/development/ocaml-modules/ocaml-lsp/lsp.nix index 902c632fb76a..11954a620834 100644 --- a/pkgs/development/ocaml-modules/ocaml-lsp/lsp.nix +++ b/pkgs/development/ocaml-modules/ocaml-lsp/lsp.nix @@ -23,7 +23,9 @@ ocamlformat-rpc-lib, ocaml, version ? - if lib.versionAtLeast ocaml.version "5.3" then + if lib.versionAtLeast ocaml.version "5.4" then + "1.24.0" + else if lib.versionAtLeast ocaml.version "5.3" then "1.23.1" else if lib.versionAtLeast ocaml.version "5.2" then "1.21.0" diff --git a/pkgs/development/ocaml-modules/ppxlib/default.nix b/pkgs/development/ocaml-modules/ppxlib/default.nix index f97140fd0e53..759d92bb4467 100644 --- a/pkgs/development/ocaml-modules/ppxlib/default.nix +++ b/pkgs/development/ocaml-modules/ppxlib/default.nix @@ -1,13 +1,17 @@ { lib, fetchurl, + fetchFromGitHub, buildDunePackage, ocaml, version ? if lib.versionAtLeast ocaml.version "4.07" then if lib.versionAtLeast ocaml.version "4.08" then if lib.versionAtLeast ocaml.version "4.11" then - if lib.versionAtLeast ocaml.version "5.03" then "0.36.2" else "0.33.0" + if lib.versionAtLeast ocaml.version "5.03" then + if lib.versionAtLeast ocaml.version "5.04" then "0.37.0" else "0.36.2" + else + "0.33.0" else "0.24.0" else @@ -91,6 +95,10 @@ let sha256 = "sha256-yHVgB9jKwTeahGEUYQDB1hHH327MGpoKqb3ewNbk5xs="; min_version = "4.08"; }; + "0.37.0" = { + sha256 = "sha256-LiI4N+fOzDvISkMkMsCnL04dW+kWXJwzdy8VbbhdsLM="; + min_version = "4.08"; + }; } ."${version}"; in @@ -106,10 +114,11 @@ else pname = "ppxlib"; inherit version; - src = fetchurl { - url = "https://github.com/ocaml-ppx/ppxlib/releases/download/${version}/ppxlib-${version}.tbz"; - inherit (param) sha256; - }; + src = + param.src or (fetchurl { + url = "https://github.com/ocaml-ppx/ppxlib/releases/download/${version}/ppxlib-${version}.tbz"; + inherit (param) sha256; + }); propagatedBuildInputs = [ ocaml-compiler-libs diff --git a/pkgs/development/tools/ocaml/merlin/4.x.nix b/pkgs/development/tools/ocaml/merlin/4.x.nix index 2f96e5a66cca..8f32bc5d8521 100644 --- a/pkgs/development/tools/ocaml/merlin/4.x.nix +++ b/pkgs/development/tools/ocaml/merlin/4.x.nix @@ -29,6 +29,7 @@ "5.2.0" = "5.3-502"; "5.2.1" = "5.3-502"; "5.3.0" = "5.6-503"; + "5.4.0" = "5.6-504"; } ."${ocaml.version}", }: @@ -47,6 +48,7 @@ let "5.3-502" = "sha256-LOpG8SOX+m4x7wwNT14Rwc/ZFu5JQgaUAFyV67OqJLw="; "5.4.1-503" = "sha256-SbO0x3jBISX8dAXnN5CwsxLV15dJ3XPUg4tlYqJTMCI="; "5.6-503" = "sha256-sNytCSqq96I/ZauaCJ6HYb1mXMcjV5CeCsbCGC9PwtQ="; + "5.6-504" = "sha256-gtZIpBgNbVqjoIMhjii/GX9OnxR4hN6TArtoEa2Yt38="; }; in diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 92da02d990d1..b67b7bd0b607 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -2317,6 +2317,8 @@ rec { ocamlPackages_5_3 = mkOcamlPackages (callPackage ../development/compilers/ocaml/5.3.nix { }); + ocamlPackages_5_4 = mkOcamlPackages (callPackage ../development/compilers/ocaml/5.4.nix { }); + ocamlPackages_latest = ocamlPackages_5_3; ocamlPackages = ocamlPackages_5_3;