---
name: "dh_haskell_build"
section: "1"
platform: "linux"
package: "haskell-devscripts"
version: "0.6.15"
release: "Debian 5.0 (Lenny)"
platforms: ["linux"]
url: "https://new.carta.tech/dh_haskell"
---

# dh\_haskell\_build(1)

Builds Cabalized libraries, calculates Haskell dependencies, and adds postinst and prerm Haskell scripts

Part of [dh\_haskell(1)](/dh_haskell/1.md).

## NAME

dh\_haskell - Builds Cabalized libraries, calculates Haskell dependencies, and adds postinst and prerm Haskell scripts

## SYNOPSIS

**dh\_haskell** \[*debhelper options*\]

**dh\_haskell\_prep** \[*debhelper options*\]

**dh\_haskell\_configure** \[*debhelper options*\]

**dh\_haskell\_build** \[*debhelper options*\]

**dh\_haskell\_install** \[*debhelper options*\]

**dh\_haskell\_buildinst** \[*debhelper options*\]

**dh\_haskell\_depends** \[*debhelper options*\]

## DESCRIPTION

dh\_haskell is a debhelper program that helps with building Haskell libraries.

It does several things.  It can generate postinst and prerm scripts when necessary.  It automates building libraries for the different supported Haskell systems in Debian.  It generates substvars for your control file so that the library packages depend on the appropriate packages. In short, it can drive the entire process.

## REQUIREMENTS

dh\_haskell assumes that your packages are adhering to the draft Haskell policy.

Your control file must build the binary library files using packages named lib*type*-*name*-*variation*, where *type* is ghc5, ghc6, or nhc98; *name* is the name of your package; and *variation* is dev or prof. These packages should be Architecture: any.

The *prof* package contains profiling enabled libraries. Currently only GHC supports profiling. Due to restrictions of the GHC compiler, if you provide a *dev* package you should also provide a corresponding *prof* package.

If you build a Hugs package, name it libhugs-*name*.  However, dh\_haskell will also accept libhugs-*name*-dev for consistency.  Most Hugs packages should be Architecture: all.  If your package uses foreign methods, maybe it should be Architecture: any (please let me know if you have an answer to that).

dh\_haskell figures out how to build your package based on the *type*, so you must adhere to this naming scheme.

dh\_haskell assumes that the Haskell Cabal (see www.haskell.org/cabal) can be used to build your package.  It obtains package name and version information from the Cabal Setup.Description file.

## HOW TO PACKAGE A HASKELL LIBRARY

Start from a basic debian/ directory.  Add entries to Build-Depends for haskell-devscripts and the compilers for any binaries you will build.

In the clause in control for each binary package, make sure to add ${haskell:Depends} to the Depends: line.

In rules, in the install target, add dh\_haskell.  Your build and configure targets should be empty.

Remember that you should add -a to all debhelper calls for multi-binary packages.  That goes for dh\_haskell too.

Your clean target should contain:

`"-./setup clean"` `"--rm -rf setup Setup.hi Setup.ho Setup.o .*config* dist"`

That's it.  dh\_haskell does the rest.

## EXAMPLES

See the Debian source packages for haskelldb, haskell-filepath, haskell-hsql,  haskell-http etc.

also see:

darcs get --partial http://www.n-heptane.com/nhlab/repos/cabalDebianTemplate/

## BUGS

hugs, ghc6, and ghc5 are the only supported targets at the moment.  Cabal does not yet support nhc98.  Note though that there are some known bugs in Cabal relating to ghc5 support.

## SEE ALSO

[*debhelper*(7)](/debhelper/7.md)

## AUTHOR

John Goerzen \<jgoerzen@complete.org\>

Based on ideas in dh\_python by Josselin Mouette \<joss@debian.org\>
