issuu / ocaml-protoc-plugin

ocaml-protoc-plugin
https://issuu.github.io/ocaml-protoc-plugin/
Other
48 stars 19 forks source link

Convert bash to OCaml. #19

Closed Et7f3 closed 3 years ago

Et7f3 commented 4 years ago

Hello,

This PR has 2 goal:

remarks: I am not able do execute dune build @all is it the current way to build all even the example ? Were they broken before. In any case it isn't a issue has we can use from as dependencies correctly.

andersfugmann commented 4 years ago

What about using pkg-config.

(rule
 (targets google_include)
 (action (with-stdout-to %{targets} (system "pkg-config  protobuf --variable=includedir"))))
Et7f3 commented 4 years ago

Some systems don't have pkg-config so the use of env variable should be supported but I can add a fallback if you want. So env -> pkg config -> hardcoded path.

Et7f3 commented 4 years ago

I won't fix: Dune suggest to use the configurator (built-in dune >= 1.10 maybe lower). And the configurator do some other code to set up correctly. https://github.com/ocaml/dune/blob/master/otherlibs/configurator/src/v1.ml#L689 I can send a fix to dune but it will be only in 2.7 at least. I don't know if I am allowed to copy here. Feel free to copy/adapt if you want.

andersfugmann commented 3 years ago

I've elected to use pkg-config following pr #26. If you know of systems which does not have access to pkg-config, we can change to use dune configurator, which has an interface for pkg-config, and allows for manual locating the include files when pkg-config is not installed.

Do you know of any systems which does not support pkg-config?

I'll close the PR for now.