From 2911003088d68ec4cc9e02fdf2ee6d9b8f39bff0 Mon Sep 17 00:00:00 2001 From: adelaett <90894311+adelaett@users.noreply.github.com> Date: Mon, 31 Jul 2023 16:19:06 +0200 Subject: [PATCH] add ocolor as a dependency --- .nix/catala.nix | 2 ++ .nix/ocolor.nix | 39 +++++++++++++++++++++++++++++++++++++++ .nix/packages.nix | 1 + 3 files changed, 42 insertions(+) create mode 100644 .nix/ocolor.nix diff --git a/.nix/catala.nix b/.nix/catala.nix index 6ecffc6f..186620c7 100644 --- a/.nix/catala.nix +++ b/.nix/catala.nix @@ -25,6 +25,7 @@ , zarith_stubs_js , ocaml-crunch , cohttp-lwt-unix +, ocolor }: buildDunePackage { @@ -62,6 +63,7 @@ buildDunePackage { zarith zarith_stubs_js cohttp-lwt-unix + ocolor ]; # Currently there is no unit tests in catala and Cram tests are handled by clerk diff --git a/.nix/ocolor.nix b/.nix/ocolor.nix new file mode 100644 index 00000000..4157841d --- /dev/null +++ b/.nix/ocolor.nix @@ -0,0 +1,39 @@ +{ lib +, buildDunePackage +, odoc +, cppo +, ounit +, fetchurl +}: + +buildDunePackage rec { + pname = "ocolor"; + version = "1.3.0"; + + minimumOCamlVersion = "4.11"; + + src = fetchurl + { + url = "https://github.com/marc-chevalier/${pname}/archive/${version}.tar.gz"; + sha256 = "sha256-V7xuBRNbWWi3OpDRe7WakOO4Vz6nyoV8/gyn45fpmYA="; + }; + + duneVersion = "3"; + + propagatedBuildInputs = [ + odoc + ounit + cppo + ]; + + nativeBuildInputs = [ cppo ]; + doCheck = true; + + meta = with lib; { + homepage = "https://github.com/marc-chevalier/ocolor"; + description = + "OColor is an OCaml library which help to format nicely using ANSI escape codes."; + license = licenses.mit; + maintainers = [ ]; + }; +} diff --git a/.nix/packages.nix b/.nix/packages.nix index c4490d5a..26c25e75 100644 --- a/.nix/packages.nix +++ b/.nix/packages.nix @@ -11,4 +11,5 @@ ocamlPackages.overrideScope' (self: super: { ubase = self.callPackage ./ubase.nix { }; dates_calc = self.callPackage ./dates_calc.nix { }; french_law = self.callPackage ./french_law.nix { }; + ocolor = self.callPackage ./ocolor.nix { }; })