X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=utils%2Fghc-cabal%2Fghc-cabal.hs;h=8ee1304fb8086ef079a5d23251fd2b55e7ca2746;hp=8c9612f0ffe5ede3bc6e0b8314824003f30efd64;hb=72547264724117d689a7fa400104185557fb2a0c;hpb=21c5c9c09a8d36b4ae8a83b17b543c332bc9cb0c diff --git a/utils/ghc-cabal/ghc-cabal.hs b/utils/ghc-cabal/ghc-cabal.hs index 8c9612f..8ee1304 100644 --- a/utils/ghc-cabal/ghc-cabal.hs +++ b/utils/ghc-cabal/ghc-cabal.hs @@ -25,6 +25,7 @@ import System.Directory import System.Environment import System.Exit import System.FilePath +import Data.Char main :: IO () main = do args <- getArgs @@ -208,9 +209,11 @@ generate config_args distdir directory (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 - content = Installed.showInstalledPackageInfo installedPkgInfo ++ "\n" + final_ipi = installedPkgInfo{ Installed.installedPackageId = ipid } + content = Installed.showInstalledPackageInfo final_ipi ++ "\n" writeFileAtomic (distdir "inplace-pkg-config") content _ -> error "Inconsistent lib components; can't happen?" @@ -242,16 +245,19 @@ generate config_args distdir directory -- stricter than gnu ld). Thus we remove the ldOptions for -- GHC's rts package: hackRtsPackage index = - case PackageIndex.lookupPackageName index (PackageName "rts") of - [rts] -> PackageIndex.insert rts { Installed.ldOptions = [] } index + case PackageIndex.lookupInstalledPackageByName index (PackageName "rts") of + [rts] -> PackageIndex.addToInstalledPackageIndex rts { Installed.ldOptions = [] } index _ -> error "No (or multiple) ghc rts package is registered!!" + dep_ids = map (packageId.getLocalPackageInfo lbi) $ + externalPackageDeps lbi + let variablePrefix = directory ++ '_':distdir let xs = [variablePrefix ++ "_VERSION = " ++ display (pkgVersion (package pd)), variablePrefix ++ "_MODULES = " ++ unwords (map display modules), variablePrefix ++ "_HS_SRC_DIRS = " ++ unwords (hsSourceDirs bi), - variablePrefix ++ "_DEPS = " ++ unwords (map display (externalPackageDeps lbi)), - variablePrefix ++ "_DEP_NAMES = " ++ unwords (map (display . packageName) (externalPackageDeps lbi)), + variablePrefix ++ "_DEPS = " ++ unwords (map display dep_ids), + variablePrefix ++ "_DEP_NAMES = " ++ unwords (map (display . packageName) dep_ids), variablePrefix ++ "_INCLUDE_DIRS = " ++ unwords (includeDirs bi), variablePrefix ++ "_INCLUDES = " ++ unwords (includes bi), variablePrefix ++ "_INSTALL_INCLUDES = " ++ unwords (installIncludes bi),