From a625efad9c10dee4a5f857c562b5e41626d17cf1 Mon Sep 17 00:00:00 2001 From: Olivier Nicole Date: Fri, 26 Jun 2026 09:50:34 +0200 Subject: [PATCH] ocamlPackages.ansi: init at 0.7.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Assisted-by: Claude Sonnet 4.6 (Anthropic) Co-authored-by: Léo <16472988+redianthus@users.noreply.github.com> --- .../ocaml-modules/ansi/default.nix | 48 +++++++++++++++++++ pkgs/top-level/ocaml-packages.nix | 2 + 2 files changed, 50 insertions(+) create mode 100644 pkgs/development/ocaml-modules/ansi/default.nix diff --git a/pkgs/development/ocaml-modules/ansi/default.nix b/pkgs/development/ocaml-modules/ansi/default.nix new file mode 100644 index 000000000000..061ae83f5d8b --- /dev/null +++ b/pkgs/development/ocaml-modules/ansi/default.nix @@ -0,0 +1,48 @@ +{ + lib, + buildDunePackage, + fetchFromGitHub, + astring, + fmt, + tyxml, + alcotest, +}: + +buildDunePackage (finalAttrs: { + pname = "ansi"; + version = "0.7.0"; + + minimalOCamlVersion = "4.10"; + + src = fetchFromGitHub { + owner = "ocurrent"; + repo = "ansi"; + tag = finalAttrs.version; + hash = "sha256-VZR8hz2v4gAvTkizBt59DSYr3tGPWT1Iid8m8YQx48Y="; + }; + + propagatedBuildInputs = [ + astring + fmt + tyxml + ]; + + checkInputs = [ + alcotest + ]; + + doCheck = true; + + meta = { + description = "ANSI escape sequence parser"; + longDescription = '' + This package provides a basic ANSI escape parser. Program output (such as + build logs) often includes ANSI escape codes to colour and style the output. + This library interprets some of the common codes and can convert them to + HTML, producing basic styled output (e.g. highlighting errors in red). + ''; + homepage = "https://github.com/ocurrent/ansi"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ otini ]; + }; +}) diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 71cfe7da5118..aeac1465c472 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -50,6 +50,8 @@ let angstrom-unix = callPackage ../development/ocaml-modules/angstrom-unix { }; + ansi = callPackage ../development/ocaml-modules/ansi { }; + ansiterminal = callPackage ../development/ocaml-modules/ansiterminal { }; ao = callPackage ../development/ocaml-modules/ao { };