From cadc15222fa8fe399336332960471f0bd5e55331 Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Wed, 2 Sep 2020 19:00:00 -0500 Subject: [PATCH] ocamlPackages.csexp: init at 1.3.1 --- .../ocaml-modules/csexp/default.nix | 26 +++++++++++++++++++ pkgs/top-level/ocaml-packages.nix | 2 ++ 2 files changed, 28 insertions(+) create mode 100644 pkgs/development/ocaml-modules/csexp/default.nix diff --git a/pkgs/development/ocaml-modules/csexp/default.nix b/pkgs/development/ocaml-modules/csexp/default.nix new file mode 100644 index 000000000000..512748907003 --- /dev/null +++ b/pkgs/development/ocaml-modules/csexp/default.nix @@ -0,0 +1,26 @@ +{ lib, fetchurl, buildDunePackage }: + +buildDunePackage rec { + pname = "csexp"; + version = "1.3.1"; + + useDune2 = true; + + minimumOCamlVersion = "4.08"; + + src = fetchurl { + url = "https://github.com/ocaml-dune/csexp/releases/download/${version}/csexp-${version}.tbz"; + sha256 = "0maihbqbqq9bwr0r1cv51r3m4hrkx9cf5wnxcz7rjgn13lcc9s49"; + }; + + postPatch = '' + substituteInPlace src/csexp.ml --replace Result.result Result.t + ''; + + meta = with lib; { + homepage = "https://github.com/ocaml-dune/csexp"; + description = "Minimal support for Canonical S-expressions"; + license = licenses.mit; + maintainers = [ maintainers.marsam ]; + }; +} diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 32bb7d337860..d0dc0bf1e918 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -173,6 +173,8 @@ let cryptokit = callPackage ../development/ocaml-modules/cryptokit { }; + csexp = callPackage ../development/ocaml-modules/csexp { }; + cstruct = if lib.versionAtLeast ocaml.version "4.2" then callPackage ../development/ocaml-modules/cstruct {}