From 8d96cbfdcad1bd42c02611e93900cf5763cc6728 Mon Sep 17 00:00:00 2001 From: Julien Girard Date: Wed, 16 Aug 2023 20:35:56 +0200 Subject: [PATCH] ocaml-protoc-plugin: init at 4.3.1 --- .../ocaml-protoc-plugin/default.nix | 53 +++++++++++++++++++ pkgs/top-level/ocaml-packages.nix | 2 + 2 files changed, 55 insertions(+) create mode 100644 pkgs/development/ocaml-modules/ocaml-protoc-plugin/default.nix diff --git a/pkgs/development/ocaml-modules/ocaml-protoc-plugin/default.nix b/pkgs/development/ocaml-modules/ocaml-protoc-plugin/default.nix new file mode 100644 index 000000000000..39794dac456c --- /dev/null +++ b/pkgs/development/ocaml-modules/ocaml-protoc-plugin/default.nix @@ -0,0 +1,53 @@ +{ lib +, fetchFromGitHub +, buildDunePackage +, pkg-config +, protobuf +, zarith +, ppx_deriving +, ppx_deriving_yojson +, re +, dune-site +, ppx_expect +}: + +buildDunePackage rec { + pname = "ocaml-protoc-plugin"; + version = "4.3.1"; + + src = fetchFromGitHub { + owner = "issuu"; + repo = "ocaml-protoc-plugin"; + rev = version; + hash = "sha256-KFd43Ukz5gMeM3ik2VlfaIPwcZe9yaxk9VcQIrauUGU="; + }; + + nativeBuildInputs = [ + pkg-config + protobuf + ]; + buildInputs = [ + zarith + ppx_deriving + ppx_deriving_yojson + re + dune-site + ppx_expect + protobuf + ]; + doCheck = true; + nativeCheckInputs = [ protobuf ]; + + meta = { + description = "Maps google protobuf compiler to Ocaml types."; + homepage = "https://github.com/issuu/ocaml-protoc-plugin"; + license = lib.licenses.asl20; + longDescription = '' + The goal of Ocaml protoc plugin is to create an + up to date plugin for the google protobuf compiler + (protoc) to generate Ocaml types and serialization + and de-serialization function from a .proto file. + ''; + maintainers = [ lib.maintainers.GirardR1006 ]; + }; +} diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index e3b1cad80da6..0e7e26bfc82a 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -1153,6 +1153,8 @@ let ocaml-protoc = callPackage ../development/ocaml-modules/ocaml-protoc { }; + ocaml-protoc-plugin = callPackage ../development/ocaml-modules/ocaml-protoc-plugin { }; + ocaml-r = callPackage ../development/ocaml-modules/ocaml-r { }; ocaml-recovery-parser = callPackage ../development/tools/ocaml/ocaml-recovery-parser { };