From f0c265b3b4359e866673954dbcc5a586c7ae51dd Mon Sep 17 00:00:00 2001 From: michaellilanushoober <30565219+michaellilanushoober@users.noreply.github.com> Date: Sun, 30 Jul 2017 17:43:41 +0200 Subject: Guard monitor 'Weather' behind flag 'with_weather' Hide the monitor 'Weather' behind a flag named 'with_weather'. This implies that the dependency on the module 'HTTP' is now optional. The default for 'with_weather' is True since we do not want to break backwards compatibility/user experience. Further moved the effect of the flag with_conduit within the branch of 'with_weather', since that flag only has some effect if 'with_weather' is true. --- xmobar.cabal | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'xmobar.cabal') diff --git a/xmobar.cabal b/xmobar.cabal index 78bda6a..d03bdb3 100644 --- a/xmobar.cabal +++ b/xmobar.cabal @@ -82,8 +82,12 @@ flag with_uvmeter description: UVMeter only useful to australians. default: False +flag with_weather + description: Enable weather plugin + default: True + flag with_conduit - description: Use http-conduits for getting weather data + description: Use http-conduits for getting weather data, only has an effect if with_weather is set. default: False executable xmobar @@ -105,7 +109,7 @@ executable xmobar Plugins.Monitors.MultiCpu, Plugins.Monitors.Net, Plugins.Monitors.Swap, Plugins.Monitors.Thermal, Plugins.Monitors.ThermalZone, Plugins.Monitors.Top, - Plugins.Monitors.Uptime, Plugins.Monitors.Weather, + Plugins.Monitors.Uptime, Plugins.Monitors.Bright, Plugins.Monitors.CatInt ghc-options: -funbox-strict-fields -Wall -fno-warn-unused-do-bind @@ -126,14 +130,8 @@ executable xmobar X11 >= 1.6.1, mtl >= 2.1 && < 2.3, parsec == 3.1.*, - HTTP >= 4000.2.4, stm >= 2.3 && < 2.5 - if flag(with_conduit) - -- use http-conduit instead of simple-http - build-depends: http-conduit, http-types - cpp-options: -DHTTP_CONDUIT - if flag(with_threaded) -- -threaded is a workaround for 100% CPU busy loop -- (http://hackage.haskell.org/trac/ghc/ticket/4934). @@ -194,6 +192,15 @@ executable xmobar other-modules: XPMFile cpp-options: -DXPM + if flag(with_weather) || flag(all_extensions) + build-depends: HTTP >= 4000.2.4 + other-modules: Plugins.Monitors.Weather + cpp-options: -DWEATHER + if flag(with_conduit) + -- use http-conduit instead of simple-http + build-depends: http-conduit, http-types + cpp-options: -DHTTP_CONDUIT + if flag(with_uvmeter) other-modules: Plugins.Monitors.UVMeter cpp-options: -DUVMETER -- cgit v1.2.3