Hi OCaml Dune experts, I’ve been trying to adopt Dune as the build system for a followup to my Orsetto project, and it’s going okay, but I haven’t yet tried to deal with the problem of the extra-source
fields in its opam
file. I need help, and scouring the fabulous documentation for dune
leaves me confused about how to proceed. Help! Please?
Basic summary: the OMakefile
system in Orsetto is designed to work offline apart from opam
in the usual case, and building it requires downloading some files from a web site (and I don’t want to redistribute them inside the source code for the package). These files are listed with extra-source
fields in the opam
file, so that when building with opam
they just magically land in the root of the source tree after the tarball is unpacked. The OMakefile
in Orsetto finds them and uses them if they’re present. But if they’re not present, then it invokes curl
and downloads them directly.
These extra-source
files include various published databases for generating OCaml source code and the tests of that source code. I’d like to do something functionally equivalent in the dune
project for my replacement, but there are some additional complications. I see that dune
wants to generate the opam
file automatically, which is nice, and I want to do that. Alas, I can’t figure out how to generate the (I’ve found out about the extra-source
fields.project.opam.template
feature) Moreover, I’m not sure how to do the “if OPAM didn’t download these, then download them yourself” logic.
Can someone with more Dune kung fu than me help sort me out, please? Obviously, I could patch out to a Bourne shell script, but I don’t want to be broken on Windows because of that. Surely, there must be some way to do this natively in Dune?
5 posts - 4 participants