[Pkg-haskell-commits] darcs: haskell-haddock: Patch around missing ghci support, reusing a patch by Marco Túlio Gontijo e Silva in #566331

Joachim Breitner mail at joachim-breitner.de
Fri Jul 2 07:24:20 UTC 2010


Fri Jul  2 07:21:10 UTC 2010  Joachim Breitner <mail at joachim-breitner.de>
  * Patch around missing ghci support, reusing a patch by Marco T[_\c3_][_\ba_]lio Gontijo e Silva in #566331
  Ignore-this: 827a32ff03517fbffb6db9d364aa4e73

    M ./changelog +7
    A ./patches/
    A ./patches/build_without_ghci.patch
    A ./patches/series
    M ./rules +4

Fri Jul  2 07:21:10 UTC 2010  Joachim Breitner <mail at joachim-breitner.de>
  * Patch around missing ghci support, reusing a patch by Marco Túlio Gontijo e Silva in #566331
  Ignore-this: 827a32ff03517fbffb6db9d364aa4e73
diff -rN -u old-haskell-haddock/changelog new-haskell-haddock/changelog
--- old-haskell-haddock/changelog	2010-07-02 07:24:20.010388711 +0000
+++ new-haskell-haddock/changelog	2010-07-02 07:24:20.022389344 +0000
@@ -1,3 +1,10 @@
+haskell-haddock (2.7.2-3) UNRELEASED; urgency=low
+
+  * Patch around missing ghci support, reusing a patch by Marco Túlio Gontijo
+    e Silva in #566331
+
+ -- Joachim Breitner <nomeata at debian.org>  Fri, 02 Jul 2010 09:18:30 +0200
+
 haskell-haddock (2.7.2-2) unstable; urgency=low
 
   * Depend on libghc6-ghc-paths-dev (Closes: #587807)
diff -rN -u old-haskell-haddock/patches/build_without_ghci.patch new-haskell-haddock/patches/build_without_ghci.patch
--- old-haskell-haddock/patches/build_without_ghci.patch	1970-01-01 00:00:00.000000000 +0000
+++ new-haskell-haddock/patches/build_without_ghci.patch	2010-07-02 07:24:20.010388711 +0000
@@ -0,0 +1,65 @@
+Index: haskell-haddock-2.7.2/src/Haddock/Interface/AttachInstances.hs
+===================================================================
+--- haskell-haddock-2.7.2.orig/src/Haddock/Interface/AttachInstances.hs	2010-07-02 09:13:14.000000000 +0200
++++ haskell-haddock-2.7.2/src/Haddock/Interface/AttachInstances.hs	2010-07-02 09:13:17.000000000 +0200
+@@ -27,7 +27,10 @@
+ import InstEnv
+ import Class
+ import HscTypes (withSession, ioMsg)
++#ifdef GHCI
+ import TcRnDriver (tcRnGetInfo)
++#endif
++
+ import TypeRep hiding (funTyConName)
+ import Var hiding (varName)
+ import TyCon
+@@ -44,7 +47,11 @@
+       return $ iface { ifaceExportItems = newItems }
+       where
+         attachExport export at ExportDecl{expItemDecl = L _ (TyClD d)} = do
++#ifdef GHCI
+            mb_info <- getAllInfo (unLoc (tcdLName d))
++#else
++           let mb_info = Nothing
++#endif
+            return $ export { expItemInstances = case mb_info of
+              Just (_, _, instances) ->
+                let insts = map (first synifyInstHead) $ sortImage (first instHead)
+@@ -70,10 +77,12 @@
+     modName = nameModule name
+ 
+ 
++#ifdef GHCI
+ -- | Like GHC's getInfo but doesn't cut things out depending on the
+ -- interative context, which we don't set sufficiently anyway.
+ getAllInfo :: GhcMonad m => Name -> m (Maybe (TyThing,Fixity,[Instance]))
+ getAllInfo name = withSession $ \hsc_env -> ioMsg $ tcRnGetInfo hsc_env name
++#endif
+ 
+ 
+ --------------------------------------------------------------------------------
+Index: haskell-haddock-2.7.2/haddock.cabal
+===================================================================
+--- haskell-haddock-2.7.2.orig/haddock.cabal	2010-07-02 09:18:05.000000000 +0200
++++ haskell-haddock-2.7.2/haddock.cabal	2010-07-02 09:18:12.000000000 +0200
+@@ -67,6 +67,10 @@
+   default: False
+   manual: True
+ 
++flag ghci
++  default: True
++  manual: True
++
+ executable haddock
+   build-depends:
+     base >= 4.0.0.0 && < 4.3.0.0,
+@@ -139,6 +143,9 @@
+     cpp-options: -DTEST
+     build-depends: QuickCheck >= 2.1 && < 3
+ 
++  if flag(ghci)
++    cpp-options: -DGHCI
++
+   hs-source-dirs:       src
+   extensions:           CPP, PatternGuards, DeriveDataTypeable,
+                         ScopedTypeVariables, MagicHash
diff -rN -u old-haskell-haddock/patches/series new-haskell-haddock/patches/series
--- old-haskell-haddock/patches/series	1970-01-01 00:00:00.000000000 +0000
+++ new-haskell-haddock/patches/series	2010-07-02 07:24:20.010388711 +0000
@@ -0,0 +1 @@
+build_without_ghci.patch
diff -rN -u old-haskell-haddock/rules new-haskell-haddock/rules
--- old-haskell-haddock/rules	2010-07-02 07:24:20.010388711 +0000
+++ new-haskell-haddock/rules	2010-07-02 07:24:20.018389133 +0000
@@ -2,5 +2,9 @@
 
 DEB_BUILD_DEPENDENCIES = build-arch
 
+# Test if ghci is available
+DEB_SETUP_GHC6_CONFIGURE_ARGS := $(shell test -e /usr/bin/ghci && echo --flags=ghci || echo --flags=-ghci)
+
+
 include /usr/share/cdbs/1/rules/debhelper.mk
 include /usr/share/cdbs/1/class/hlibrary.mk





More information about the Pkg-haskell-commits mailing list