From c3d7e253bfdf5ce05f35bd8f4e8d2933ee977301 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Thu, 25 Jun 2026 08:13:01 +0200 Subject: [PATCH 1/9] ocamlPackages.merlin: init at 5.8-505 for OCaml 5.5 --- pkgs/development/tools/ocaml/merlin/4.x.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/tools/ocaml/merlin/4.x.nix b/pkgs/development/tools/ocaml/merlin/4.x.nix index dbb685cf3d5b..5358e4aed773 100644 --- a/pkgs/development/tools/ocaml/merlin/4.x.nix +++ b/pkgs/development/tools/ocaml/merlin/4.x.nix @@ -34,6 +34,7 @@ "5.3.0" = "5.6-503"; "5.4.0" = "5.7.1-504"; "5.4.1" = "5.7.1-504"; + "5.5.0" = "5.8-505"; } ."${ocaml.version}", }: @@ -54,6 +55,7 @@ let "5.6-503" = "sha256-sNytCSqq96I/ZauaCJ6HYb1mXMcjV5CeCsbCGC9PwtQ="; "5.6-504" = "sha256-gtZIpBgNbVqjoIMhjii/GX9OnxR4hN6TArtoEa2Yt38="; "5.7.1-504" = "sha256-E5sHPPkUs4tyXFT3W4tkL2VMNJjQpLqM+oMf8CqJcNU="; + "5.8-505" = "sha256-VkLN6EhqhKrZj6XFkLcOjcxgdNf72zubjEayxbQvZTs="; }; in From 3a9a3fcc5aa7f43eba75da66cb17567323a6bba9 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Thu, 25 Jun 2026 08:13:05 +0200 Subject: [PATCH 2/9] ocamlPackages.lsp: init at 1.27.0 for OCaml 5.5 --- pkgs/development/ocaml-modules/ocaml-lsp/jsonrpc.nix | 9 ++++++++- pkgs/development/ocaml-modules/ocaml-lsp/lsp.nix | 4 +++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/pkgs/development/ocaml-modules/ocaml-lsp/jsonrpc.nix b/pkgs/development/ocaml-modules/ocaml-lsp/jsonrpc.nix index 1c6bd1dcab7a..de8d03343690 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.4" then + if lib.versionAtLeast ocaml.version "5.5" then + "1.27.0" + else if lib.versionAtLeast ocaml.version "5.4" then "1.26.0" else if lib.versionAtLeast ocaml.version "5.3" then "1.23.1" @@ -28,6 +30,11 @@ let params = { + "1.27.0" = { + name = "lsp"; + minimalOCamlVersion = "5.3"; + sha256 = "sha256-BDrNaSP4pcuq2RVFI1cKsTlzuu72mOK1VTIT3WN5JxU="; + }; "1.26.0" = { 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 55ebec5fba50..660c4ff90b7a 100644 --- a/pkgs/development/ocaml-modules/ocaml-lsp/lsp.nix +++ b/pkgs/development/ocaml-modules/ocaml-lsp/lsp.nix @@ -25,7 +25,9 @@ ocamlformat-rpc-lib, ocaml, version ? - if lib.versionAtLeast ocaml.version "5.4" then + if lib.versionAtLeast ocaml.version "5.5" then + "1.27.0" + else if lib.versionAtLeast ocaml.version "5.4" then "1.26.0" else if lib.versionAtLeast ocaml.version "5.3" then "1.23.1" From eaa1851d424fd344072bf62cce4fd9abc2f12390 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Thu, 25 Jun 2026 08:13:08 +0200 Subject: [PATCH 3/9] =?UTF-8?q?ocamlPackages.batteries:=20update=20for=20O?= =?UTF-8?q?Caml=20=E2=89=A5=205.5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgs/development/ocaml-modules/batteries/default.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkgs/development/ocaml-modules/batteries/default.nix b/pkgs/development/ocaml-modules/batteries/default.nix index 707c855b4944..6e30c7f50d09 100644 --- a/pkgs/development/ocaml-modules/batteries/default.nix +++ b/pkgs/development/ocaml-modules/batteries/default.nix @@ -3,20 +3,19 @@ fetchFromGitHub, buildDunePackage, ocaml, + fetchpatch, ounit, qtest, qcheck, num, camlp-streams, - doCheck ? lib.versionAtLeast ocaml.version "4.08", + doCheck ? true, }: buildDunePackage (finalAttrs: { pname = "batteries"; version = "3.10.0"; - minimalOCamlVersion = "4.05"; - src = fetchFromGitHub { owner = "ocaml-batteries-team"; repo = "batteries-included"; @@ -24,6 +23,11 @@ buildDunePackage (finalAttrs: { hash = "sha256-cD0O4kEDE58yCYnUuS83O1CJNHJuCGVhvKJSKQeQGkc="; }; + patches = lib.optional (lib.versionAtLeast ocaml.version "5.5") (fetchpatch { + url = "https://github.com/ocaml-batteries-team/batteries-included/commit/f6e091266599aea93c8a94115cf08f50e88c5dd0.patch"; + hash = "sha256-6CUcq24x4fnumduK4BJ5cVQ5DHPbVLyLUxl57q2JVtw="; + }); + nativeCheckInputs = [ qtest ]; checkInputs = [ ounit From 61ae2648aa9c5a8afa131e115c6257c25522ac80 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Thu, 25 Jun 2026 08:13:11 +0200 Subject: [PATCH 4/9] =?UTF-8?q?ocamlPackages.accessor=5Fcore:=20mark=20as?= =?UTF-8?q?=20broken=20with=20OCaml=20=E2=89=A5=205.5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgs/development/ocaml-modules/janestreet/0.17.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/ocaml-modules/janestreet/0.17.nix b/pkgs/development/ocaml-modules/janestreet/0.17.nix index 1250dfe2b447..dc1d5018bbcc 100644 --- a/pkgs/development/ocaml-modules/janestreet/0.17.nix +++ b/pkgs/development/ocaml-modules/janestreet/0.17.nix @@ -60,6 +60,7 @@ with self; pname = "accessor_core"; hash = "sha256-ku83ZfLtVI8FvQhrKcnJmhmoNlYcVMKx1tor5N8Nq7M="; meta.description = "Accessors for Core types, for use with the Accessor library"; + meta.broken = lib.versionAtLeast ocaml.version "5.5"; propagatedBuildInputs = [ accessor_base core_kernel From 463b1ae1c65ee7436eee40f4bfdd69b1d34bca21 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Thu, 25 Jun 2026 08:13:13 +0200 Subject: [PATCH 5/9] =?UTF-8?q?ocamlPackages.ppx=5Fimport:=20mark=20as=20b?= =?UTF-8?q?roken=20with=20OCaml=20=E2=89=A5=205.5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgs/development/ocaml-modules/ppx_import/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/ocaml-modules/ppx_import/default.nix b/pkgs/development/ocaml-modules/ppx_import/default.nix index fdd59a094f5e..185154a4ec7b 100644 --- a/pkgs/development/ocaml-modules/ppx_import/default.nix +++ b/pkgs/development/ocaml-modules/ppx_import/default.nix @@ -1,6 +1,7 @@ { lib, fetchurl, + ocaml, buildDunePackage, ounit, ppx_deriving, @@ -53,5 +54,6 @@ buildDunePackage { description = "Syntax extension for importing declarations from interface files"; license = lib.licenses.mit; homepage = "https://github.com/ocaml-ppx/ppx_import"; + broken = lib.versionAtLeast ocaml.version "5.5"; }; } From 9fc9431347481b81764e019d6ab4b93130a17c76 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Thu, 25 Jun 2026 08:13:16 +0200 Subject: [PATCH 6/9] =?UTF-8?q?frama-c:=20mark=20as=20broken=20with=20OCam?= =?UTF-8?q?l=20=E2=89=A5=205.5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgs/by-name/fr/frama-c/package.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/fr/frama-c/package.nix b/pkgs/by-name/fr/frama-c/package.nix index bb9229a8803a..e5e751dbe005 100644 --- a/pkgs/by-name/fr/frama-c/package.nix +++ b/pkgs/by-name/fr/frama-c/package.nix @@ -134,6 +134,8 @@ stdenv.mkDerivation (finalAttrs: { ]; platforms = lib.platforms.unix; mainProgram = "frama-c"; - broken = !lib.versionAtLeast ocamlPackages.ocaml.version "4.14"; + broken = + !lib.versionAtLeast ocamlPackages.ocaml.version "4.14" + || lib.versionAtLeast ocamlPackages.ocaml.version "5.5"; }; }) From 5103b5b35b10b44256ac6398ea7a4f5b2e4f32fd Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Thu, 25 Jun 2026 10:17:32 +0200 Subject: [PATCH 7/9] ocamlPackages.camlp4: fix eval for unsupported OCaml versions --- .../tools/ocaml/camlp4/default.nix | 291 +++++++++--------- 1 file changed, 147 insertions(+), 144 deletions(-) diff --git a/pkgs/development/tools/ocaml/camlp4/default.nix b/pkgs/development/tools/ocaml/camlp4/default.nix index 9b28e342de4c..caea5a20711d 100644 --- a/pkgs/development/tools/ocaml/camlp4/default.nix +++ b/pkgs/development/tools/ocaml/camlp4/default.nix @@ -9,150 +9,153 @@ findlib, }: -if lib.versionAtLeast ocaml.version "5.5" then - throw "camlp4 is not available for OCaml ${ocaml.version}" -else - - let - param = - { - "4.02" = { - version = "4.02+6"; - sha256 = "06yl4q0qazl7g25b0axd1gdkfd4qpqzs1gr5fkvmkrcbz113h1hj"; - }; - "4.03" = { - version = "4.03+1"; - sha256 = "1f2ndch6f1m4fgnxsjb94qbpwjnjgdlya6pard44y6n0dqxi1wsq"; - }; - "4.04" = { - version = "4.04+1"; - sha256 = "1ad7rygqjxrc1im95gw9lp8q83nhdaf383f2808f1p63yl42xm7k"; - }; - "4.05" = { - version = "4.05+1"; - sha256 = "0wm795hpwvwpib9c9z6p8kw2fh7p7b2hml6g15z8zry3y7w738sv"; - }; - "4.06" = { - version = "4.06+1"; - sha256 = "0fazfw2l7wdmbwnqc22xby5n4ri1wz27lw9pfzhsbcdrighykysf"; - }; - "4.07" = { - version = "4.07+1"; - sha256 = "0cxl4hkqcvspvkx4f2k83217rh6051fll9i2yz7cw6m3bq57mdvl"; - }; - "4.08" = { - version = "4.08+1"; - sha256 = "0qplawvxwai25bi27niw2cgz2al01kcnkj8wxwhxslpi21z6pyx1"; - }; - "4.09" = { - version = "4.09+1"; - sha256 = "1gr33x6xs1rs0bpyq4vzyfxd6vn47jfkg8imi81db2r0cbs0kxx1"; - }; - "4.10" = { - version = "4.10+1"; - sha256 = "093bc1c28wid5li0jwglnd4p3csxw09fmbs9ffybq2z41a5mgay6"; - }; - "4.11" = { - version = "4.11+1"; - sha256 = "0sn7f6im940qh0ixmx1k738xrwwdvy9g7r19bv5218jb6mh0g068"; - }; - "4.12" = { - version = "4.12+1"; - sha256 = "1cfk5ppnd511vzsr9gc0grxbafmh0m3m897aij198rppzxps5kyz"; - }; - "4.13" = { - version = "4.13+1"; - sha256 = "0fzxa1zdhk74mlxpin7p90flks6sp4gkc0mfclmj9zak15rii55n"; - }; - "4.14" = { - version = "4.14+1"; - sha256 = "sha256-cPN3GioZT/Zt6uzbjGUPEGVJcPQdsAnCkU/AQoPfvuo="; - }; - "5.0" = { - version = "5.0"; - sha256 = "sha256-oZptFNPUEAq5YlcqAoDWfLghGMF9AN7E7hUN55SAX+4="; - }; - "5.1" = { - version = "5.1"; - sha256 = "sha256-Ubedjg3BeHA0bJbEalQN9eEk5+LRAI/er+8mWfVYchg="; - }; - "5.2" = { - version = "5.2"; - sha256 = "sha256-lzbc9xsgeYlbVf71O+PWYS14QivAH1aPdnvWhe0HHME="; - }; - "5.3" = { - version = "5.3"; - sha256 = "sha256-V/kKhTP9U4jWDFuQKuB7BS3XICg1lq/2Avj7UJR55+k="; - }; - "5.4" = { - version = "5.4"; - sha256 = "sha256-7FsKEr0cRVF4LIOvROWMyXBefRTBaS66ZqwtP2VLefM="; - }; - } - .${ocaml.meta.branch}; - in - - stdenv.mkDerivation rec { - pname = "camlp4"; - inherit (param) version; - - src = fetchzip { - url = "https://github.com/ocaml/camlp4/archive/${version}.tar.gz"; - inherit (param) sha256; +let + params = { + "4.02" = { + version = "4.02+6"; + sha256 = "06yl4q0qazl7g25b0axd1gdkfd4qpqzs1gr5fkvmkrcbz113h1hj"; }; - - strictDeps = true; - - nativeBuildInputs = [ - which - ocaml - ocamlbuild - ] - ++ lib.optionals (lib.versionAtLeast ocaml.version "5.0") [ - findlib - ]; - - buildInputs = lib.optionals (lib.versionAtLeast ocaml.version "5.0") [ - camlp-streams - ocamlbuild - ]; - - # build fails otherwise - enableParallelBuilding = false; - - dontAddPrefix = true; - - preConfigure = '' - # increase stack space for spacetime variant of the compiler - # https://github.com/ocaml/ocaml/issues/7435 - # but disallowed by darwin sandbox - ulimit -s unlimited || true - - configureFlagsArray=( - --bindir=$out/bin - --libdir=$out/lib/ocaml/${ocaml.version}/site-lib - --pkgdir=$out/lib/ocaml/${ocaml.version}/site-lib - ) - ''; - - postConfigure = '' - substituteInPlace camlp4/META.in \ - --replace +camlp4 $out/lib/ocaml/${ocaml.version}/site-lib/camlp4 - ''; - - makeFlags = [ "all" ]; - - installTargets = [ - "install" - "install-META" - ]; - - dontStrip = true; - - meta = { - description = "Software system for writing extensible parsers for programming languages"; - homepage = "https://github.com/ocaml/camlp4"; - platforms = ocaml.meta.platforms or [ ]; - license = lib.licenses.WITH lib.licenses.lgpl2Only lib.licenses.ocamlLgplLinkingException; + "4.03" = { + version = "4.03+1"; + sha256 = "1f2ndch6f1m4fgnxsjb94qbpwjnjgdlya6pard44y6n0dqxi1wsq"; }; + "4.04" = { + version = "4.04+1"; + sha256 = "1ad7rygqjxrc1im95gw9lp8q83nhdaf383f2808f1p63yl42xm7k"; + }; + "4.05" = { + version = "4.05+1"; + sha256 = "0wm795hpwvwpib9c9z6p8kw2fh7p7b2hml6g15z8zry3y7w738sv"; + }; + "4.06" = { + version = "4.06+1"; + sha256 = "0fazfw2l7wdmbwnqc22xby5n4ri1wz27lw9pfzhsbcdrighykysf"; + }; + "4.07" = { + version = "4.07+1"; + sha256 = "0cxl4hkqcvspvkx4f2k83217rh6051fll9i2yz7cw6m3bq57mdvl"; + }; + "4.08" = { + version = "4.08+1"; + sha256 = "0qplawvxwai25bi27niw2cgz2al01kcnkj8wxwhxslpi21z6pyx1"; + }; + "4.09" = { + version = "4.09+1"; + sha256 = "1gr33x6xs1rs0bpyq4vzyfxd6vn47jfkg8imi81db2r0cbs0kxx1"; + }; + "4.10" = { + version = "4.10+1"; + sha256 = "093bc1c28wid5li0jwglnd4p3csxw09fmbs9ffybq2z41a5mgay6"; + }; + "4.11" = { + version = "4.11+1"; + sha256 = "0sn7f6im940qh0ixmx1k738xrwwdvy9g7r19bv5218jb6mh0g068"; + }; + "4.12" = { + version = "4.12+1"; + sha256 = "1cfk5ppnd511vzsr9gc0grxbafmh0m3m897aij198rppzxps5kyz"; + }; + "4.13" = { + version = "4.13+1"; + sha256 = "0fzxa1zdhk74mlxpin7p90flks6sp4gkc0mfclmj9zak15rii55n"; + }; + "4.14" = { + version = "4.14+1"; + sha256 = "sha256-cPN3GioZT/Zt6uzbjGUPEGVJcPQdsAnCkU/AQoPfvuo="; + }; + "5.0" = { + version = "5.0"; + sha256 = "sha256-oZptFNPUEAq5YlcqAoDWfLghGMF9AN7E7hUN55SAX+4="; + }; + "5.1" = { + version = "5.1"; + sha256 = "sha256-Ubedjg3BeHA0bJbEalQN9eEk5+LRAI/er+8mWfVYchg="; + }; + "5.2" = { + version = "5.2"; + sha256 = "sha256-lzbc9xsgeYlbVf71O+PWYS14QivAH1aPdnvWhe0HHME="; + }; + "5.3" = { + version = "5.3"; + sha256 = "sha256-V/kKhTP9U4jWDFuQKuB7BS3XICg1lq/2Avj7UJR55+k="; + }; + "5.4" = { + version = "5.4"; + sha256 = "sha256-7FsKEr0cRVF4LIOvROWMyXBefRTBaS66ZqwtP2VLefM="; + }; + }; + param = { + # Dummy version to let the `meta` attribute set evaluate + version = ""; + sha256 = lib.fakeSha256; } + // (params.${ocaml.meta.branch} or { + } + ); +in + +stdenv.mkDerivation rec { + pname = "camlp4"; + inherit (param) version; + + src = fetchzip { + url = "https://github.com/ocaml/camlp4/archive/${version}.tar.gz"; + inherit (param) sha256; + }; + + strictDeps = true; + + nativeBuildInputs = [ + which + ocaml + ocamlbuild + ] + ++ lib.optionals (lib.versionAtLeast ocaml.version "5.0") [ + findlib + ]; + + buildInputs = lib.optionals (lib.versionAtLeast ocaml.version "5.0") [ + camlp-streams + ocamlbuild + ]; + + # build fails otherwise + enableParallelBuilding = false; + + dontAddPrefix = true; + + preConfigure = '' + # increase stack space for spacetime variant of the compiler + # https://github.com/ocaml/ocaml/issues/7435 + # but disallowed by darwin sandbox + ulimit -s unlimited || true + + configureFlagsArray=( + --bindir=$out/bin + --libdir=$out/lib/ocaml/${ocaml.version}/site-lib + --pkgdir=$out/lib/ocaml/${ocaml.version}/site-lib + ) + ''; + + postConfigure = '' + substituteInPlace camlp4/META.in \ + --replace +camlp4 $out/lib/ocaml/${ocaml.version}/site-lib/camlp4 + ''; + + makeFlags = [ "all" ]; + + installTargets = [ + "install" + "install-META" + ]; + + dontStrip = true; + + meta = { + description = "Software system for writing extensible parsers for programming languages"; + homepage = "https://github.com/ocaml/camlp4"; + platforms = ocaml.meta.platforms; + license = lib.licenses.WITH lib.licenses.lgpl2Only lib.licenses.ocamlLgplLinkingException; + broken = !(params ? ${ocaml.meta.branch}); + }; +} From 844b1a9267f1994ea1a11ee99f7bb62e630f6850 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Thu, 25 Jun 2026 08:13:21 +0200 Subject: [PATCH 8/9] ocamlPackages_5_5.ocaml: init at 5.5.0 --- pkgs/development/compilers/ocaml/5.5.nix | 6 ++++++ pkgs/top-level/ocaml-packages.nix | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/compilers/ocaml/5.5.nix diff --git a/pkgs/development/compilers/ocaml/5.5.nix b/pkgs/development/compilers/ocaml/5.5.nix new file mode 100644 index 000000000000..8ed4b494db7c --- /dev/null +++ b/pkgs/development/compilers/ocaml/5.5.nix @@ -0,0 +1,6 @@ +import ./generic.nix { + major_version = "5"; + minor_version = "5"; + patch_version = "0"; + sha256 = "sha256-/MauZl0exR1SUQ6qx4NKhqmAa/WiWLt8ynhzP8zwFbo="; +} diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 71cfe7da5118..e9ab2b42c35c 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -2400,7 +2400,9 @@ rec { ocamlPackages_5_4 = mkOcamlPackages (callPackage ../development/compilers/ocaml/5.4.nix { }); - ocamlPackages_latest = ocamlPackages_5_4; + ocamlPackages_5_5 = mkOcamlPackages (callPackage ../development/compilers/ocaml/5.5.nix { }); + + ocamlPackages_latest = ocamlPackages_5_5; ocamlPackages = ocamlPackages_5_4; From 6eb243853e0700bf5d4df5f69ea4f3edd735544f Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Fri, 26 Jun 2026 06:04:49 +0200 Subject: [PATCH 9/9] ocamlPackages.camlp4: init at 5.5+1 for OCaml 5.5 --- pkgs/development/tools/ocaml/camlp4/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/development/tools/ocaml/camlp4/default.nix b/pkgs/development/tools/ocaml/camlp4/default.nix index caea5a20711d..ae434dbddeb7 100644 --- a/pkgs/development/tools/ocaml/camlp4/default.nix +++ b/pkgs/development/tools/ocaml/camlp4/default.nix @@ -83,6 +83,10 @@ let version = "5.4"; sha256 = "sha256-7FsKEr0cRVF4LIOvROWMyXBefRTBaS66ZqwtP2VLefM="; }; + "5.5" = { + version = "5.5+1"; + sha256 = "sha256-ERzTg6CFXm1Z0/NSXP5MwM0H/fSpN/4D2ISFcJa1qSI="; + }; }; param = { # Dummy version to let the `meta` attribute set evaluate