From a282c99f4ff2613552dbc306cc1fee9ad06a674e Mon Sep 17 00:00:00 2001 From: Volker Diels-Grabsch Date: Sat, 27 Dec 2025 23:16:34 +0100 Subject: [PATCH 1/2] ocamlPackages.reason-react: use finalAttrs pattern --- .../ocaml-modules/reason-react/default.nix | 4 ++-- pkgs/development/ocaml-modules/reason-react/ppx.nix | 11 ++++------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/pkgs/development/ocaml-modules/reason-react/default.nix b/pkgs/development/ocaml-modules/reason-react/default.nix index a447c3172d60..148a79fe5cee 100644 --- a/pkgs/development/ocaml-modules/reason-react/default.nix +++ b/pkgs/development/ocaml-modules/reason-react/default.nix @@ -5,7 +5,7 @@ reason-react-ppx, }: -buildDunePackage { +buildDunePackage (finalAttrs: { pname = "reason-react"; inherit (reason-react-ppx) version src; nativeBuildInputs = [ @@ -25,4 +25,4 @@ buildDunePackage { meta = reason-react-ppx.meta // { description = "Reason bindings for React.js"; }; -} +}) diff --git a/pkgs/development/ocaml-modules/reason-react/ppx.nix b/pkgs/development/ocaml-modules/reason-react/ppx.nix index d81cbf021849..1df0a25207b4 100644 --- a/pkgs/development/ocaml-modules/reason-react/ppx.nix +++ b/pkgs/development/ocaml-modules/reason-react/ppx.nix @@ -5,15 +5,12 @@ ppxlib, }: -let - version = "0.16.0"; -in -buildDunePackage { +buildDunePackage (finalAttrs: { pname = "reason-react-ppx"; - inherit version; + version = "0.16.0"; minimalOCamlVersion = "4.14"; src = fetchurl { - url = "https://github.com/reasonml/reason-react/releases/download/${version}/reason-react-${version}.tbz"; + url = "https://github.com/reasonml/reason-react/releases/download/${finalAttrs.version}/reason-react-${finalAttrs.version}.tbz"; hash = "sha256-esPB+mvHHTQ3mUYILrkOjMELJxRDIsWleFcxIwOPQ1w="; }; buildInputs = [ ppxlib ]; @@ -25,4 +22,4 @@ buildDunePackage { maintainers = [ lib.maintainers.vog ]; broken = lib.versionAtLeast ppxlib.version "0.36"; }; -} +}) From d73a7751495cb0c6769fa7ffcaa704ba068431cb Mon Sep 17 00:00:00 2001 From: Volker Diels-Grabsch Date: Sat, 27 Dec 2025 23:29:03 +0100 Subject: [PATCH 2/2] ocamlPackages.reason-react: 0.16.0 -> {0.16.0,0.17.0} depending on ppxlib version --- pkgs/development/ocaml-modules/reason-react/ppx.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pkgs/development/ocaml-modules/reason-react/ppx.nix b/pkgs/development/ocaml-modules/reason-react/ppx.nix index 1df0a25207b4..578a35604678 100644 --- a/pkgs/development/ocaml-modules/reason-react/ppx.nix +++ b/pkgs/development/ocaml-modules/reason-react/ppx.nix @@ -3,15 +3,21 @@ fetchurl, lib, ppxlib, + version ? if lib.versionAtLeast ppxlib.version "0.36" then "0.17.0" else "0.16.0", }: buildDunePackage (finalAttrs: { pname = "reason-react-ppx"; - version = "0.16.0"; + inherit version; minimalOCamlVersion = "4.14"; src = fetchurl { url = "https://github.com/reasonml/reason-react/releases/download/${finalAttrs.version}/reason-react-${finalAttrs.version}.tbz"; - hash = "sha256-esPB+mvHHTQ3mUYILrkOjMELJxRDIsWleFcxIwOPQ1w="; + hash = + { + "0.16.0" = "sha256-esPB+mvHHTQ3mUYILrkOjMELJxRDIsWleFcxIwOPQ1w="; + "0.17.0" = "sha256-ArZ6CL1UjcGYPBvGnvQX7Qa16+mQT3T8mETHprT/MYw="; + } + ."${finalAttrs.version}"; }; buildInputs = [ ppxlib ]; doCheck = false; # Needs to run in reason-react, see default.nix @@ -20,6 +26,5 @@ buildDunePackage (finalAttrs: { homepage = "https://github.com/reasonml/reason-react"; license = lib.licenses.mit; maintainers = [ lib.maintainers.vog ]; - broken = lib.versionAtLeast ppxlib.version "0.36"; }; })