CABAL-MODULE(5)
okay bestie, welcome to CABAL-MODULE(5) from the File Formats Manual β itβs giving βhow do I build Haskell stuff in the ports(7) tree without losing my mindβ energy, and honestly? iconic.
β¨ 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) tree.
It uses cabal(1) 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) 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) 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. π«Ά
The module parameters are:
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-dirfrom.cabalfile (if executable needs this).MODCABAL_REVISIONβ numeric revision of.cabalfile on hackage if one is needed on top of.cabalfile contained in the.tar.gzfile.MODCABAL_BUILD_ARGSβ passed tocabal v2-build.MODCABAL_FLAGSβ custom feature--flagsforcabal(1).MODCABAL_EXECUTABLESβ executable target in.cabalfile, defaults to hackage package name inMODCABAL_STEM.
This module currently adds no make(1) targets. periodt. π
π§ 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 the cabal-bundler port, look up the chosen package version number on hackage. E.g.
$ cabal-bundler --openbsd cpphs-1.20
π SEE ALSO π
mwah π β this page is brought to you by Debian, dated August 16, 2025. slay.
π¦ where this page comes from
- nixpkgs unstable: cvs-export
- Copyright (c) 2021 Greg Steuck
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms