-main = defaultMainWithHooks $
- simpleUserHooks { postConf = postConfHook (postConf simpleUserHooks) }
+import System.FilePath
+
+main = defaultMainWithHooks $ simpleUserHooks
+ { postInst = postInstHook (postInst simpleUserHooks)
+ , postConf = postConfHook (postConf simpleUserHooks)
+ }
+
+postInstHook oldHook args iflags pDesc lbi = do
+ let instDataDir = datadir $ absoluteInstallDirs pDesc lbi (fromFlag $ copyDest defaultCopyFlags)
+ putStrLn "To enable the GHCi integration, you have to load a ghci file in GHCi. To do this automatically when GHCi is started run:"
+ putStrLn $ "echo \":script " ++ (instDataDir </> "ghci") ++ "\" >> ~/.ghci"
+
+ oldHook args iflags pDesc lbi
+