From b30f5ecfdae9dea8048c19051732b71f7633f9c9 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Wed, 30 May 2007 14:00:48 +0000 Subject: update to compile with the latest GHC & Cabal --- haddock.cabal | 3 +-- src/Haddock/Html.hs | 2 +- src/Haddock/InterfaceFile.hs | 5 +++-- src/Haddock/Rename.hs | 2 +- src/Haddock/Types.hs | 2 +- src/Haddock/Version.hs | 4 ++-- src/Main.hs | 12 ++++++------ 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/haddock.cabal b/haddock.cabal index b4992593..d6409832 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -8,8 +8,7 @@ maintainer: David Waern stability: stable homepage: http://www.haskell.org/haddock/ synopsis: Haddock is a documentation-generation tool for Haskell libraries -build-depends: base, haskell98, mtl, ghc>=6.7, Cabal, filepath, - network>=1.0, process, directory, pretty +build-depends: base>=1.0, haskell98>=1.0, mtl>=1.0, ghc>=6.7, Cabal, filepath, network>=1.0 extensions: CPP, PatternGuards ghc-options: -fglasgow-exts hs-source-dirs: src diff --git a/src/Haddock/Html.hs b/src/Haddock/Html.hs index c6b4edf0..c89485bc 100644 --- a/src/Haddock/Html.hs +++ b/src/Haddock/Html.hs @@ -33,7 +33,7 @@ import Debug.Trace ( trace ) import Data.Map ( Map ) import qualified Data.Map as Map hiding ( Map ) -import GHC hiding ( NoLink ) +import GHC import Name import Module import PackageConfig ( stringToPackageId ) diff --git a/src/Haddock/InterfaceFile.hs b/src/Haddock/InterfaceFile.hs index 5e8a9424..54dc3618 100644 --- a/src/Haddock/InterfaceFile.hs +++ b/src/Haddock/InterfaceFile.hs @@ -16,6 +16,8 @@ import qualified Data.Map as Map import System.IO import Control.Monad +import GHC +import SrcLoc ( noSrcSpan ) -- tmp, GHC now exports this import Binary import Name import UniqSupply @@ -23,7 +25,6 @@ import UniqFM import IfaceEnv import Module import Packages -import SrcLoc import HscTypes import FastMutInt import InstEnv @@ -182,7 +183,7 @@ fromOnDiskName arr nc (pid, mod_name, occ) = let us = nsUniqs nc uniq = uniqFromSupply us - name = mkExternalName uniq mod occ noSrcSpan + name = mkExternalName uniq mod occ noSrcLoc new_cache = extendNameCache cache mod occ name in case splitUniqSupply us of { (us',_) -> diff --git a/src/Haddock/Rename.hs b/src/Haddock/Rename.hs index 6ba07215..c8e5cc8e 100644 --- a/src/Haddock/Rename.hs +++ b/src/Haddock/Rename.hs @@ -11,7 +11,7 @@ module Haddock.Rename ( import Haddock.Types -import GHC hiding ( NoLink ) +import GHC import BasicTypes import SrcLoc import Bag ( emptyBag ) diff --git a/src/Haddock/Types.hs b/src/Haddock/Types.hs index 6ae2309e..4c4587ac 100644 --- a/src/Haddock/Types.hs +++ b/src/Haddock/Types.hs @@ -8,7 +8,7 @@ module Haddock.Types where -import GHC hiding (NoLink) +import GHC import Outputable import Data.Map diff --git a/src/Haddock/Version.hs b/src/Haddock/Version.hs index 3df24f1c..f4d02b7d 100644 --- a/src/Haddock/Version.hs +++ b/src/Haddock/Version.hs @@ -8,8 +8,8 @@ module Haddock.Version ( projectName, projectVersion, projectUrl ) where -import Paths_haddock ( version ) -import Data.Version ( showVersion ) +import Paths_haddock_ghc ( version ) +import Data.Version ( showVersion ) projectName, projectUrl :: String projectName = "Haddock-GHC" diff --git a/src/Main.hs b/src/Main.hs index e5132378..cf534560 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -17,7 +17,7 @@ import Haddock.Version import Haddock.InterfaceFile import Haddock.Exception import Haddock.Utils.GHC -import Paths_haddock ( getDataDir ) +import Paths_haddock_ghc ( getDataDir ) import Prelude hiding ( catch ) import Control.Exception @@ -47,7 +47,7 @@ import qualified Data.Map as Map import Data.Map (Map) import Distribution.InstalledPackageInfo ( InstalledPackageInfo(..) ) -import Distribution.Simple.Utils +import Distribution.Simple.Utils ( withTempFile ) import GHC import Outputable @@ -301,12 +301,12 @@ byeVersion = startGHC :: String -> IO (Session, DynFlags) startGHC libDir = do - --let ghcMode = BatchCompile - session <- newSession (Just libDir) + let ghcMode = BatchCompile + session <- newSession ghcMode (Just libDir) flags <- getSessionDynFlags session flags' <- liftM fst (initPackages flags) let flags'' = dopt_set flags' Opt_Haddock - return (session, flags'') + return (session, flags'' { hscTarget = HscNothing }) -- TODO: clean up, restructure and make sure it handles cleanup sortAndCheckModules :: Session -> [FilePath] -> IO [CheckedMod] @@ -1044,7 +1044,7 @@ buildGlobalDocEnv modules keep_new env n = Map.insert n (nameSetMod n modName) env nameSetMod n newMod = mkExternalName (nameUnique n) newMod (nameOccName n) - (nameSrcSpan n) + (nameSrcLoc n) -- ----------------------------------------------------------------------------- -- Named documentation -- cgit v1.2.3