aboutsummaryrefslogtreecommitdiff
path: root/x11/hs-xmobar
diff options
context:
space:
mode:
authorMahdi Mokhtari <mmokhi@FreeBSD.org>2019-03-03 13:58:00 +0000
committerMahdi Mokhtari <mmokhi@FreeBSD.org>2019-03-03 13:58:00 +0000
commit31bf58fb896191d30c6c9de7c7c9e8ba8a96982c (patch)
treed20015a0d883a54b188127204a26d02465521d7e /x11/hs-xmobar
parent3d175f4b6019bf8ae0b231061a45023870c20546 (diff)
Notes
Diffstat (limited to 'x11/hs-xmobar')
-rw-r--r--x11/hs-xmobar/Makefile2
-rw-r--r--x11/hs-xmobar/files/patch-fix_bug378.diff104
2 files changed, 105 insertions, 1 deletions
diff --git a/x11/hs-xmobar/Makefile b/x11/hs-xmobar/Makefile
index 836327e40e96..0992d0d20621 100644
--- a/x11/hs-xmobar/Makefile
+++ b/x11/hs-xmobar/Makefile
@@ -3,7 +3,7 @@
PORTNAME= xmobar
PORTVERSION= 0.29.4
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= x11 haskell
MAINTAINER= haskell@FreeBSD.org
diff --git a/x11/hs-xmobar/files/patch-fix_bug378.diff b/x11/hs-xmobar/files/patch-fix_bug378.diff
new file mode 100644
index 000000000000..192dfd193baf
--- /dev/null
+++ b/x11/hs-xmobar/files/patch-fix_bug378.diff
@@ -0,0 +1,104 @@
+Index: src/Xmobar/Plugins/Monitors/Weather.hs
+==============================================================================
+--- src/Xmobar/Plugins/Monitors/Weather.hs.orig 2018-11-21 23:52:35 UTC
++++ src/Xmobar/Plugins/Monitors/Weather.hs
+@@ -19,14 +19,10 @@ import Xmobar.Plugins.Monitors.Common
+
+ import qualified Control.Exception as CE
+
+-#ifdef HTTP_CONDUIT
+ import Network.HTTP.Conduit
+ import Network.HTTP.Types.Status
+ import Network.HTTP.Types.Method
+ import qualified Data.ByteString.Lazy.Char8 as B
+-#else
+-import Network.HTTP
+-#endif
+
+ import Text.ParserCombinators.Parsec
+
+@@ -190,7 +186,6 @@ stationUrl :: String -> String
+ stationUrl station = defUrl ++ station ++ ".TXT"
+
+ getData :: String -> IO String
+-#ifdef HTTP_CONDUIT
+ getData station = CE.catch (do
+ manager <- newManager tlsManagerSettings
+ request <- parseUrl $ stationUrl station
+@@ -199,13 +194,6 @@ getData station = CE.catch (do
+ ) errHandler
+ where errHandler :: CE.SomeException -> IO String
+ errHandler _ = return "<Could not retrieve data>"
+-#else
+-getData station = do
+- let request = getRequest (stationUrl station)
+- CE.catch (simpleHTTP request >>= getResponseBody) errHandler
+- where errHandler :: CE.IOException -> IO String
+- errHandler _ = return "<Could not retrieve data>"
+-#endif
+
+ formatWeather :: [WeatherInfo] -> Monitor String
+ formatWeather [WI st ss y m d h (WindInfo wc wa wm wk wkh wms) v sk tC tF dC dF r p] =
+@@ -221,7 +209,6 @@ runWeather str =
+ formatWeather i
+
+ weatherReady :: [String] -> Monitor Bool
+-#ifdef HTTP_CONDUIT
+ weatherReady str = do
+ initRequest <- parseUrl $ stationUrl $ head str
+ let request = initRequest{method = methodHead}
+@@ -235,21 +222,3 @@ weatherReady str = do
+ | statusIsServerError status = False
+ | statusIsClientError status = False
+ | otherwise = True
+-#else
+-weatherReady str = do
+- let station = head str
+- request = headRequest (stationUrl station)
+- io $ CE.catch (simpleHTTP request >>= checkResult) errHandler
+- where errHandler :: CE.IOException -> IO Bool
+- errHandler _ = return False
+- checkResult result =
+- case result of
+- Left _ -> return False
+- Right response ->
+- case rspCode response of
+- -- Permission or network errors are failures; anything
+- -- else is recoverable.
+- (4, _, _) -> return False
+- (5, _, _) -> return False
+- (_, _, _) -> return True
+-#endif
+Index: xmobar.cabal
+==============================================================================
+--- xmobar.cabal.orig 2018-12-24 02:06:23 UTC
++++ xmobar.cabal
+@@ -87,10 +87,6 @@ flag with_weather
+ description: Enable weather plugin.
+ default: True
+
+-flag with_conduit
+- description: Use http-conduits for weather data, used only if with_weather.
+- default: False
+-
+ library
+ hs-source-dirs: src
+
+@@ -251,15 +247,11 @@ library
+ cpp-options: -DXPM
+
+ if flag(with_weather) || flag(all_extensions)
+- build-depends: HTTP >= 4000.2.4
+ exposed-modules: Xmobar.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
++ build-depends: http-conduit, http-types
+
+- if flag(with_uvmeter) && flag(with_conduit)
++ if flag(with_uvmeter)
+ exposed-modules: Xmobar.Plugins.Monitors.UVMeter
+ build-depends: http-conduit, http-types
+ cpp-options: -DUVMETER