Commit b6a11fa0 authored by ian@well-typed.com's avatar ian@well-typed.com

Follow changes in Cabal

parent 9f8ee071
Cabal @ 8395c5db
Subproject commit 24bdc9b8862d228656ea2b5b0bd6307cb985819e
Subproject commit 8395c5db800284c9e2b54b5c45b94c4a3bfdfcf2
......@@ -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)
......
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