1 {-# LANGUAGE DuplicateRecordFields #-}
2 {-# LANGUAGE OverloadedStrings #-}
3 {-# LANGUAGE StaticPointers #-}
5 module SetupHooks
where
7 import Distribution
.Simple
.LocalBuildInfo
(interpretSymbolicPathLBI
)
8 import Distribution
.Simple
.SetupHooks
9 import Distribution
.Utils
.Path
(sameDirectory
, makeRelativePathEx
)
11 import qualified Data
.List
.NonEmpty
as NE
( NonEmpty
(..) )
13 setupHooks
:: SetupHooks
18 { preBuildComponentRules
= Just
$ rules
(static
()) missingDepRules
22 missingDepRules
:: PreBuildComponentInputs
-> RulesM
()
23 missingDepRules
(PreBuildComponentInputs
{ localBuildInfo
= lbi
, targetInfo
= tgt
}) = do
24 let clbi
= targetCLBI tgt
25 autogenDir
= autogenComponentModulesDir lbi clbi
26 action
= mkCommand
(static Dict
) (static
(\ _
-> error "This should not run")) ()
29 [ FileDependency
$ Location sameDirectory
(makeRelativePathEx
"Missing.hs") ]
30 ( Location autogenDir
(makeRelativePathEx
"G.hs") NE
.:|
[] )