X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=utils%2Fghc-cabal%2Fghc-cabal.hs;h=9a99ad415114331a0f0f0a5d49a366a29e351271;hb=43b5afae2ef2a0ebd29d88dc379ddfc0c793bebd;hp=29e0f5c500bd69d239648fd832cd59ef21468aec;hpb=6e998535044b9565b46d1d0d5453427c4051a7b4;p=ghc-hetmet.git diff --git a/utils/ghc-cabal/ghc-cabal.hs b/utils/ghc-cabal/ghc-cabal.hs index 29e0f5c..9a99ad4 100644 --- a/utils/ghc-cabal/ghc-cabal.hs +++ b/utils/ghc-cabal/ghc-cabal.hs @@ -223,15 +223,15 @@ doInstall ghc ghcpkg topdir directory distDir progs' = updateProgram ghcProg $ updateProgram ghcPkgProg progs instInfos <- dump verbosity ghcPkgProg GlobalPackageDB - let installedPkgs' = PackageIndex.listToInstalledPackageIndex - instInfos + let installedPkgs' = PackageIndex.fromList instInfos let mlc = libraryConfig lbi mlc' = case mlc of Just lc -> - let cipds = componentInstalledPackageDeps lc - cipds' = map (fixupPackageId instInfos) cipds + let cipds = componentPackageDeps lc + cipds' = [ (fixupPackageId instInfos ipid, pid) + | (ipid,pid) <- cipds ] in Just $ lc { - componentInstalledPackageDeps = cipds' + componentPackageDeps = cipds' } Nothing -> Nothing lbi' = lbi { @@ -335,12 +335,11 @@ generate config_args distdir directory -- stricter than gnu ld). Thus we remove the ldOptions for -- GHC's rts package: hackRtsPackage index = - case PackageIndex.lookupInstalledPackageByName index (PackageName "rts") of - [rts] -> PackageIndex.addToInstalledPackageIndex rts { Installed.ldOptions = [] } index + case PackageIndex.lookupPackageName index (PackageName "rts") of + [(_,[rts])] -> PackageIndex.insert rts{ Installed.ldOptions = [] } index _ -> error "No (or multiple) ghc rts package is registered!!" - dep_ids = map (packageId.getLocalPackageInfo lbi) $ - externalPackageDeps lbi + dep_ids = map snd (externalPackageDeps lbi) let variablePrefix = directory ++ '_':distdir let xs = [variablePrefix ++ "_VERSION = " ++ display (pkgVersion (package pd)), @@ -364,12 +363,12 @@ generate config_args distdir directory variablePrefix ++ "_CC_OPTS = " ++ unwords (ccOptions bi), variablePrefix ++ "_CPP_OPTS = " ++ unwords (cppOptions bi), variablePrefix ++ "_LD_OPTS = " ++ unwords (ldOptions bi), - variablePrefix ++ "_DEP_INCLUDE_DIRS = " ++ unwords (forDeps Installed.includeDirs), + variablePrefix ++ "_DEP_INCLUDE_DIRS = " ++ unwords (wrap $ forDeps Installed.includeDirs), variablePrefix ++ "_DEP_CC_OPTS = " ++ unwords (forDeps Installed.ccOptions), - variablePrefix ++ "_DEP_LIB_DIRS = " ++ unwords (forDeps Installed.libraryDirs), + variablePrefix ++ "_DEP_LIB_DIRS = " ++ unwords (wrap $ forDeps Installed.libraryDirs), variablePrefix ++ "_DEP_EXTRA_LIBS = " ++ unwords (forDeps Installed.extraLibraries), variablePrefix ++ "_DEP_LD_OPTS = " ++ unwords (forDeps Installed.ldOptions)] writeFile (distdir ++ "/package-data.mk") $ unlines xs where escape = foldr (\c xs -> if c == '#' then '\\':'#':xs else c:xs) [] - + wrap = map (\s -> "\'" ++ s ++ "\'")