Commit 951dad7b authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Alter the base:GHC.Prim hack in installPackage, following changes in base

parent 9fddc216
...@@ -52,20 +52,18 @@ doit verbosity ghcpkg ghcpkgconf destdir topdir ...@@ -52,20 +52,18 @@ doit verbosity ghcpkg ghcpkgconf destdir topdir
lbi <- getConfig verbosity lbi <- getConfig verbosity
let pd = localPkgDescr lbi let pd = localPkgDescr lbi
i = installDirTemplates lbi i = installDirTemplates lbi
-- XXX This is an almighty hack, shadowing the base -- This is an almighty hack. We need to register
-- Setup.hs hack -- base:GHC.Prim, but it doesn't exist, get built, get
mkLib filt = case library pd of -- haddocked, get copied, etc.
Just lib -> pd_reg = if pkgName (package pd) == "base"
let ems = filter filt $ exposedModules lib then case library pd of
in lib { Just lib ->
exposedModules = ems let ems = "GHC.Prim" : exposedModules lib
} lib' = lib { exposedModules = ems }
Nothing -> in pd { library = Just lib' }
error "Expected a library, but none found" Nothing ->
-- There's no files for GHC.Prim, so we will fail if we error "Expected a library, but none found"
-- try to copy them else pd
pd_copy = pd { library = Just (mkLib ("GHC.Prim" /=)) }
pd_reg = pd { library = Just (mkLib (const True)) }
-- When coying, we need to actually give a concrete -- When coying, we need to actually give a concrete
-- directory to copy to rather than "$topdir" -- directory to copy to rather than "$topdir"
toPathTemplate' = toPathTemplate . replaceTopdir topdir toPathTemplate' = toPathTemplate . replaceTopdir topdir
...@@ -102,8 +100,8 @@ doit verbosity ghcpkg ghcpkgconf destdir topdir ...@@ -102,8 +100,8 @@ doit verbosity ghcpkg ghcpkgconf destdir topdir
} }
lbi_reg = lbi { installDirTemplates = i_reg, lbi_reg = lbi { installDirTemplates = i_reg,
withPrograms = progs' } withPrograms = progs' }
(copyHook simpleUserHooks) pd_copy lbi_copy userHooks copyFlags (copyHook simpleUserHooks) pd lbi_copy userHooks copyFlags
(regHook simpleUserHooks) pd_reg lbi_reg userHooks registerFlags (regHook simpleUserHooks) pd_reg lbi_reg userHooks registerFlags
return () return ()
replaceTopdir :: FilePath -> FilePath -> FilePath replaceTopdir :: FilePath -> FilePath -> FilePath
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment