File: Setup.hs

package info (click to toggle)
haskell-unbounded-delays 0.1.0.8-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 68 kB
  • sloc: haskell: 82; makefile: 2
file content (19 lines) | stat: -rw-r--r-- 935 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#! /usr/bin/env runhaskell

import Distribution.Simple                ( defaultMainWithHooks
                                          , simpleUserHooks
                                          , UserHooks(haddockHook)
                                          )
import Distribution.Simple.Setup          ( HaddockFlags )
import Distribution.Simple.Program        ( userSpecifyArgs )
import Distribution.Simple.LocalBuildInfo ( LocalBuildInfo(withPrograms) )
import Distribution.PackageDescription    ( PackageDescription )

main :: IO ()
main = defaultMainWithHooks $ simpleUserHooks { haddockHook = haddockHook' }

-- Define __HADDOCK__ for CPP when running haddock.
haddockHook' :: PackageDescription -> LocalBuildInfo -> UserHooks -> HaddockFlags -> IO ()
haddockHook' pkg lbi = haddockHook simpleUserHooks pkg $ lbi { withPrograms = p }
    where
      p = userSpecifyArgs "haddock" ["--optghc=-D__HADDOCK__"] (withPrograms lbi)