More library installation path fiddling
authorIan Lynagh <igloo@earth.li>
Thu, 13 Sep 2007 17:42:42 +0000 (17:42 +0000)
committerIan Lynagh <igloo@earth.li>
Thu, 13 Sep 2007 17:42:42 +0000 (17:42 +0000)
libraries/Makefile
libraries/installPackage.hs

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