diff options
author | Will Thompson <will@willthompson.co.uk> | 2020-07-29 16:32:36 +0100 |
---|---|---|
committer | Will Thompson <will@willthompson.co.uk> | 2020-07-29 16:32:47 +0100 |
commit | ba56a44aac4585071e4ac09a66401939c3032424 (patch) | |
tree | 61d67762fdd38bda2ca70276db5f996304f24551 | |
parent | 1a4823c120bbe5f0119e9208d7b78d91a3decbd3 (diff) |
Simplify Cabal file
At some point in the past 12 years, Cabal has gaine support for both
internal libraries, and common stanzas.
Using an internal library for everything except Bustle's entrypoint
means tests don't need to list (and build!) all modules they use, and
all the necessary dependencies and flags again.
-rw-r--r-- | bustle.cabal | 118 | ||||
-rw-r--r-- | main/Bustle.hs (renamed from Bustle.hs) | 0 |
2 files changed, 33 insertions, 85 deletions
diff --git a/bustle.cabal b/bustle.cabal index 32cd1bf..b1d43ee 100644 --- a/bustle.cabal +++ b/bustle.cabal @@ -76,9 +76,25 @@ Flag threaded Description: Build with the multi-threaded runtime Default: True +common shared-properties + default-language: Haskell2010 + Ghc-options: -Wall + -fno-warn-unused-do-bind + + Executable bustle + import: shared-properties Main-is: Bustle.hs - Other-modules: Bustle.Application.Monad + hs-source-dirs: main + Build-Depends: bustle-internal + if flag(threaded) + ghc-options: -threaded + Build-Depends: base + , glib + +Library bustle-internal + import: shared-properties + Exposed-modules: Bustle.Application.Monad , Bustle.Diagram , Bustle.GDBusMessage , Bustle.GVariant @@ -106,11 +122,6 @@ Executable bustle , Bustle.Util , Paths_bustle autogen-modules: Paths_bustle - default-language: Haskell2010 - Ghc-options: -Wall - -fno-warn-unused-do-bind - if flag(threaded) - ghc-options: -threaded C-sources: c-sources/pcap-reader.c , c-sources/pcap-monitor.c cc-options: -fPIC -g @@ -144,106 +155,43 @@ Executable bustle , src-no-hgettext Executable dump-messages + import: shared-properties if flag(InteractiveTests) buildable: True else buildable: False - main-is: Test/DumpMessages.hs - default-language: Haskell2010 - Build-Depends: base - , bytestring - , containers - , mtl - , text - , transformers - - if flag(hgettext) - Build-Depends: hgettext >= 0.1.5 - , setlocale - other-modules: GetText_bustle - autogen-modules: GetText_bustle - hs-source-dirs: . - , src-hgettext - else - hs-source-dirs: . - , src-no-hgettext + hs-source-dirs: Test + main-is: DumpMessages.hs + Build-Depends: bustle-internal Test-suite test-pcap-crash + import: shared-properties type: exitcode-stdio-1.0 - main-is: Test/PcapCrash.hs - other-modules: Bustle.GDBusMessage - , Bustle.GVariant - , Bustle.Loader.Pcap - , Bustle.Reader - , Bustle.Translation - , Bustle.Types - default-language: Haskell2010 + hs-source-dirs: Test + main-is: PcapCrash.hs Build-Depends: base - , bytestring - , containers - , glib - , mtl - , text - , transformers - C-sources: c-sources/pcap-reader.c - pkgconfig-depends: glib-2.0 >= 2.54, - gio-unix-2.0 - extra-libraries: pcap - if flag(hgettext) - Build-Depends: hgettext >= 0.1.5 - , setlocale - other-modules: GetText_bustle - autogen-modules: GetText_bustle - hs-source-dirs: . - , src-hgettext - else - hs-source-dirs: . - , src-no-hgettext + , bustle-internal Test-suite test-regions + import: shared-properties type: exitcode-stdio-1.0 - main-is: Test/Regions.hs - other-modules: Bustle.Regions - default-language: Haskell2010 + hs-source-dirs: Test + main-is: Regions.hs Build-Depends: base + , bustle-internal , QuickCheck Test-suite test-renderer + import: shared-properties type: exitcode-stdio-1.0 - main-is: Test/Renderer.hs - other-modules: Bustle.Diagram - , Bustle.GDBusMessage - , Bustle.GVariant - , Bustle.Marquee - , Bustle.Regions - , Bustle.Renderer - , Bustle.Translation - , Bustle.Types - , Bustle.Util - - default-language: Haskell2010 + hs-source-dirs: Test + main-is: Renderer.hs Build-Depends: base - , cairo + , bustle-internal , containers - , directory - , filepath - , glib - , gtk3 , mtl - , text - , pango , test-framework , test-framework-hunit , transformers , HUnit - if flag(hgettext) - Build-Depends: hgettext >= 0.1.5 - , setlocale - other-modules: GetText_bustle - autogen-modules: GetText_bustle - hs-source-dirs: . - , src-hgettext - else - hs-source-dirs: . - , src-no-hgettext diff --git a/Bustle.hs b/main/Bustle.hs index 0236569..0236569 100644 --- a/Bustle.hs +++ b/main/Bustle.hs |