Contents

Package Naming

For libraries, use Template:Filename. For applications, use the program name. In either case, the pkgname should be entirely lowercase.

OCaml Library Locations

OCaml libraries should be installed under Template:Filename. Libraries were previously installed under Template:Filename or Template:Filename, depending on the package. This mixture prevented some packages from working with others and fragmented OCaml development on Arch Linux. The use of Template:Filename has therefore been discontinued.

OCaml libraries should be installed using Template:Package Official. Template:Codeline includes library metadata in the package that makes it easy to manage libraries. It is a de-facto standard and a lot of OCaml software now requires it.

Template:Codeline extracts necessary data from a file named Template:Filename that should be included in the source archive. If this file is not included, one should either be obtained from the corresponding Debian, Ubuntu, or Fedora package, or created for the package by the maintainer. A request to include the file should also be made to the upstream developers of the package.

OCaml Bytecode and Levels

OCaml can run code on multiple "levels", the top level interprets OCaml Code without compiling, the bytecode level creates machine independent bytecode and the native level creates machine code binaries (just like C/C++).

When building OCaml Packages you need to be aware if the build process is compiling native machine code, bytecode, or as in many cases both. This creates a number of situations which can cause problems with package options and the right dependencies.

If bytecode is produced at all then the PKGBUILD must contain the following to protect the bytecode:

options=('!strip')

If the package does not contain bytecode and only distributes a binary, then Template:Codeline is not needed as a dependency, but it of course is required as a makedepends since the Template:Codeline package provides the OCaml compiler. If the package contains both native code and bytecode then Template:Codeline should be a dependency and a makedepends.

OCaml code is rarely (if ever) distributed as bytecode only and will almost always include native code: the only case where using any as the arch is advisable is when only un-compiled source code is distributed, usually with a library, though many libraries still distribute native code.

The moral of the story here is to be aware of what it is you are distributing, chances are your package contains both native machine code and bytecode.

Keep in mind that many OCaml Packages will often need extra parameters passed to make and make install. Also remember to remove the '!strip' option and change the architecture if the package does not produce bytecode.