How to set arch in dune-project?

I am using dune-project to generate an opam file for a project. How to get it to generate the available: clause? See e.g. opam-repository/opam at a78d7fa13785cc738a8dab82014f49ec6040608c · ocaml/opam-repository · GitHub

Hi @yawaramin

I might be mistaken but it doesn’t look like the dune project file supports available yet. The easiest way I think then is to use the template method and specify in a <package>.opam.template file:

available:
  arch = "arm" | arch = "x86_32" | arch = "x86_64" | arch = "x86_64" |
  arch = "arm64"

Or whatever you want to set that to. When you run dune build it should promote this to your <package>.opam file. This is how, for example, you can set the plugin flag which is also not supported at the moment.

Hope that helps :))

2 Likes

Thank you! That worked nicely :slight_smile: