[ previous ] [ Contents ] [ 1 ] [ 2 ] [ next ]


Haskell Policy
Chapter 2 - Haskell Libraries — binary packages


2.1 Package types

For each packaged Cabal library, up to three binary packages are built:

  1. The library itself.

  1. The documentation package.

  1. The profiling package.

The latter two are optional and can be omitted if there are valid reasons to do so. Possible valid reasons could be that the documentation is useless because a lot of the libraries functions are auto-generated by TH or that building the profiling libraries puts too much burdon on weak architecture's build daemons.


2.2 Package names

The name of the Debian packages for a given haskell library are derived from the Cabal name of the library in question, following these rules:

  1. All characters are lower-cased.

  1. Underscores are turned into dashes.

  1. The name is prepended with libghc6-. This name will change if the major version of GHC used in Debian changes.

  1. If there is more than one version of this Cabal package to be shipped with Debian, a significant part of the Version number is appended.

  1. The name is appended with -dev, -doc or -prof, depending on the type of the package.


2.3 Virtual ABI packages

The library and profiling library also have a virtual ABI package name. It is calculated by the same rules, but does not allow for a version number after the Cabal name and appends, separated by dashes, the cabal version and the first five characters of the ABI hash, lowercased. The ABI hash can be obtained using ghc-pkg field pkg id, it is the last portion of that string.


2.4 Package relationships

Between the possibly three packages per Cabal library, the following relations should be in place:

  1. The library package suggests the documentation and the profiling packages, if they exist.

  1. The documentation package suggests the library package.

  1. The profiling package depends on the library package with an exact version constraing on the binary version.

The library and profiling package should Provide their respective virtual ABI package name.

The library and profiling package depends, for each Haskell library depended upon, on the virtual ABI package name of the version of the corresponding library or profiling packages built against, if that package provides that name. If it does not, a dependency on the real package name with a version constraint requiring the current upstream version is added as a fallback. This also covers the dependency on the correct compiler package, as it provides the base package.

The documentation package recommends any other documentation package that ships HTML pages which are linked by this package.

A Haskell library package providing bindings for a C library should depend on the corresponding development package containing the C library headers.


2.5 Installed files and locations

The ghc-pkg package configuration file is contained in the library package and installed as /var/lib/ghc-ghc_version/package.conf.d/cabal_name-cabal_version.conf. The following fields should be set:

  1. library-dirs: /usr/lib/haskell-packages/ghc6/lib/cabal_name-cabal_version/ghc-ghc_version

  1. haddock-interfaces: /usr/lib/ghc-ghc_version/haddock/cabal_name-cabal_version/cabal_name.haddock

  1. haddock-html: /usr/share/doc/documentation_package_name/html

The library package installs the Haskell interface files (.hi), shared and static libraries (.o and .a) and includes files (.h) into a directory tree based in the directory mentioned in library-dirs. It also contains the Haddock file.

The profiling package installs the profiling variants of the above files (_p.a, .p_hi) into the same directory.

The documentation package installs the API documentation into the directory specified by the field haddock-html.


[ previous ] [ Contents ] [ 1 ] [ 2 ] [ next ]


Haskell Policy

0.2.0

Joachim Breitner nomeata@debian.org