Opam depext and system package versions

I’m preparing to release an OCaml interface to RocksDB, developed using a C++ FFI generator tool (cppffigen). It turns out that starting at version 7.0.0, RocksDB made a bunch of breaking changes, so I want to prereq rocksdb, but with a version constraint on the depext. I’ve searched around, but find no documentation on how to do that in the opam file.

It seems like I could make my own version of conf-rocksdb (maybe conf-rocksdb-ge-8.0.0 ?) in which the “build” step could check the version-constraint, but perhaps there’s a more “built-in” way to do it?

Does anybody know if and how this is supposed to be done?

Thanks in advance.

Don’t know if that’s the way it must be done, but conf-zstd does that. See opam info conf-zstd --raw.

Bascially have your conf-rocksdb version be 8.0.0 and check --atleast-version=8.0.0 in pkg-config.

1 Like

Oh very nice! Thank you for this, @dbuenzli !