From 9dac007228d1b19de427caa49e5f6150adbd73c4 Mon Sep 17 00:00:00 2001
From: John MacFarlane <jgm@berkeley.edu>
Date: Sun, 18 Mar 2018 11:51:57 -0700
Subject: [PATCH] Make 'weigh-pandoc' into a benchmark program.

Remove 'weigh-pandoc' flag.  This is now built (and run)
automatically when you build (and run) benchmarks.
---
 pandoc.cabal | 21 +++++++--------------
 1 file changed, 7 insertions(+), 14 deletions(-)

diff --git a/pandoc.cabal b/pandoc.cabal
index 5b3fe57a4..512062c46 100644
--- a/pandoc.cabal
+++ b/pandoc.cabal
@@ -335,10 +335,6 @@ flag trypandoc
   Description:   Build trypandoc cgi executable.
   Default:       False
 
-flag weigh-pandoc
-  Description:   Build weigh-pandoc to measure memory usage.
-  Default:       False
-
 flag network-uri
   Description:   Get Network.URI from the network-uri package
   Default:       True
@@ -588,18 +584,15 @@ executable trypandoc
      other-modules:  Prelude
      build-depends:  base-compat >= 0.9
 
-executable weigh-pandoc
+benchmark weigh-pandoc
+  type:            exitcode-stdio-1.0
   main-is:         weigh-pandoc.hs
   hs-source-dirs:  benchmark
-  if flag(weigh-pandoc)
-     build-depends:   pandoc,
-                      base >= 4.2 && < 5,
-                      text,
-                      weigh >= 0.0 && < 0.1,
-                      mtl >= 2.2 && < 2.3
-     buildable:       True
-  else
-    buildable:     False
+  build-depends:   pandoc,
+                   base >= 4.2 && < 5,
+                   text,
+                   weigh >= 0.0 && < 0.1,
+                   mtl >= 2.2 && < 2.3
   if impl(ghc < 8.0)
     build-depends: semigroups == 0.18.*
   if impl(ghc < 8.4)