1 import Distribution.Simple
2 import Distribution.Simple.Setup
3 import Distribution.Simple.LocalBuildInfo
4 import Distribution.PackageDescription (PackageDescription)
8 main = defaultMainWithHooks $ simpleUserHooks
9 { postInst = postInstHook (postInst simpleUserHooks)
10 , postConf = postConfHook (postConf simpleUserHooks)
13 postInstHook oldHook args iflags pDesc lbi = do
14 let instDataDir = datadir $ absoluteInstallDirs pDesc lbi (fromFlag $ copyDest defaultCopyFlags)
15 putStrLn "To enable the GHCi integration, you have to load a ghci file in GHCi. To do this automatically when GHCi is started run:"
16 putStrLn $ "echo \":script " ++ (instDataDir </> "ghci") ++ "\" >> ~/.ghci"
18 oldHook args iflags pDesc lbi
21 postConfHook oldHook args flags descr buildInfo = case profFlag of
22 Flag True -> error "This library cannot be built using profiling. Try invoking cabal with the --disable-library-profiling flag."
23 _ -> oldHook args flags descr buildInfo
24 where profFlag = configProfLib $ configFlags buildInfo