Optional coq.extraction

I have a project which builds two packages: one is pure OCaml, and the second one uses Coq extraction. I want to be able to build the former even when Coq is not installed.

The immediate problem seems to be that coq.extraction does not allow package specification. The secondary problem is copy_files, which I use to do some post-processing of extracted OCaml code also does not allow package specification and may be invoked unconditionally, triggering extraction via dependency.

Any suggestions on how to work around these limitations are appreciated.