Cabal-hooks: API for the Hooks build-type

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

User-facing API for the Hooks build-type.


[Skip to Readme]

Properties

Versions 3.14, 3.14
Change log changelog.md
Dependencies base (>=4.13 && <5), Cabal (>=3.14 && <3.15), Cabal-syntax (>=3.14 && <3.15), containers (>=0.5.0.0 && <0.8), transformers (>=0.5.6.0 && <0.7) [details]
License BSD-3-Clause
Copyright 2023, Cabal Development Team
Author Cabal Development Team <cabal-devel@haskell.org>
Maintainer cabal-devel@haskell.org
Category Distribution
Home page http://www.haskell.org/cabal/
Bug tracker https://github.com/haskell/cabal/issues
Source repo head: git clone https://github.com/haskell/cabal/(Cabal-hooks)
Uploaded by hecate at 2025-01-02T19:47:28Z

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for Cabal-hooks-3.14

[back to package description]

Cabal-hooks

This library provides an API for the Cabal Hooks build type.

What is the Hooks build type?

The Hooks build type is a new Cabal build type that is scheduled to replace the Custom build type, providing better integration with the rest of the Haskell ecosystem.

The original specification for the Hooks build type can be found in the associated Haskell Foundation Tech Proposal.

These setup hooks allow package authors to customise the configuration and building of a package by providing certain hooks that get folded into the general package configuration and building logic within Cabal.

Defining a package with custom hooks

To use the Hooks build type, you will need to

That is, your .cabal file should contain the following

-- my-package.cabal
cabal-version: 3.14
name: my-package
build-type: Hooks

custom-setup
  setup-depends:
    Cabal-hooks >= 0.1 && < 0.2

and your SetupHooks.hs file should look like:

-- SetupHooks.hs
module SetupHooks ( setupHooks ) where

-- Cabal-hooks
import Distribution.Simple.SetupHooks

setupHooks :: SetupHooks
setupHooks = ...
  -- use the API provided by 'Distribution.Simple.SetupHooks'
  -- to define the hooks relevant to your package

Using the API

The Haddock documentation should help you get started using this library's API.