Commit 7022469a authored by Ian Lynagh's avatar Ian Lynagh
Browse files

More library installation path fiddling

parent bb1facad
...@@ -336,7 +336,7 @@ $(foreach SUBDIR,$(SUBDIRS),install.library.$(SUBDIR)): \ ...@@ -336,7 +336,7 @@ $(foreach SUBDIR,$(SUBDIRS),install.library.$(SUBDIR)): \
install.library.%: installPackage/installPackage ifBuildable/ifBuildable install.library.%: installPackage/installPackage ifBuildable/ifBuildable
if ifBuildable/ifBuildable $*; then \ if ifBuildable/ifBuildable $*; then \
cd $* && \ cd $* && \
../installPackage/installPackage '$(DESTDIR)' '$(prefix)' '$(bindir)' '$(libdir)' '$(libexecdir)' '$(datadir)' '$(docdir)' '$(htmldir_install)' '$(GHC_PKG_PROG)' '$(DESTDIR)$(libdir)/package.conf' ; \ ../installPackage/installPackage '$(DESTDIR)' '$(prefix)' '$(bindir)' '$(libdir)' '$(libexecdir)' '$(datadir)' '$(docdir)' '$(htmldir_install)' '$(htmldir_configure)' '$(GHC_PKG_PROG)' '$(DESTDIR)$(libdir)/package.conf' ; \
fi fi
.PHONY: binary-dist binary-dist.library.% .PHONY: binary-dist binary-dist.library.%
......
...@@ -13,8 +13,8 @@ main :: IO () ...@@ -13,8 +13,8 @@ main :: IO ()
main main
= do args <- getArgs = do args <- getArgs
case args of case args of
destdir : pref : ibindir : ilibdir : ilibexecdir destdir : ipref : ibindir : ilibdir : ilibexecdir
: idatadir : idocdir : ihtmldir : idatadir : idocdir : ihtmldir_copy : ihtmldir_reg
: ghcpkg : ghcpkgconf : args' -> : ghcpkg : ghcpkgconf : args' ->
let verbosity = case args' of let verbosity = case args' of
[] -> normal [] -> normal
...@@ -24,18 +24,20 @@ main ...@@ -24,18 +24,20 @@ main
_ -> Just v _ -> Just v
in flagToVerbosity m in flagToVerbosity m
_ -> error ("Bad arguments: " ++ show args) _ -> error ("Bad arguments: " ++ show args)
in doit destdir pref ibindir ilibdir ilibexecdir idatadir in doit destdir ipref ibindir ilibdir
idocdir ihtmldir ilibexecdir idatadir idocdir
ihtmldir_copy ihtmldir_reg
ghcpkg ghcpkgconf verbosity ghcpkg ghcpkgconf verbosity
_ -> _ ->
error "Missing arguments" error "Missing arguments"
doit :: FilePath -> FilePath -> FilePath -> FilePath -> FilePath doit :: FilePath -> FilePath -> FilePath -> FilePath -> FilePath
-> FilePath -> FilePath -> FilePath -> FilePath -> FilePath -> FilePath -> FilePath -> FilePath -> FilePath -> FilePath
-> FilePath
-> Verbosity -> Verbosity
-> IO () -> IO ()
doit destdir pref ibindir ilibdir ilibexecdir idatadir idocdir doit destdir ipref ibindir ilibdir ilibexecdir idatadir idocdir
ihtmldir ghcpkg ghcpkgconf verbosity = ihtmldir_copy ihtmldir_reg ghcpkg ghcpkgconf verbosity =
do let userHooks = simpleUserHooks do let userHooks = simpleUserHooks
copyto = if null destdir then NoCopyDest else CopyTo destdir copyto = if null destdir then NoCopyDest else CopyTo destdir
copyFlags = (emptyCopyFlags copyto) { copyFlags = (emptyCopyFlags copyto) {
...@@ -66,13 +68,13 @@ doit destdir pref ibindir ilibdir ilibexecdir idatadir idocdir ...@@ -66,13 +68,13 @@ doit destdir pref ibindir ilibdir ilibexecdir idatadir idocdir
pd_reg = pd { library = Just (mkLib (const True)) } 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"
i_copy = i { prefixDirTemplate = toPathTemplate pref, i_copy = i { prefixDirTemplate = toPathTemplate ipref,
binDirTemplate = toPathTemplate ibindir, binDirTemplate = toPathTemplate ibindir,
libDirTemplate = toPathTemplate ilibdir, libDirTemplate = toPathTemplate ilibdir,
libexecDirTemplate = toPathTemplate ilibexecdir, libexecDirTemplate = toPathTemplate ilibexecdir,
dataDirTemplate = toPathTemplate idatadir, dataDirTemplate = toPathTemplate idatadir,
docDirTemplate = toPathTemplate idocdir, docDirTemplate = toPathTemplate idocdir,
htmlDirTemplate = toPathTemplate ihtmldir htmlDirTemplate = toPathTemplate ihtmldir_copy
} }
lbi_copy = lbi { installDirTemplates = i_copy } lbi_copy = lbi { installDirTemplates = i_copy }
-- When we run GHC we give it a $topdir that includes the -- When we run GHC we give it a $topdir that includes the
...@@ -87,7 +89,14 @@ doit destdir pref ibindir ilibdir ilibexecdir idatadir idocdir ...@@ -87,7 +89,14 @@ doit destdir pref ibindir ilibdir ilibexecdir idatadir idocdir
programLocation = UserSpecified ghcpkg programLocation = UserSpecified ghcpkg
} }
progs' = updateProgram prog progs 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, lbi_reg = lbi { installDirTemplates = i_reg,
withPrograms = progs' } withPrograms = progs' }
(copyHook simpleUserHooks) pd_copy lbi_copy userHooks copyFlags (copyHook simpleUserHooks) pd_copy lbi_copy userHooks copyFlags
......
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