DH_OCAML(1)
π DH_OCAML β the manual, but make it bestie π
ok so real talk, you're looking at dh_ocaml, a page from the User Contributed Perl Documentation section of the manual. She's a debhelper program and she's here for exactly one job: figuring out OCaml package deps and provides for you. no cap. π¦
β¨ NAME β¨
dh_ocaml β calculates OCaml packages dependencies and provides
πΈ SYNOPSIS πΈ
dh_ocaml [debhelper options]
[--runtime-map=dev:runtime,...]
[--nodefined-map=dev:ignore1,ignore2]
[--checksum=str]
π DESCRIPTION π
dh_ocaml is a debhelper program whose whole personality is filling in the ${ocaml:Provides} and ${ocaml:Depends} substitutions and then adding them to substvars files. main character behavior honestly π
dh_ocaml acts on three kinds of binary packages:
- the ones shipping the development part of OCaml libraries (usually named
libXXX-ocaml-devorlibXXXX-camlp4-dev) π - the ones shipping the runtime for OCaml libraries β think plugin and shared library β usually named
libXXX-ocamlorlibXXXX-camlp4π - the ones shipping OCaml bytecode non-custom executables (i.e. executables interpreted by
/usr/bin/ocamlrun) β
on specific packages the convention is XXX for development and XXX-base for runtime β e.g. ocaml and ocaml-base. iykyk π
π HOW SHE ACTUALLY WORKS π
on OCaml library packages, dh_ocaml will firstly look at the OCaml objects shipped by the package. then she uses the appropriate program on them to collect information about the OCaml modules defined and used by them. π₯
- info about defined units gets used to automatically create the OCaml md5sums registry entry for development and runtime package, e.g.
/var/lib/ocaml/md5sums/libXXX-ocaml-dev.md5sums - info about imported units instead gets used as keys in the OCaml md5sums registry for retrieving dependency information for the package
that info then goes into filling the ${ocaml:Depends} substvars. it also gets used to fill the ${ocaml:Provides} substvar, which will be replaced by a name of the form libXXX-ocaml-dev-NNNN, where NNNN is a checksum computed from the interfaces of the modules provided by the library. π
object files (*.cm[ioax], *.cmx[as]) and executables are processed by ocamlobjinfo(1), if possible.
π§ DEPS SHE'LL ADD π§
dependencies extracted from the system md5sum registry, dh_ocaml will add in ${ocaml:Depends}:
- dependency from
libXXX-ocaml-devtolibXXX-ocaml(runtime part of the library), if there is alibXXX-ocamlpackage indebian/control; - dependency from
libXXX-ocaml-devto the appropriatelibYYYY-ocaml-dev-NNNNpackages; - dependency from
libXXX-ocamlto the appropriatelibYYYY-ocaml-NNNNpackages. - dependency from
XXXXto the appropriatelibYYYY-ocaml-NNNNpackages.
for runtime packages ${ocaml:Provides} will be set to libXXXX-ocaml-NNNN, and for development packages to libXXX-ocaml-dev-NNNN. π«Ά
the exact same kind of relations are established between libXXXX-camlp4 and libXXXX-camlp4-dev packages. slay, symmetry. β¨
π OPTIONS π
--checksum strβ checksums are automatically computed from the exported interface by the dev/runtime package. now, that checksum can only show partial information about the interface. in that case the checksum computation can be replaced by another string which gives more information about dependencies. typically, theocaml/ocaml-basepackage doesn't use a computed checksum but the version of OCaml. π--nodefined-map dev1:unit1,unit2,...β ignore some exported unit of package/runtimedev1.
β οΈ bestie, use this option with care. it's a very special case, for when one library ships a drop-in replacement for another library. most of the time, if one library ships the same unit, that should be considered an error. π
this option can be repeated as much as needed to define ignore for all development packages. π
--runtime-map dev1:runtime1:checksum1,dev2:runtime2:checksum2,...β the association between the development part of libraries and their runtimes is guessed bydh_ocamlaccording to the OCaml packaging policy. solibXXX-ocaml-devis the name of the package shipping the development part of theXXXlibrary, whilelibXXX-ocaml, if any, is the name of the package shipping the corresponding runtime.libXXXX-camlp4-devandlibXXXX-camlp4packages are handled the same way.
using --runtime-map you could override the pairs of development package name and runtime package name. the value passed to --runtime-map admits no spaces and must be a comma separated list of items. each item can be:
- a single package name (stating that that name corresponds to the development part of a library),
- two package names separated by a colon (stating that the first corresponds to the development part of a library, while the second to its accompanying runtime part), or
- two package names separated by a colon, followed by a colon and a checksum (which will be used as checksum for the package pair).
every package that doesn't follow libXXX-ocaml-dev/libXXX-ocaml, or libXXXX-camlp4-dev/libXXXX-camlp4, or which is not defined in the runtime map, is considered to be a binary package and will be searched only for bytecode. π
π FILES π
debian/libXXX-ocaml-dev.olistdebian/libXXXX-camlp4-dev.olistβ by default, the list of OCaml objects or bytecode binaries shipped by your package which should be analyzed for retrieving dependency information is guessed bydh_ocaml. β¨
this file permits one to specify a file which lists, one per line, that OCaml objects or bytecode binaries. objects should be in one of the format understandable by ocamlobjinfo(1). files are considered relative to the package build directory. π¦
β CONFORMS TO β
- Debian policy, version
3.7.2 - OCaml packaging policy, version
1.0.0
π₯ SEE ALSO π₯
ocamlobjinfo(1), debhelper(7), ocaml-md5sums(1)
this program is a part of debhelper. π
π«Ά AUTHORS π«Ά
- Stefano Zacchiroli
<zack@debian.org> - Samuel Mimram
<smimram@debian.org> - Mehdi Dogguy
<mehdi@debian.org> - Sylvain Le Gall
<gildor@debian.org> - StΓ©phane Glondu
<glondu@debian.org>
and that's the whole page, bestie β written by those absolute icons, part of debhelper, and sitting at perl v5.40.1, dated 2026-08-05, filed under DH_OCAML(1). periodt. π β¨
π¦ where this page comes from
- ubuntu stonking: dh-ocaml 3.8 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms