main
= do args <- getArgs
case args of
- destdir : pref : ihtmldir : ghcpkg : ghcpkgconf : args' ->
+ destdir : pref : ibindir : ilibdir : ilibexecdir
+ : idatadir : idocdir : ihtmldir
+ : ghcpkg : ghcpkgconf : args' ->
let verbosity = case args' of
[] -> normal
['-':'v':v] ->
_ -> Just v
in flagToVerbosity m
_ -> error ("Bad arguments: " ++ show args)
- in doit destdir pref ihtmldir ghcpkg ghcpkgconf
- verbosity
+ in doit destdir pref ibindir ilibdir ilibexecdir idatadir
+ idocdir ihtmldir
+ ghcpkg ghcpkgconf verbosity
_ ->
error "Missing arguments"
doit :: FilePath -> FilePath -> FilePath -> FilePath -> FilePath
+ -> FilePath -> FilePath -> FilePath -> FilePath -> FilePath
-> Verbosity
-> IO ()
-doit destdir pref ihtmldir ghcpkg ghcpkgconf verbosity =
+doit destdir pref ibindir ilibdir ilibexecdir idatadir idocdir
+ ihtmldir ghcpkg ghcpkgconf verbosity =
do let userHooks = simpleUserHooks
copyto = if null destdir then NoCopyDest else CopyTo destdir
copyFlags = (emptyCopyFlags copyto) {
pd_reg = pd { library = Just (mkLib (const True)) }
-- When coying, we need to actually give a concrete
-- directory to copy to rather than "$topdir"
- i_copy = i { prefixDirTemplate = toPathTemplate pref,
- htmlDirTemplate = toPathTemplate ihtmldir
+ i_copy = i { prefixDirTemplate = toPathTemplate pref,
+ binDirTemplate = toPathTemplate ibindir,
+ libDirTemplate = toPathTemplate ilibdir,
+ libexecDirTemplate = toPathTemplate ilibexecdir,
+ dataDirTemplate = toPathTemplate idatadir,
+ docDirTemplate = toPathTemplate idocdir,
+ htmlDirTemplate = toPathTemplate ihtmldir
}
lbi_copy = lbi { installDirTemplates = i_copy }
-- When we run GHC we give it a $topdir that includes the