From c0cb852265c334e8b432a97760446125b6d7060c Mon Sep 17 00:00:00 2001
From: John MacFarlane <fiddlosopher@gmail.com>
Date: Mon, 6 Feb 2012 13:49:56 -0800
Subject: [PATCH] cabal:  Put build-depends for tests under conditional.

Otherwise even those who don't build with the tests flag need
to have dependencies like test-framework.

This restores the old behavior; I wrongly assumed that by now cabal
was smart enough not to bring in build-depends for components with
Buildable = False.
---
 pandoc.cabal | 52 ++++++++++++++++++++++++++--------------------------
 1 file changed, 26 insertions(+), 26 deletions(-)

diff --git a/pandoc.cabal b/pandoc.cabal
index 2fad328a2..362e9f404 100644
--- a/pandoc.cabal
+++ b/pandoc.cabal
@@ -391,30 +391,30 @@ Executable test-pandoc
                       FlexibleInstances
   Hs-Source-Dirs:  src
   -- END DUPLICATED SECTION
-  if impl(ghc >= 7)
-    cpp-options:      -D_LIT=lit
-  else
-    cpp-options:      -D_LIT=$lit
-  if flag(tests)
-    Buildable:        True
-  else
+  if !flag(tests)
     Buildable:        False
-  Other-Extensions: TemplateHaskell, QuasiQuotes
-  Build-Depends:    Diff, test-framework >= 0.3 && < 0.6,
-                    test-framework-hunit >= 0.2 && < 0.3,
-                    test-framework-quickcheck2 >= 0.2.9 && < 0.3,
-                    QuickCheck >= 2.4 && < 2.6,
-                    HUnit >= 1.2 && < 1.3,
-                    template-haskell >= 2.4 && < 2.8,
-                    ansi-terminal == 0.5.*
-  Other-Modules:    Tests.Old
-                    Tests.Helpers
-                    Tests.Arbitrary
-                    Tests.Shared
-                    Tests.Readers.LaTeX
-                    Tests.Readers.Markdown
-                    Tests.Readers.RST
-                    Tests.Writers.Native
-                    Tests.Writers.ConTeXt
-                    Tests.Writers.HTML
-                    Tests.Writers.Markdown
+  else
+    Buildable:        True
+    if impl(ghc >= 7)
+      cpp-options:    -D_LIT=lit
+    else
+      cpp-options:    -D_LIT=$lit
+    Other-Extensions: TemplateHaskell, QuasiQuotes
+    Build-Depends:    Diff, test-framework >= 0.3 && < 0.6,
+                      test-framework-hunit >= 0.2 && < 0.3,
+                      test-framework-quickcheck2 >= 0.2.9 && < 0.3,
+                      QuickCheck >= 2.4 && < 2.6,
+                      HUnit >= 1.2 && < 1.3,
+                      template-haskell >= 2.4 && < 2.8,
+                      ansi-terminal == 0.5.*
+    Other-Modules:    Tests.Old
+                      Tests.Helpers
+                      Tests.Arbitrary
+                      Tests.Shared
+                      Tests.Readers.LaTeX
+                      Tests.Readers.Markdown
+                      Tests.Readers.RST
+                      Tests.Writers.Native
+                      Tests.Writers.ConTeXt
+                      Tests.Writers.HTML
+                      Tests.Writers.Markdown