-
Notifications
You must be signed in to change notification settings - Fork 2
/
Setup.hs
21 lines (19 loc) · 810 Bytes
/
Setup.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import Distribution.Simple
import Distribution.Simple.Setup ( haddockDistPref, Flag(..))
import Distribution.Verbosity ( normal )
import Distribution.Simple.Utils ( copyFiles )
import Distribution.Text ( display )
import System.FilePath ((</>))
import System.Directory
-- Ugly hack, logic copied from Distribution.Simple.Haddock
haddockOutputDir flags pkg = destDir
where
baseDir = case haddockDistPref flags of
NoFlag -> "."
Flag x -> x
destDir = baseDir </> "doc" </> "html" </> display (packageName pkg)
main = defaultMainWithHooks simpleUserHooks {
postHaddock = \args flags pkg lbi -> do
copyFiles normal (haddockOutputDir flags pkg) [("doc","split.png")]
postHaddock simpleUserHooks args flags pkg lbi
}