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 { }; }) diff --git a/flake.lock b/flake.lock index c30d09e8..c6adec9f 100644 --- a/flake.lock +++ b/flake.lock @@ -5,11 +5,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1681202837, - "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", + "lastModified": 1689068808, + "narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=", "owner": "numtide", "repo": "flake-utils", - "rev": "cfacdce06f30d2b68473a46042957675eebb3401", + "rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4", "type": "github" }, "original": { @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1684049129, - "narHash": "sha256-7WB9LpnPNAS8oI7hMoHeKLNhRX7k3CI9uWBRSfmOCCE=", + "lastModified": 1690640159, + "narHash": "sha256-5DZUYnkeMOsVb/eqPYb9zns5YsnQXRJRC8Xx/nPMcno=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0470f36b02ef01d4f43c641bbf07020bcab71bf1", + "rev": "e6ab46982debeab9831236869539a507f670a129", "type": "github" }, "original": {