[commit: ghc] master: Follow changes in Cabal (b6a11fa)

Ian Lynagh igloo at earth.li
Wed Mar 13 03:29:09 CET 2013


Repository : http://darcs.haskell.org/ghc.git/

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/b6a11fa08805f5b25493c63bc8c6a3085d48bb65

>---------------------------------------------------------------

commit b6a11fa08805f5b25493c63bc8c6a3085d48bb65
Author: Ian Lynagh <ian at well-typed.com>
Date:   Tue Mar 12 18:21:55 2013 +0000

    Follow changes in Cabal

>---------------------------------------------------------------

 libraries/Cabal         |  2 +-
 utils/ghc-cabal/Main.hs | 45 +++++++++++++++++----------------------------
 2 files changed, 18 insertions(+), 29 deletions(-)

diff --git a/libraries/Cabal b/libraries/Cabal
index 24bdc9b..8395c5d 160000
--- a/libraries/Cabal
+++ b/libraries/Cabal
@@ -1 +1 @@
-Subproject commit 24bdc9b8862d228656ea2b5b0bd6307cb985819e
+Subproject commit 8395c5db800284c9e2b54b5c45b94c4a3bfdfcf2
diff --git a/utils/ghc-cabal/Main.hs b/utils/ghc-cabal/Main.hs
index 3ecae9b..f3e64f4 100644
--- a/utils/ghc-cabal/Main.hs
+++ b/utils/ghc-cabal/Main.hs
@@ -220,10 +220,12 @@ doRegister ghc ghcpkg topdir directory distDir
             let installedPkgs' = PackageIndex.fromList instInfos
             let updateComponentConfig (cn, clbi, deps)
                     = (cn, updateComponentLocalBuildInfo clbi, deps)
-                updateComponentLocalBuildInfo (ComponentLocalBuildInfo cpds)
-                    = ComponentLocalBuildInfo
-                          [ (fixupPackageId instInfos ipid, pid)
-                          | (ipid,pid) <- cpds ]
+                updateComponentLocalBuildInfo clbi
+                    = clbi {
+                          componentPackageDeps =
+                              [ (fixupPackageId instInfos ipid, pid)
+                              | (ipid,pid) <- componentPackageDeps clbi ]
+                      }
                 ccs' = map updateComponentConfig (componentsConfigs lbi)
                 lbi' = lbi {
                                componentsConfigs = ccs',
@@ -306,31 +308,18 @@ generate config_args distdir directory
       -- generate Paths_<pkg>.hs and cabal-macros.h
       writeAutogenFiles verbosity pd lbi
 
-      let findLibraryConfig []                         = Nothing
-          findLibraryConfig ((CLibName, clbi, _) :  _) = Just clbi
-          findLibraryConfig (_                   : xs) = findLibraryConfig xs
-          mLibraryConfig = findLibraryConfig (componentsConfigs lbi)
-
       -- generate inplace-pkg-config
-      case (library pd, mLibraryConfig) of
-          (Nothing, Nothing) -> return ()
-          (Just lib, Just clbi) -> do
-              cwd <- getCurrentDirectory
-              let ipid = InstalledPackageId (display (packageId pd) ++ "-inplace")
-              let installedPkgInfo = inplaceInstalledPackageInfo cwd distdir
-                                         pd lib lbi clbi
-                  final_ipi = installedPkgInfo {
-                                  Installed.installedPackageId = ipid,
-                                  Installed.haddockHTMLs = []
-                              }
-                  content = Installed.showInstalledPackageInfo final_ipi ++ "\n"
-              writeFileAtomic (distdir </> "inplace-pkg-config") (BS.pack $ toUTF8 content)
-          (Just _, Nothing) ->
-              -- There is a library, but we aren't building it
-              -- Happens e.g. with haddock, which has both a library
-              -- and executable in its .cabal file.
-              return ()
-          (Nothing, Just _) -> die ["Library local build info, but no library in package description"]
+      withLibLBI pd lbi $ \lib clbi ->
+          do cwd <- getCurrentDirectory
+             let ipid = InstalledPackageId (display (packageId pd) ++ "-inplace")
+             let installedPkgInfo = inplaceInstalledPackageInfo cwd distdir
+                                        pd lib lbi clbi
+                 final_ipi = installedPkgInfo {
+                                 Installed.installedPackageId = ipid,
+                                 Installed.haddockHTMLs = []
+                             }
+                 content = Installed.showInstalledPackageInfo final_ipi ++ "\n"
+             writeFileAtomic (distdir </> "inplace-pkg-config") (BS.pack $ toUTF8 content)
 
       let
           libBiModules lib = (libBuildInfo lib, libModules lib)





More information about the ghc-commits mailing list