@@ -396,9 +396,43 @@ flag trypandoc
396396 Description: Build trypandoc cgi executable.
397397 Default: False
398398
399+common common-options
400+ default-language: Haskell2010
401+ build-depends: base >= 4.9 && < 5,
402+ text >= 1.1.1.0 && < 1.3
403+ other-extensions: NoImplicitPrelude
404+ ghc-options: -Wall -fno-warn-unused-do-bind
405+ -Wincomplete-record-updates
406+ -Wnoncanonical-monad-instances
407+
408+ if impl(ghc < 8.4)
409+ hs-source-dirs: prelude
410+ other-modules: Prelude
411+ build-depends: base-compat >= 0.9
412+
413+ if os(windows)
414+ cpp-options: -D_WINDOWS
415+
416+ -- Later:
417+ -- -Wpartial-fields (currently used in Powerpoint writer)
418+ -- -Wmissing-export-lists (currently some Odt modules violate this)
419+ -- -Wredundant-constraints (problematic if we want to support older base)
420+ if impl(ghc >= 8.2)
421+ ghc-options: -Wcpp-undef
422+ if impl(ghc >= 8.4)
423+ ghc-options: -Wincomplete-uni-patterns
424+ -Widentities
425+ -fhide-source-paths
426+
427+common common-executable
428+ import: common-options
429+ build-depends: pandoc
430+ ghc-options: -rtsopts -with-rtsopts=-K16m -threaded
431+
432+
399433library
400− build-depends: base >= 4.9 && < 5,
401− Glob >= 0.7 && < 0.11,
434+ import: common-options
435+ build-depends: Glob >= 0.7 && < 0.11,
402436 HTTP >= 4000.0.5 && < 4000.4,
403437 HsYAML >= 0.2 && < 0.3,
404438 JuicyPixels >= 3.1.6.1 && < 3.4,
@@ -465,35 +499,11 @@ library
465499 build-depends: basement >= 0.0.10,
466500 foundation >= 0.0.23
467501 -- basement 0.0.9 won't build on 32-bit windows.
468− if impl(ghc < 8.4)
469− hs-source-dirs: prelude
470− other-modules: Prelude
471− build-depends: base-compat >= 0.9
472− if os(windows)
473− cpp-options: -D_WINDOWS
474− else
502+ if !os(windows)
475503 build-depends: unix >= 2.4 && < 2.8
476504 if flag(embed_data_files)
477505 cpp-options: -DEMBED_DATA_FILES
478506 other-modules: Text.Pandoc.Data
479− if os(windows)
480− cpp-options: -D_WINDOWS
481− ghc-options: -Wall -fno-warn-unused-do-bind
482− -Wincomplete-record-updates
483− -Wnoncanonical-monad-instances
484− -- Later:
485− -- -Wpartial-fields (currently used in Powerpoint writer)
486− -- -Wmissing-export-lists (currently some Odt modules violate this)
487− -- -Wredundant-constraints (problematic if we want to support older base)
488− if impl(ghc >= 8.2)
489− ghc-options: -Wcpp-undef
490− if impl(ghc >= 8.4)
491− ghc-options: -Wincomplete-uni-patterns
492− -Widentities
493− -fhide-source-paths
494−
495− default-language: Haskell2010
496− other-extensions: NoImplicitPrelude
497507 hs-source-dirs: src
498508
499509 exposed-modules: Text.Pandoc,
@@ -694,87 +704,36 @@ library
694704 buildable: True
695705
696706executable pandoc
697− build-depends: pandoc, base >= 4.8 && < 5
698− if impl(ghc < 8.4)
699− hs-source-dirs: prelude
700− other-modules: Prelude
701− build-depends: base-compat >= 0.9
702− default-language: Haskell2010
703− other-extensions: NoImplicitPrelude
707+ import: common-executable
704708 hs-source-dirs: app
705709 main-is: pandoc.hs
706710 buildable: True
707711 other-modules: Paths_pandoc
708− ghc-options: -rtsopts -with-rtsopts=-K16m -threaded
709− -Wall -fno-warn-unused-do-bind
710− -Wincomplete-record-updates
711− -Wnoncanonical-monad-instances
712− if impl(ghc >= 8.2)
713− ghc-options: -Wcpp-undef
714− if impl(ghc >= 8.4)
715− ghc-options: -Wincomplete-uni-patterns
716− -Widentities
717− -fhide-source-paths
718712
719713executable trypandoc
714+ import: common-executable
720715 main-is: trypandoc.hs
721716 hs-source-dirs: trypandoc
722− default-language: Haskell2010
723− other-extensions: NoImplicitPrelude
724717 if flag(trypandoc)
725− build-depends: base, aeson, pandoc,
726− text, wai-extra, wai >= 0.3, http-types
718+ build-depends: aeson, http-types, wai >= 0.3, wai-extra
727719 buildable: True
728720 else
729721 buildable: False
730− if impl(ghc < 8.4)
731− hs-source-dirs: prelude
732− other-modules: Prelude
733− build-depends: base-compat >= 0.9
734− ghc-options: -rtsopts -with-rtsopts=-K16m -threaded
735− -Wall -fno-warn-unused-do-bind
736− -Wincomplete-record-updates
737− -Wnoncanonical-monad-instances
738− if impl(ghc >= 8.2)
739− ghc-options: -Wcpp-undef
740− if impl(ghc >= 8.4)
741− ghc-options: -Wincomplete-uni-patterns
742− -Widentities
743− -fhide-source-paths
744722
745723benchmark weigh-pandoc
724+ import: common-executable
746725 type: exitcode-stdio-1.0
747726 main-is: weigh-pandoc.hs
748727 hs-source-dirs: benchmark
749− build-depends: pandoc,
750− base >= 4.8 && < 5,
751− mtl >= 2.2 && < 2.3,
752− text,
728+ build-depends: mtl >= 2.2 && < 2.3,
753729 weigh >= 0.0 && < 0.1,
754− if impl(ghc < 8.4)
755− hs-source-dirs: prelude
756− other-modules: Prelude
757− build-depends: base-compat >= 0.9
758− default-language: Haskell2010
759− other-extensions: NoImplicitPrelude
760− ghc-options: -rtsopts -with-rtsopts=-K16m -threaded
761− -Wall -fno-warn-unused-do-bind
762− -Wincomplete-record-updates
763− -Wnoncanonical-monad-instances
764− if impl(ghc >= 8.2)
765− ghc-options: -Wcpp-undef
766− if impl(ghc >= 8.4)
767− ghc-options: -Wincomplete-uni-patterns
768− -Widentities
769− -fhide-source-paths
770−
771730
772731test-suite test-pandoc
732+ import: common-executable
773733 type: exitcode-stdio-1.0
774734 main-is: test-pandoc.hs
775735 hs-source-dirs: test
776736 build-depends: pandoc,
777− base >= 4.8 && < 5,
778737 Diff >= 0.2 && < 0.5,
779738 Glob >= 0.7 && < 0.11,
780739 QuickCheck >= 2.4 && < 2.15,
@@ -796,14 +755,9 @@ test-suite test-pandoc
796755 tasty-lua >= 0.2 && < 0.3,
797756 tasty-quickcheck >= 0.8 && < 0.11,
798757 temporary >= 1.1 && < 1.4,
799− text >= 1.1.1.0 && < 1.3,
800758 time >= 1.5 && < 1.10,
801759 xml >= 1.3.12 && < 1.4,
802760 zip-archive >= 0.2.3.4 && < 0.5
803− if impl(ghc < 8.4)
804− hs-source-dirs: prelude
805− other-modules: Prelude
806− build-depends: base-compat >= 0.9
807761 other-modules: Tests.Old
808762 Tests.Command
809763 Tests.Helpers
@@ -859,48 +813,15 @@ test-suite test-pandoc
859813 Tests.Writers.OOXML
860814 Tests.Writers.Ms
861815 Tests.Writers.AnnotatedTable
862− if os(windows)
863− cpp-options: -D_WINDOWS
864− default-language: Haskell2010
865− other-extensions: NoImplicitPrelude
866− ghc-options: -rtsopts -with-rtsopts=-K16m -threaded
867− -Wall -fno-warn-unused-do-bind
868− -Wincomplete-record-updates
869− -Wnoncanonical-monad-instances
870− if impl(ghc >= 8.2)
871− ghc-options: -Wcpp-undef
872− if impl(ghc >= 8.4)
873− ghc-options: -Wincomplete-uni-patterns
874− -Widentities
875− -fhide-source-paths
876−
877816
878817benchmark benchmark-pandoc
818+ import: common-executable
879819 type: exitcode-stdio-1.0
880820 main-is: benchmark-pandoc.hs
881821 hs-source-dirs: benchmark
882− build-depends: pandoc,
883− base >= 4.8 && < 5,
884− bytestring,
822+ build-depends: bytestring,
885823 containers,
886824 tasty,
887825 tasty-bench >= 0.1 && <= 0.2,
888826 mtl >= 2.2 && < 2.3,
889− text >= 1.1.1.0 && < 1.3,
890827 time
891− if impl(ghc < 8.4)
892− hs-source-dirs: prelude
893− other-modules: Prelude
894− build-depends: base-compat >= 0.9
895− default-language: Haskell2010
896− other-extensions: NoImplicitPrelude
897− ghc-options: -rtsopts -with-rtsopts=-K16m -threaded
898− -Wall -fno-warn-unused-do-bind
899− -Wincomplete-record-updates
900− -Wnoncanonical-monad-instances
901− if impl(ghc >= 8.2)
902− ghc-options: -Wcpp-undef
903− if impl(ghc >= 8.4)
904− ghc-options: -Wincomplete-uni-patterns
905− -Widentities
906− -fhide-source-paths