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-dev or libXXXX-camlp4-dev) πŸŽ€
  • the ones shipping the runtime for OCaml libraries β€” think plugin and shared library β€” usually named libXXX-ocaml or libXXXX-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}:

  1. dependency from libXXX-ocaml-dev to libXXX-ocaml (runtime part of the library), if there is a libXXX-ocaml package in debian/control;
  2. dependency from libXXX-ocaml-dev to the appropriate libYYYY-ocaml-dev-NNNN packages;
  3. dependency from libXXX-ocaml to the appropriate libYYYY-ocaml-NNNN packages.
  4. dependency from XXXX to the appropriate libYYYY-ocaml-NNNN packages.

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, the ocaml/ocaml-base package doesn't use a computed checksum but the version of OCaml. πŸ“
  • --nodefined-map dev1:unit1,unit2,... β€” ignore some exported unit of package/runtime dev1.
⚠️ 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 by dh_ocaml according to the OCaml packaging policy. so libXXX-ocaml-dev is the name of the package shipping the development part of the XXX library, while libXXX-ocaml, if any, is the name of the package shipping the corresponding runtime. libXXXX-camlp4-dev and libXXXX-camlp4 packages 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.olist debian/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 by dh_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