From 4f8eb8d6b372addadd81c837afa027c6ff7fd15b Mon Sep 17 00:00:00 2001 From: Volker Diels-Grabsch Date: Fri, 29 Nov 2024 01:22:26 +0100 Subject: [PATCH] ocamlPackages.reason-react: init at 0.15.0 --- .../ocaml-modules/reason-react/default.nix | 23 ++++++++++++++ .../ocaml-modules/reason-react/ppx.nix | 31 +++++++++++++++++++ pkgs/top-level/ocaml-packages.nix | 4 +++ 3 files changed, 58 insertions(+) create mode 100644 pkgs/development/ocaml-modules/reason-react/default.nix create mode 100644 pkgs/development/ocaml-modules/reason-react/ppx.nix diff --git a/pkgs/development/ocaml-modules/reason-react/default.nix b/pkgs/development/ocaml-modules/reason-react/default.nix new file mode 100644 index 0000000000000..340b0c1c27b13 --- /dev/null +++ b/pkgs/development/ocaml-modules/reason-react/default.nix @@ -0,0 +1,23 @@ +{ + buildDunePackage, + melange, + reason, + reason-react-ppx, +}: + +buildDunePackage { + pname = "reason-react"; + inherit (reason-react-ppx) version src; + nativeBuildInputs = [ + reason + melange + ]; + buildInputs = [ + reason-react-ppx + melange + ]; + doCheck = true; + 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 new file mode 100644 index 0000000000000..16068a1e63588 --- /dev/null +++ b/pkgs/development/ocaml-modules/reason-react/ppx.nix @@ -0,0 +1,31 @@ +{ + buildDunePackage, + fetchurl, + lib, + ppxlib, +}: + +let + version = "0.15.0"; +in +buildDunePackage { + pname = "reason-react-ppx"; + inherit version; + minimalOCamlVersion = "4.14"; + src = fetchurl { + url = "https://github.com/reasonml/reason-react/releases/download/${version}/reason-react-${version}.tbz"; + hash = "sha256-+pPJo/b50vp4pAC/ygI1LHB5O0pDJ1xpcQZOdFP8Q80="; + }; + buildInputs = [ + ppxlib + ]; + doCheck = false; # Needs to run in reason-react, see default.nix + meta = { + description = "React.js JSX PPX"; + homepage = "https://github.com/reasonml/reason-react"; + license = lib.licenses.mit; + maintainers = [ + lib.maintainers.vog + ]; + }; +} diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 35cb14aff5350..85ef3bb1ce106 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -1650,6 +1650,10 @@ let reason-native = lib.recurseIntoAttrs (callPackage ../development/ocaml-modules/reason-native { }); + reason-react = callPackage ../development/ocaml-modules/reason-react { }; + + reason-react-ppx = callPackage ../development/ocaml-modules/reason-react/ppx.nix { }; + rebez = callPackage ../development/ocaml-modules/rebez { }; reperf = callPackage ../development/ocaml-modules/reperf { };