Skip to content

Commit

Permalink
Adding Ocaml protoc plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
caisar-platform committed Aug 16, 2023
1 parent 2de08bd commit 3af1968
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
58 changes: 58 additions & 0 deletions pkgs/development/ocaml-modules/ocaml-protoc-plugin/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{ 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";

duneVersion = "3";

minimalOcamlVersion = "4.08";

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 ];
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/ocaml-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 { };
Expand Down

0 comments on commit 3af1968

Please sign in to comment.