From c9486e982820c9028015148697d3120954e3a13a Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Fri, 10 Jan 2025 23:00:37 +0100 Subject: [PATCH 1/4] ocamlPackages.camlp4: fix build --- .../tools/ocaml/camlp4/default.nix | 35 ++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/pkgs/development/tools/ocaml/camlp4/default.nix b/pkgs/development/tools/ocaml/camlp4/default.nix index ac76bfba3f32..89cdc1eb6ec3 100644 --- a/pkgs/development/tools/ocaml/camlp4/default.nix +++ b/pkgs/development/tools/ocaml/camlp4/default.nix @@ -4,10 +4,12 @@ fetchzip, which, ocaml, + camlp-streams, ocamlbuild, + findlib, }: -if lib.versionAtLeast ocaml.version "4.15" then +if lib.versionAtLeast ocaml.version "5.4" then throw "camlp4 is not available for OCaml ${ocaml.version}" else @@ -66,6 +68,22 @@ else 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="; + }; } .${ocaml.meta.branch}; in @@ -81,9 +99,18 @@ else strictDeps = true; - nativeBuildInputs = [ - which - ocaml + 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 ]; From 9f8ced3ab40ec343d4fded68d7767179cb49bcc5 Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Fri, 10 Jan 2025 23:13:51 +0100 Subject: [PATCH 2/4] heptagon: unpin ocaml 4.14 --- .../default.nix => by-name/he/heptagon/package.nix} | 8 ++++++++ pkgs/top-level/all-packages.nix | 4 ---- 2 files changed, 8 insertions(+), 4 deletions(-) rename pkgs/{development/compilers/heptagon/default.nix => by-name/he/heptagon/package.nix} (83%) diff --git a/pkgs/development/compilers/heptagon/default.nix b/pkgs/by-name/he/heptagon/package.nix similarity index 83% rename from pkgs/development/compilers/heptagon/default.nix rename to pkgs/by-name/he/heptagon/package.nix index 0bfdb702aaaf..be1b69a3a263 100644 --- a/pkgs/development/compilers/heptagon/default.nix +++ b/pkgs/by-name/he/heptagon/package.nix @@ -4,6 +4,7 @@ fetchFromGitLab, makeWrapper, ocamlPackages, + fetchpatch, }: stdenv.mkDerivation (finalAttrs: { @@ -18,6 +19,13 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-b4O48MQT3Neh8a1Z5wRgS701w6XrwpsbSMprlqTT+CE="; }; + patches = [ + (fetchpatch { + url = "https://gitlab.inria.fr/synchrone/heptagon/-/commit/f10405e385ca25dc737727e0c210a44986929bf0.patch"; + hash = "sha256-Sn55jEoRDYnEUg4SjuBDCNN4TNl2Dwn1fTjb9O8O1bo="; + }) + ]; + strictDeps = true; nativeBuildInputs = with ocamlPackages; [ diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index cd1a3db79f56..57a4c19227c2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6358,10 +6358,6 @@ with pkgs; inherit (emacs.pkgs.melpaStablePackages) irony; }; - heptagon = callPackage ../development/compilers/heptagon { - ocamlPackages = ocaml-ng.ocamlPackages_4_14; - }; - openjfx17 = openjfx; openjfx21 = callPackage ../by-name/op/openjfx/package.nix { featureVersion = "21"; }; openjfx23 = callPackage ../by-name/op/openjfx/package.nix { featureVersion = "23"; }; From 51457da6e17e7f40e1b685c83bc0f4e5a9653263 Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Sun, 12 Jan 2025 16:03:13 +0100 Subject: [PATCH 3/4] ocamlPackages.ulex: mark as unavailable for ocaml 5.0+ --- .../ocaml-modules/ulex/default.nix | 64 ++++++++++--------- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/pkgs/development/ocaml-modules/ulex/default.nix b/pkgs/development/ocaml-modules/ulex/default.nix index bbc26d8650f8..ac98285c101f 100644 --- a/pkgs/development/ocaml-modules/ulex/default.nix +++ b/pkgs/development/ocaml-modules/ulex/default.nix @@ -23,39 +23,43 @@ let }; in -stdenv.mkDerivation rec { - name = "ocaml${ocaml.version}-${pname}-${version}"; - inherit (param) version; +lib.throwIf (lib.versionAtLeast ocaml.version "5.0") + "ulex is not available for OCaml ${ocaml.version}" - src = fetchFromGitHub { - owner = "whitequark"; - repo = pname; - rev = "v${version}"; - inherit (param) sha256; - }; + stdenv.mkDerivation + rec { + name = "ocaml${ocaml.version}-${pname}-${version}"; + inherit (param) version; - createFindlibDestdir = true; + src = fetchFromGitHub { + owner = "whitequark"; + repo = pname; + rev = "v${version}"; + inherit (param) sha256; + }; - nativeBuildInputs = [ - ocaml - findlib - ocamlbuild - camlp4 - ]; - propagatedBuildInputs = [ camlp4 ]; + createFindlibDestdir = true; - strictDeps = true; + nativeBuildInputs = [ + ocaml + findlib + ocamlbuild + camlp4 + ]; + propagatedBuildInputs = [ camlp4 ]; - buildFlags = [ - "all" - "all.opt" - ]; + strictDeps = true; - meta = { - inherit (src.meta) homepage; - description = "Lexer generator for Unicode and OCaml"; - license = lib.licenses.mit; - inherit (ocaml.meta) platforms; - maintainers = [ lib.maintainers.roconnor ]; - }; -} + buildFlags = [ + "all" + "all.opt" + ]; + + meta = { + inherit (src.meta) homepage; + description = "Lexer generator for Unicode and OCaml"; + license = lib.licenses.mit; + inherit (ocaml.meta) platforms; + maintainers = [ lib.maintainers.roconnor ]; + }; + } From e5b296303cd5281646779f7239bc59aa80980378 Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Sun, 12 Jan 2025 16:03:21 +0100 Subject: [PATCH 4/4] ocamlPackages.config-file: mark as unavailable for ocaml 5.0+ --- .../ocaml-modules/config-file/default.nix | 48 ++++++++++--------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/pkgs/development/ocaml-modules/config-file/default.nix b/pkgs/development/ocaml-modules/config-file/default.nix index f20a7d9b113f..4bb913d544bf 100644 --- a/pkgs/development/ocaml-modules/config-file/default.nix +++ b/pkgs/development/ocaml-modules/config-file/default.nix @@ -7,30 +7,34 @@ camlp4, }: -stdenv.mkDerivation rec { - pname = "ocaml-config-file"; - version = "1.2"; +lib.throwIf (lib.versionAtLeast ocaml.version "5.0") + "config-file is not available for OCaml ${ocaml.version}" - src = fetchurl { - url = "https://forge.ocamlcore.org/frs/download.php/1387/config-file-${version}.tar.gz"; - sha256 = "1b02yxcnsjhr05ssh2br2ka4hxsjpdw34ldl3nk33wfnkwk7g67q"; - }; + stdenv.mkDerivation + rec { + pname = "ocaml-config-file"; + version = "1.2"; - nativeBuildInputs = [ - ocaml - findlib - camlp4 - ]; + src = fetchurl { + url = "https://forge.ocamlcore.org/frs/download.php/1387/config-file-${version}.tar.gz"; + sha256 = "1b02yxcnsjhr05ssh2br2ka4hxsjpdw34ldl3nk33wfnkwk7g67q"; + }; - strictDeps = true; + nativeBuildInputs = [ + ocaml + findlib + camlp4 + ]; - createFindlibDestdir = true; + strictDeps = true; - meta = { - homepage = "http://config-file.forge.ocamlcore.org/"; - platforms = ocaml.meta.platforms or [ ]; - description = "OCaml library used to manage the configuration file(s) of an application"; - license = lib.licenses.lgpl2Plus; - maintainers = with lib.maintainers; [ vbgl ]; - }; -} + createFindlibDestdir = true; + + meta = { + homepage = "http://config-file.forge.ocamlcore.org/"; + platforms = ocaml.meta.platforms or [ ]; + description = "OCaml library used to manage the configuration file(s) of an application"; + license = lib.licenses.lgpl2Plus; + maintainers = with lib.maintainers; [ vbgl ]; + }; + }