X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=libraries%2FinstallPackage.hs;h=475a55e31e2b5e18a6e9f6809180ec2d71d97ad6;hb=2069911cfbc3d31dfdb34845b3fe17ab7b770aa6;hp=01bde4732304f9a8ff222c365f697c33c1671f4f;hpb=8fa821cd48cdf0a265df8915e4330d3b6fb9e6a3;p=ghc-hetmet.git diff --git a/libraries/installPackage.hs b/libraries/installPackage.hs index 01bde47..475a55e 100644 --- a/libraries/installPackage.hs +++ b/libraries/installPackage.hs @@ -13,7 +13,9 @@ main :: IO () main = do args <- getArgs case args of - destdir : pref : idatadir : idocdir : ghcpkg : ghcpkgconf : args' -> + destdir : ipref : ibindir : ilibdir : ilibexecdir + : idatadir : idocdir : ihtmldir_copy : ihtmldir_reg + : ghcpkg : ghcpkgconf : args' -> let verbosity = case args' of [] -> normal ['-':'v':v] -> @@ -22,15 +24,20 @@ main _ -> Just v in flagToVerbosity m _ -> error ("Bad arguments: " ++ show args) - in doit destdir pref idatadir idocdir ghcpkg ghcpkgconf - verbosity + in doit destdir ipref ibindir ilibdir + ilibexecdir idatadir idocdir + ihtmldir_copy ihtmldir_reg + ghcpkg ghcpkgconf verbosity _ -> error "Missing arguments" -doit :: FilePath -> FilePath -> FilePath -> FilePath -> FilePath -> FilePath +doit :: FilePath -> FilePath -> FilePath -> FilePath -> FilePath + -> FilePath -> FilePath -> FilePath -> FilePath -> FilePath + -> FilePath -> Verbosity -> IO () -doit destdir pref idatadir idocdir ghcpkg ghcpkgconf verbosity = +doit destdir ipref ibindir ilibdir ilibexecdir idatadir idocdir + ihtmldir_copy ihtmldir_reg ghcpkg ghcpkgconf verbosity = do let userHooks = simpleUserHooks copyto = if null destdir then NoCopyDest else CopyTo destdir copyFlags = (emptyCopyFlags copyto) { @@ -61,9 +68,13 @@ doit destdir pref idatadir idocdir ghcpkg ghcpkgconf verbosity = 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, - dataDirTemplate = toPathTemplate idatadir, - docDirTemplate = toPathTemplate idocdir + i_copy = i { prefixDirTemplate = toPathTemplate ipref, + binDirTemplate = toPathTemplate ibindir, + libDirTemplate = toPathTemplate ilibdir, + libexecDirTemplate = toPathTemplate ilibexecdir, + dataDirTemplate = toPathTemplate idatadir, + docDirTemplate = toPathTemplate idocdir, + htmlDirTemplate = toPathTemplate ihtmldir_copy } lbi_copy = lbi { installDirTemplates = i_copy } -- When we run GHC we give it a $topdir that includes the @@ -78,7 +89,14 @@ doit destdir pref idatadir idocdir ghcpkg ghcpkgconf verbosity = programLocation = UserSpecified ghcpkg } progs' = updateProgram prog progs - i_reg = i { libSubdirTemplate = toPathTemplate "$pkgid" } + i_reg = i { prefixDirTemplate = toPathTemplate ipref, + binDirTemplate = toPathTemplate ibindir, + libDirTemplate = toPathTemplate ilibdir, + libexecDirTemplate = toPathTemplate ilibexecdir, + dataDirTemplate = toPathTemplate idatadir, + docDirTemplate = toPathTemplate idocdir, + htmlDirTemplate = toPathTemplate ihtmldir_reg + } lbi_reg = lbi { installDirTemplates = i_reg, withPrograms = progs' } (copyHook simpleUserHooks) pd_copy lbi_copy userHooks copyFlags