+++ /dev/null
-{-# OPTIONS -cpp #-}
-#include "Cabal/Distribution/Compat/Exception.hs"
--- dummy comment
import System.IO
import System.Directory
+import Distribution.Package hiding (depends)
+
import Control.Exception
import Data.Maybe
\end{code}
-- of DLL handles that rts/Linker.c maintains, and that in turn is
-- used by lookupSymbol. So we must call addDLL for each library
-- just to get the DLL handle into the list.
-partOfGHCi :: [String]
+partOfGHCi :: [PackageName]
partOfGHCi
| isWindowsTarget || isDarwinTarget = []
- | otherwise = [ "base", "haskell98", "template-haskell", "editline" ]
+ | otherwise = map PackageName
+ ["base", "haskell98", "template-haskell", "editline"]
showLS :: LibrarySpec -> String
showLS (Object nm) = "(static) " ++ nm
maybePutStr dflags ("Loading package " ++ display (package pkg) ++ " ... ")
-- See comments with partOfGHCi
- when (pkgName (package pkg) `notElem` partOfGHCi) $ do
+ when (packageName pkg `notElem` partOfGHCi) $ do
loadFrameworks pkg
-- When a library A needs symbols from a library B, the order in
-- extra_libraries/extra_ld_opts is "-lA -lB", because that's the
-- version, or just the name if it is unambiguous.
matches str p
= str == display (package p)
- || str == pkgName (package p)
+ || str == display (pkgName (package p))
pickPackages :: [PackageConfig] -> [String] -> [PackageConfig]
pickPackages pkgs strs =
matches :: PackageConfig -> (PackageId, [String]) -> Bool
pc `matches` (pid, suffixes)
- = pkgName (package pc) `elem`
+ = display (pkgName (package pc)) `elem`
(map (packageIdString pid ++) suffixes)
-- find which package corresponds to each wired-in package
upd_pid pid = case filter ((== pid) . fst) wired_in_ids of
[] -> pid
- ((x, y):_) -> x{ pkgName = packageIdString y,
+ ((x, y):_) -> x{ pkgName = PackageName (packageIdString y),
pkgVersion = Version [] [] }
pkgs1 = deleteOtherWiredInPackages pkgs
#include "HsVersions.h"
+import Distribution.Package hiding ( depends )
import PackageConfig
import Lexer
import Module
}
pkgid :: { PackageIdentifier }
- : CONID '{' VARID '=' STRING ',' VARID '=' version '}'
- { PackageIdentifier{ pkgName = unpackFS $5,
- pkgVersion = $9 } }
+ : CONID '{' VARID '=' CONID STRING ',' VARID '=' version '}'
+ {% case unpackFS $5 of
+ "PackageName" ->
+ return $ PackageIdentifier {
+ pkgName = PackageName (unpackFS $6),
+ pkgVersion = $10
+ }
+ _ -> happyError
+ }
version :: { Version }
: CONID '{' VARID '=' intlist ',' VARID '=' strlist '}'
Just Simple -> Simple.defaultMainArgs args
Just Make -> Make.defaultMainArgs args
Just Configure -> defaultMainWithHooksArgs autoconfUserHooks args
- _ | pkgName (package pd) == "Cabal" ->
+ _ | packageName pd == PackageName "Cabal" ->
-- Cabal is special...*sigh*
Simple.defaultMainArgs args
| otherwise -> die "cabal: Don't know what to do!"
-- This is an almighty hack. We need to register
-- ghc-prim:GHC.Prim, but it doesn't exist, get built, get
-- haddocked, get copied, etc.
- pd_reg = if pkgName (package pd) == "ghc-prim"
+ pd_reg = if packageName pd == PackageName "ghc-prim"
then case library pd of
Just lib ->
let ems = "GHC.Prim" : exposedModules lib
parseGlobPackageId =
parse
+++
- (do n <- parsePackageName; string "-*"
+ (do n <- parse
+ string "-*"
return (PackageIdentifier{ pkgName = n, pkgVersion = globVersion }))
-- globVersion means "all versions"
where doc = text (display (package p))
show_simple db_stack = do
- let showPkg = if FlagNamesOnly `elem` flags then pkgName
+ let showPkg = if FlagNamesOnly `elem` flags then display . pkgName
else display
pkgs = map showPkg $ sortBy compPkgIdVer $
map package (concatMap snd db_stack)