---
name: "cabal-module"
section: "5"
platform: "openbsd"
package: "man"
version: "8.0-current-20261101"
release: "OpenBSD 8.0-current (2026-11-01)"
platforms: ["openbsd"]
url: "https://new.carta.tech/cabal-module"
---

# cabal-module(5)

devel/cabal port module for building Haskell programs

## NAME

**cabal-module** – devel/cabal port module for building Haskell programs

## DESCRIPTION

This manual page documents the behavior of setting MODULES=devel/cabal in the [ports(7)](/ports/7.md) tree.

Uses [cabal(1)](/cabal/1.md) to automate packaging Haskell binary projects. During **fetch**, the dependent packages enumerated in MODCABAL\_MANIFEST are downloaded into the *hackage* subdirectory of DIST\_SUBDIR. During **post-extract**, the dependency sources are unpacked into WORKDIR. Special care is taken to replace .cabal files if they are updated post-release on hackage. A custom *cabal.project.local* file gets created to direct [cabal(1)](/cabal/1.md) to the extracted packages and prevent any network interaction. In rare cases a custom *cabal.project* is required. This module automatically copies such files from port's *files* into WRKSRC. During **build**, [cabal(1)](/cabal/1.md) is invoked to build the executables listed in MODCABAL\_EXECUTABLES.

*lang/ghc* and *devel/cabal-install* are added to BUILD\_DEPENDS. This module uses SITES.hs to download the sources from hackage.

This module parameters:

- MODCABAL\_STEM

  Name of the package on hackage (required).

- MODCABAL\_VERSION

  Version of the package (required).

- MODCABAL\_MANIFEST

  Hackage dependencies required by this package, see below.

- MODCABAL\_DATA\_DIR

  data-dir from .cabal file (if executable needs this)

- MODCABAL\_REVISION

  Numeric revision of .cabal file on hackage if one is needed on top of .cabal file contained in the .tar.gz file.

- MODCABAL\_BUILD\_ARGS

  passed to cabal v2-build

- MODCABAL\_FLAGS

  custom feature **--flags** for [cabal(1)](/cabal/1.md).

- MODCABAL\_EXECUTABLES

  Executable target in .cabal file, defaults to hackage package name in MODCABAL\_STEM.

This module adds currently adds no [make(1)](/make/1.md) targets.

## DEPENDENCY MANIFEST

Hackage dependencies are listed in MODCABAL\_MANIFEST as space separate triples of *package* *version* *revision*. They correspond to the main package values of MODCABAL\_STEM MODCABAL\_VERSION MODCABAL\_REVISION.

The contents of MODCABAL\_MANIFEST is normally generated by *devel/cabal-bundler* which creates a working build plan from hackage dependency information.

## EXAMPLES

To create a new Haskell binary port one would install cabal-bundler port, look up the chosen package version number on hackage. E.g.

$ **cabal-bundler** **--openbsd** *cpphs-1.20*

## SEE ALSO

[cabal(1)](/cabal/1.md), [port-modules(5)](/port-modules/5.md)
