summaryrefslogtreecommitdiffhomepage
path: root/xmobar.cabal
diff options
context:
space:
mode:
authormichaellilanushoober <30565219+michaellilanushoober@users.noreply.github.com>2017-07-30 17:43:41 +0200
committermichaellilanushoober <30565219+michaellilanushoober@users.noreply.github.com>2017-07-30 17:43:41 +0200
commitf0c265b3b4359e866673954dbcc5a586c7ae51dd (patch)
tree2e6fe4bb0a1680a4297378b2576285a64a76a08f /xmobar.cabal
parent4e016c5c2065430d58b1c2a75de524a4adb7dd38 (diff)
downloadxmobar-f0c265b3b4359e866673954dbcc5a586c7ae51dd.tar.gz
xmobar-f0c265b3b4359e866673954dbcc5a586c7ae51dd.tar.bz2
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.
Diffstat (limited to 'xmobar.cabal')
-rw-r--r--xmobar.cabal23
1 files changed, 15 insertions, 8 deletions
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