diff --git a/pkgs/by-name/do/docfd/nottui-unix.patch b/pkgs/by-name/do/docfd/nottui-unix.patch new file mode 100644 index 000000000000..68e36a99974a --- /dev/null +++ b/pkgs/by-name/do/docfd/nottui-unix.patch @@ -0,0 +1,25 @@ +diff --git a/bin/dune b/bin/dune +index e0ddc1f..a4e8523 100644 +--- a/bin/dune ++++ b/bin/dune +@@ -47,6 +47,7 @@ + notty + notty.unix + nottui ++ nottui-unix + lwd + oseq + eio +diff --git a/bin/ui_base.ml b/bin/ui_base.ml +index f56ee8d..8d8ed70 100644 +--- a/bin/ui_base.ml ++++ b/bin/ui_base.ml +@@ -587,7 +587,7 @@ let ui_loop ~quit ~term root = + if term_width <> prev_term_width || term_height <> prev_term_height then ( + Lwd.set Vars.term_width_height (term_width, term_height) + ); +- Nottui.Ui_loop.step ++ Nottui_unix.step + ~process_event:true + ~timeout:0.05 + ~renderer diff --git a/pkgs/by-name/do/docfd/package.nix b/pkgs/by-name/do/docfd/package.nix index 6e046bf81318..12e0a118c15d 100644 --- a/pkgs/by-name/do/docfd/package.nix +++ b/pkgs/by-name/do/docfd/package.nix @@ -25,6 +25,9 @@ ocamlPackages.buildDunePackage rec { hash = "sha256-uRC2QBn4gAfS9u85YaNH2Mm2C0reP8FnDHbyloY+OC8="; }; + # Compatibility with nottui ≥ 0.4 + patches = [ ./nottui-unix.patch ]; + nativeBuildInputs = [ python3 dune_3 @@ -40,6 +43,7 @@ ocamlPackages.buildDunePackage rec { eio_main lwd nottui + nottui-unix notty ocaml_sqlite3 ocolor diff --git a/pkgs/development/ocaml-modules/lwd/default.nix b/pkgs/development/ocaml-modules/lwd/default.nix index b83541271dd7..b2952ffec28f 100644 --- a/pkgs/development/ocaml-modules/lwd/default.nix +++ b/pkgs/development/ocaml-modules/lwd/default.nix @@ -7,14 +7,13 @@ buildDunePackage rec { pname = "lwd"; - version = "0.3"; + version = "0.4"; minimalOCamlVersion = "4.08"; - duneVersion = "3"; src = fetchurl { url = "https://github.com/let-def/lwd/releases/download/v${version}/lwd-${version}.tbz"; - sha256 = "sha256-H/vyW2tn2OBuWwcmPs8NcINXgFe93MSxRd8dzeoXARI="; + hash = "sha256-nnFltlBWfPOerF4HuVNGzXcZxRSdsM+abeD5ZdQ+x8U="; }; propagatedBuildInputs = [ seq ]; diff --git a/pkgs/development/ocaml-modules/lwd/nottui-lwt.nix b/pkgs/development/ocaml-modules/lwd/nottui-lwt.nix index 36b0f042ba44..57f75f301512 100644 --- a/pkgs/development/ocaml-modules/lwd/nottui-lwt.nix +++ b/pkgs/development/ocaml-modules/lwd/nottui-lwt.nix @@ -11,9 +11,6 @@ buildDunePackage { inherit (lwd) version src; - minimalOCamlVersion = "4.08"; - duneVersion = "3"; - propagatedBuildInputs = [ lwt nottui diff --git a/pkgs/development/ocaml-modules/lwd/nottui-pretty.nix b/pkgs/development/ocaml-modules/lwd/nottui-pretty.nix index 9328677af22d..7081659d62a7 100644 --- a/pkgs/development/ocaml-modules/lwd/nottui-pretty.nix +++ b/pkgs/development/ocaml-modules/lwd/nottui-pretty.nix @@ -10,9 +10,6 @@ buildDunePackage { inherit (lwd) version src; - minimalOCamlVersion = "4.08"; - duneVersion = "3"; - propagatedBuildInputs = [ nottui ]; meta = with lib; { diff --git a/pkgs/development/ocaml-modules/lwd/nottui-unix.nix b/pkgs/development/ocaml-modules/lwd/nottui-unix.nix new file mode 100644 index 000000000000..519a63746251 --- /dev/null +++ b/pkgs/development/ocaml-modules/lwd/nottui-unix.nix @@ -0,0 +1,26 @@ +{ + lib, + buildDunePackage, + lwd, + nottui, + notty, +}: + +buildDunePackage { + pname = "nottui-unix"; + + inherit (lwd) version src; + + propagatedBuildInputs = [ + lwd + nottui + notty + ]; + + meta = with lib; { + description = "UI toolkit for the UNIX terminal built on top of Notty and Lwd"; + license = licenses.mit; + maintainers = [ maintainers.vbgl ]; + homepage = "https://github.com/let-def/lwd"; + }; +} diff --git a/pkgs/development/ocaml-modules/lwd/nottui.nix b/pkgs/development/ocaml-modules/lwd/nottui.nix index 0b01deb1555d..9a9918c75b13 100644 --- a/pkgs/development/ocaml-modules/lwd/nottui.nix +++ b/pkgs/development/ocaml-modules/lwd/nottui.nix @@ -10,9 +10,6 @@ buildDunePackage { inherit (lwd) version src; - minimalOCamlVersion = "4.08"; - duneVersion = "3"; - propagatedBuildInputs = [ lwd notty diff --git a/pkgs/development/ocaml-modules/lwd/tyxml-lwd.nix b/pkgs/development/ocaml-modules/lwd/tyxml-lwd.nix index 9e7df7f3a2c8..ca381fdd55be 100644 --- a/pkgs/development/ocaml-modules/lwd/tyxml-lwd.nix +++ b/pkgs/development/ocaml-modules/lwd/tyxml-lwd.nix @@ -1,6 +1,5 @@ { lib, - fetchpatch, buildDunePackage, js_of_ocaml, js_of_ocaml-ppx, @@ -13,14 +12,6 @@ buildDunePackage { inherit (lwd) version src; - # Compatibility with latest Tyxml (4.6.x) - patches = fetchpatch { - url = "https://github.com/let-def/lwd/commit/7f3364ec593b5ccf0d0294b97bcd1e28e4164691.patch"; - hash = "sha256-W1HjExZxDKRwsrB9ZTkvHTMKO0K5iZl+FrNqPs6BPGU="; - }; - - minimalOCamlVersion = "4.08"; - buildInputs = [ js_of_ocaml-ppx ]; propagatedBuildInputs = [ js_of_ocaml diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 18bcbf85296a..3a4418c417b9 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -1353,6 +1353,8 @@ let nottui-pretty = callPackage ../development/ocaml-modules/lwd/nottui-pretty.nix { }; + nottui-unix = callPackage ../development/ocaml-modules/lwd/nottui-unix.nix { }; + notty = callPackage ../development/ocaml-modules/notty { }; npy = callPackage ../development/ocaml-modules/npy {