[Pkg-haskell-commits] [package-plan] 03/05: No need to ignore taffybar

Joachim Breitner nomeata at moszumanska.debian.org
Fri Aug 8 11:18:22 UTC 2014


This is an automated email from the git hooks/post-receive script.

nomeata pushed a commit to branch master
in repository package-plan.

commit 369404f0e69e73e90cf367af7cf2d71131b5f27c
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Fri Aug 8 11:19:33 2014 +0200

    No need to ignore taffybar
---
 packages.txt                                       |   2 +-
 patches/taffybar/0.2.1/cabal-bug-626.patch         |  16 ++
 .../0.2.1/eliminate-web-encodings-dependency.patch |  83 ++++++++
 patches/taffybar/0.2.1/man-page.patch              |  37 ++++
 .../0.2.1/port-from-dbus-core-to-dbus.patch        | 231 +++++++++++++++++++++
 patches/taffybar/0.2.1/series                      |   4 +
 6 files changed, 372 insertions(+), 1 deletion(-)

diff --git a/packages.txt b/packages.txt
index 698701b..4dd7b10 100644
--- a/packages.txt
+++ b/packages.txt
@@ -613,7 +613,7 @@ syb-with-class-instances-text 0.0.1
 system-fileio 0.3.11
 system-filepath 0.4.12
 tabular 0.2.2.5
-taffybar 0.2.1 ignore # patched for dbus et al
+taffybar 0.2.1
 tagged 0.7.2
 tagsoup 0.13.1
 tagstream-conduit 0.5.5.1
diff --git a/patches/taffybar/0.2.1/cabal-bug-626.patch b/patches/taffybar/0.2.1/cabal-bug-626.patch
new file mode 100644
index 0000000..1d9ca0c
--- /dev/null
+++ b/patches/taffybar/0.2.1/cabal-bug-626.patch
@@ -0,0 +1,16 @@
+Index: taffybar/taffybar.cabal
+===================================================================
+--- taffybar.orig/taffybar.cabal	2013-07-17 21:35:44.000000000 +0200
++++ taffybar/taffybar.cabal	2013-07-23 12:54:33.000000000 +0200
+@@ -22,9 +22,9 @@
+   .
+     * More robust strut handling for multiple monitors of different sizes (contributed by Morgan Gibson)
+   .
+-    * New widgets from José A. Romero (network monitor, fs monitor, another CPU monitor)
++    * New widgets from Jose' A. Romero (network monitor, fs monitor, another CPU monitor)
+   .
+-    * Allow the bar widget to grow vertically (also contributed by José A. Romero)
++    * Allow the bar widget to grow vertically (also contributed by Jose' A. Romero)
+   .
+   Changes in v0.2.0:
+   .
diff --git a/patches/taffybar/0.2.1/eliminate-web-encodings-dependency.patch b/patches/taffybar/0.2.1/eliminate-web-encodings-dependency.patch
new file mode 100644
index 0000000..a8dc456
--- /dev/null
+++ b/patches/taffybar/0.2.1/eliminate-web-encodings-dependency.patch
@@ -0,0 +1,83 @@
+From: CJ van den Berg <cj at vdbonline.com>
+Subject: Eliminate web-encodings dependency
+
+Origin: upstream, https://github.com/travitch/taffybar/commit/4c2591a25c8700cec29aa28892e4dbfa610ed1e2
+Index: taffybar/src/System/Taffybar/FreedesktopNotifications.hs
+===================================================================
+--- taffybar.orig/src/System/Taffybar/FreedesktopNotifications.hs	2013-07-16 18:20:24.000000000 +0200
++++ taffybar/src/System/Taffybar/FreedesktopNotifications.hs	2013-07-17 21:01:58.000000000 +0200
+@@ -28,7 +28,6 @@
+ import Data.Word ( Word32 )
+ import DBus.Client.Simple
+ import Graphics.UI.Gtk hiding ( Variant )
+-import Web.Encodings ( decodeHtml, encodeHtml )
+ 
+ -- | A simple structure representing a Freedesktop notification
+ data Notification = Notification { noteAppName :: Text
+@@ -116,8 +115,8 @@
+       nid <- modifyMVar idSrc (\x -> return (x+1, x))
+       let n = Notification { noteAppName = appName
+                            , noteReplaceId = 0
+-                           , noteSummary = encodeHtml $ decodeHtml summary
+-                           , noteBody = encodeHtml $ decodeHtml body
++                           , noteSummary = T.pack $ escapeMarkup $ T.unpack summary
++                           , noteBody = T.pack $ escapeMarkup $ T.unpack body
+                            , noteExpireTimeout = tout
+                            , noteId = fromIntegral nid
+                            }
+Index: taffybar/src/System/Taffybar/MPRIS.hs
+===================================================================
+--- taffybar.orig/src/System/Taffybar/MPRIS.hs	2013-07-16 18:20:24.000000000 +0200
++++ taffybar/src/System/Taffybar/MPRIS.hs	2013-07-17 21:01:58.000000000 +0200
+@@ -18,7 +18,6 @@
+ import DBus.Types
+ import DBus.Message
+ import Graphics.UI.Gtk hiding ( Signal, Variant )
+-import Web.Encodings ( encodeHtml, decodeHtml )
+ import Text.Printf
+ 
+ setupDBus :: Label -> IO ()
+@@ -53,7 +52,7 @@
+     Just m -> do
+       let artist = maybe "[unknown]" id (variantDictLookup "artist" m)
+           track = maybe "[unknown]" id (variantDictLookup "title" m)
+-          msg = encodeHtml $ decodeHtml $ printf "%s - %s" (T.unpack artist) (T.unpack track)
++          msg = escapeMarkup $ printf "%s - %s" (T.unpack artist) (T.unpack track)
+           txt = "<span fgcolor='yellow'>Now Playing:</span> " ++ msg
+       postGUIAsync $ do
+         -- In case the widget was hidden due to a stop/pause, forcibly
+Index: taffybar/src/System/Taffybar/XMonadLog.hs
+===================================================================
+--- taffybar.orig/src/System/Taffybar/XMonadLog.hs	2013-07-16 18:20:24.000000000 +0200
++++ taffybar/src/System/Taffybar/XMonadLog.hs	2013-07-17 21:01:58.000000000 +0200
+@@ -33,8 +33,6 @@
+ import XMonad
+ import XMonad.Hooks.DynamicLog
+ 
+-import Web.Encodings ( decodeHtml, encodeHtml )
+-
+ -- | This is a DBus-based logger that can be used from XMonad to log
+ -- to this widget.  This version lets you specify the format for the
+ -- log using a pretty printer (e.g., 'taffybarPP').
+@@ -52,7 +50,7 @@
+ -- | Escape strings so that they can be safely displayed by Pango in
+ -- the bar widget
+ taffybarEscape :: String -> String
+-taffybarEscape = encodeHtml . decodeHtml
++taffybarEscape = escapeMarkup
+ 
+ -- | The same as defaultPP in XMonad.Hooks.DynamicLog
+ taffybarDefaultPP :: PP
+Index: taffybar/taffybar.cabal
+===================================================================
+--- taffybar.orig/taffybar.cabal	2013-07-16 18:20:24.000000000 +0200
++++ taffybar/taffybar.cabal	2013-07-17 21:01:58.000000000 +0200
+@@ -58,7 +58,7 @@
+ library
+   default-language: Haskell2010
+   build-depends: base > 3 && < 5, time, old-locale, containers, text, HTTP,
+-                 parsec >= 3.1, mtl >= 2, network, web-encodings, cairo,
++                 parsec >= 3.1, mtl >= 2, network, cairo,
+                  dbus-core >= 0.9.1 && < 1.0, gtk >= 0.12.1, dyre >= 0.8.6,
+                  HStringTemplate, gtk-traymanager >= 0.1.2 && < 0.2, xmonad-contrib, xmonad,
+                  xdg-basedir, filepath, utf8-string, process
diff --git a/patches/taffybar/0.2.1/man-page.patch b/patches/taffybar/0.2.1/man-page.patch
new file mode 100644
index 0000000..2af8b86
--- /dev/null
+++ b/patches/taffybar/0.2.1/man-page.patch
@@ -0,0 +1,37 @@
+Index: taffybar/taffybar.1
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ taffybar/taffybar.1	2013-07-21 17:04:30.000000000 +0200
+@@ -0,0 +1,32 @@
++.TH taffybar 1 "19 July 2013" "taffybar version 0.2.1" "User Manual"
++
++.SH NAME
++taffybar \- desktop bar extensible in Haskell
++
++.SH SYNOPSIS
++.B taffybar
++
++.SH DESCRIPTION
++Taffybar is a desktop bar written and extensible in Haskell. Consult the html
++documentation for a full description of its behaviour.
++
++.SH OPTIONS
++It doesn't take any.
++
++.SH FILES
++It can be configured in ~/.config/taffybar/taffybar.hs; consult the html
++documentation.
++
++.SH BUGS
++Bug reports, ideas and suggestions should be posted to the GitHub issue tracker
++<https://github.com/travitch/taffybar/issues>.
++
++.SH COPYRIGHT
++Copyright \(co 2012 Tristan Ravitch.
++.PP
++Taffybar is released under the terms of the BSD License.
++.SH "SEE ALSO"
++.BR xmobar (1)
++
++.SH AUTHOR
++Tristan Ravitch
diff --git a/patches/taffybar/0.2.1/port-from-dbus-core-to-dbus.patch b/patches/taffybar/0.2.1/port-from-dbus-core-to-dbus.patch
new file mode 100644
index 0000000..919a6aa
--- /dev/null
+++ b/patches/taffybar/0.2.1/port-from-dbus-core-to-dbus.patch
@@ -0,0 +1,231 @@
+From: CJ van den Berg <cj at vdbonline.com>
+Subject: Port from dbus-core to dbus
+
+Origin: upstream, https://github.com/travitch/taffybar/commit/a54f2fca4a99f06ffc284c5d53aa532d76bc2d4e
+Index: taffybar/src/System/Information/Battery.hs
+===================================================================
+--- taffybar.orig/src/System/Information/Battery.hs	2013-07-16 18:20:24.000000000 +0200
++++ taffybar/src/System/Information/Battery.hs	2013-07-17 21:24:24.000000000 +0200
+@@ -19,12 +19,14 @@
+ import Data.Maybe
+ import Data.Word
+ import Data.Int
+-import DBus.Client.Simple
+-import Data.List ( find )
+-import Data.Text ( isInfixOf, Text )
++import DBus
++import DBus.Client
++import Data.List ( find, isInfixOf )
++import Data.Text ( Text )
++import qualified Data.Text as T
+ 
+ -- | An opaque wrapper around some internal library state
+-newtype BatteryContext = BC Proxy
++data BatteryContext = BC Client ObjectPath
+ 
+ data BatteryType = BatteryTypeUnknown
+                  | BatteryTypeLinePower
+@@ -90,7 +92,7 @@
+ -- | Find the first power source that is a battery in the list.  The
+ -- simple heuristic is a substring search on 'BAT'
+ firstBattery :: [ObjectPath] -> Maybe ObjectPath
+-firstBattery = find (isInfixOf "BAT" . objectPathText)
++firstBattery = find (isInfixOf "BAT" . formatObjectPath)
+ 
+ -- | The name of the power daemon bus
+ powerBusName :: BusName
+@@ -128,16 +130,16 @@
+ -- If some fields are not actually present, they may have bogus values
+ -- here.  Don't bet anything critical on it.
+ getBatteryInfo :: BatteryContext -> IO BatteryInfo
+-getBatteryInfo (BC batteryProxy) = do
++getBatteryInfo (BC systemConn battPath) = do
+   -- Grab all of the properties of the battery each call with one
+   -- message.
+-  let iface :: Variant
+-      iface = toVariant ("org.freedesktop.UPower.Device" :: Text)
+-
+-  [val] <- call batteryProxy "org.freedesktop.DBus.Properties" "GetAll" [iface]
++  reply <- call_ systemConn (methodCall battPath "org.freedesktop.DBus.Properties" "GetAll")
++                             { methodCallDestination = Just "org.freedesktop.UPower"
++                             , methodCallBody = [toVariant $ T.pack "org.freedesktop.UPower.Device"]
++                             }
+ 
+   let dict :: Map Text Variant
+-      Just dict = fromVariant val
++      Just dict = fromVariant (methodReturnBody reply !! 0)
+   return BatteryInfo { batteryNativePath = readDict dict "NativePath" ""
+                      , batteryVendor = readDict dict "Vendor" ""
+                      , batteryModel = readDict dict "Model" ""
+@@ -173,11 +175,12 @@
+ 
+   -- First, get the list of devices.  For now, we just get the stats
+   -- for the first battery
+-  powerProxy <- proxy systemConn powerBusName powerBaseObjectPath
+-  [ powerDevicesV ] <- call powerProxy "org.freedesktop.UPower" "EnumerateDevices" []
+-  let Just powerDevices = fromVariant powerDevicesV
++  reply <- call_ systemConn (methodCall powerBaseObjectPath "org.freedesktop.UPower" "EnumerateDevices")
++        { methodCallDestination = Just powerBusName
++        }
++  let Just powerDevices = fromVariant (methodReturnBody reply !! 0)
++
+   case firstBattery powerDevices of
+     Nothing -> return Nothing
+     Just battPath ->
+-      proxy systemConn powerBusName battPath >>= (return . Just . BC)
+-
++      return . Just $ BC systemConn battPath
+Index: taffybar/src/System/Taffybar/FreedesktopNotifications.hs
+===================================================================
+--- taffybar.orig/src/System/Taffybar/FreedesktopNotifications.hs	2013-07-17 21:01:58.000000000 +0200
++++ taffybar/src/System/Taffybar/FreedesktopNotifications.hs	2013-07-17 21:24:24.000000000 +0200
+@@ -26,7 +26,8 @@
+ import Data.Text ( Text )
+ import qualified Data.Text as T
+ import Data.Word ( Word32 )
+-import DBus.Client.Simple
++import DBus
++import DBus.Client
+ import Graphics.UI.Gtk hiding ( Variant )
+ 
+ -- | A simple structure representing a Freedesktop notification
+@@ -146,12 +147,12 @@
+ 
+ notificationDaemon onNote onCloseNote = do
+   client <- connectSession
+-  _ <- requestName client "org.freedesktop.Notifications" [AllowReplacement, ReplaceExisting]
++  _ <- requestName client "org.freedesktop.Notifications" [nameAllowReplacement, nameReplaceExisting]
+   export client "/org/freedesktop/Notifications"
+-    [ method "org.freedesktop.Notifications" "GetServerInformation" getServerInformation
+-    , method "org.freedesktop.Notifications" "GetCapabilities" getCapabilities
+-    , method "org.freedesktop.Notifications" "CloseNotification" onCloseNote
+-    , method "org.freedesktop.Notifications" "Notify" onNote
++    [ autoMethod "org.freedesktop.Notifications" "GetServerInformation" getServerInformation
++    , autoMethod "org.freedesktop.Notifications" "GetCapabilities" getCapabilities
++    , autoMethod "org.freedesktop.Notifications" "CloseNotification" onCloseNote
++    , autoMethod "org.freedesktop.Notifications" "Notify" onNote
+     ]
+ 
+ -- When a notification is received, add it to the queue.  Post a token to the channel that the
+Index: taffybar/src/System/Taffybar/MPRIS.hs
+===================================================================
+--- taffybar.orig/src/System/Taffybar/MPRIS.hs	2013-07-17 21:01:58.000000000 +0200
++++ taffybar/src/System/Taffybar/MPRIS.hs	2013-07-17 21:24:24.000000000 +0200
+@@ -13,22 +13,20 @@
+ import qualified Data.Map as M
+ import Data.Text ( Text )
+ import qualified Data.Text as T
+-import DBus.Client.Simple ( connectSession )
++import DBus
+ import DBus.Client
+-import DBus.Types
+-import DBus.Message
+ import Graphics.UI.Gtk hiding ( Signal, Variant )
+ import Text.Printf
+ 
+ setupDBus :: Label -> IO ()
+ setupDBus w = do
+-  let trackMatcher = MatchRule { matchSender = Nothing
++  let trackMatcher = matchAny { matchSender = Nothing
+                                , matchDestination = Nothing
+                                , matchPath = Just "/Player"
+                                , matchInterface = Just "org.freedesktop.MediaPlayer"
+                                , matchMember = Just "TrackChange"
+                                }
+-      stateMatcher = MatchRule { matchSender = Nothing
++      stateMatcher = matchAny { matchSender = Nothing
+                                , matchDestination = Nothing
+                                , matchPath = Just "/Player"
+                                , matchInterface = Just "org.freedesktop.MediaPlayer"
+@@ -44,10 +42,11 @@
+   fromVariant val
+ 
+ 
+-trackCallback :: Label -> BusName -> Signal -> IO ()
+-trackCallback w _ Signal { signalBody = [variant] } = do
++trackCallback :: Label -> Signal -> IO ()
++trackCallback w s = do
+   let v :: Maybe (M.Map Text Variant)
+       v = fromVariant variant
++      [variant] = signalBody s
+   case v of
+     Just m -> do
+       let artist = maybe "[unknown]" id (variantDictLookup "artist" m)
+@@ -60,11 +59,10 @@
+         labelSetMarkup w txt
+         widgetShowAll w
+     _ -> return ()
+-trackCallback _ _ _ = return ()
+ 
+-stateCallback :: Label -> BusName -> Signal -> IO ()
+-stateCallback w _ Signal { signalBody = [bdy] } =
+-  case fromVariant bdy of
++stateCallback :: Label -> Signal -> IO ()
++stateCallback w s =
++  case fromVariant (signalBody s !! 0) of
+     Just st -> case structureItems st of
+       (pstate:_) -> case (fromVariant pstate) :: Maybe Int32 of
+         Just 2 -> postGUIAsync $ widgetHideAll w
+@@ -73,7 +71,6 @@
+         _ -> return ()
+       _ -> return ()
+     _ -> return ()
+-stateCallback _ _ _ = return ()
+ 
+ mprisNew :: IO Widget
+ mprisNew = do
+Index: taffybar/src/System/Taffybar/XMonadLog.hs
+===================================================================
+--- taffybar.orig/src/System/Taffybar/XMonadLog.hs	2013-07-17 21:01:58.000000000 +0200
++++ taffybar/src/System/Taffybar/XMonadLog.hs	2013-07-17 21:24:24.000000000 +0200
+@@ -24,10 +24,8 @@
+   ) where
+ 
+ import Codec.Binary.UTF8.String ( decodeString )
+-import DBus.Client.Simple ( connectSession, emit, Client )
+-import DBus.Client ( listen, MatchRule(..) )
+-import DBus.Types
+-import DBus.Message
++import DBus ( toVariant, fromVariant, Signal(..), signal )
++import DBus.Client ( listen, matchAny, MatchRule(..), connectSession, emit, Client )
+ import Graphics.UI.Gtk hiding ( Signal )
+ 
+ import XMonad
+@@ -79,11 +77,11 @@
+   -- We need to decode the string back into a real String before we
+   -- send it over dbus.
+   let str' = decodeString str
+-  emit client "/org/xmonad/Log" "org.xmonad.Log" "Update" [ toVariant str' ]
++  emit client (signal "/org/xmonad/Log" "org.xmonad.Log" "Update") { signalBody = [ toVariant str' ] }
+ 
+ setupDbus :: Label -> IO ()
+ setupDbus w = do
+-  let matcher = MatchRule { matchSender = Nothing
++  let matcher = matchAny { matchSender = Nothing
+                           , matchDestination = Nothing
+                           , matchPath = Just "/org/xmonad/Log"
+                           , matchInterface = Just "org.xmonad.Log"
+@@ -94,8 +92,8 @@
+ 
+   listen client matcher (callback w)
+ 
+-callback :: Label -> BusName -> Signal -> IO ()
+-callback w _ sig = do
++callback :: Label -> Signal -> IO ()
++callback w sig = do
+   let [bdy] = signalBody sig
+       Just status = fromVariant bdy
+   postGUIAsync $ labelSetMarkup w status
+Index: taffybar/taffybar.cabal
+===================================================================
+--- taffybar.orig/taffybar.cabal	2013-07-17 21:01:58.000000000 +0200
++++ taffybar/taffybar.cabal	2013-07-17 21:24:24.000000000 +0200
+@@ -59,7 +59,7 @@
+   default-language: Haskell2010
+   build-depends: base > 3 && < 5, time, old-locale, containers, text, HTTP,
+                  parsec >= 3.1, mtl >= 2, network, cairo,
+-                 dbus-core >= 0.9.1 && < 1.0, gtk >= 0.12.1, dyre >= 0.8.6,
++                 dbus >= 0.10.1 && < 1.0, gtk >= 0.12.1, dyre >= 0.8.6,
+                  HStringTemplate, gtk-traymanager >= 0.1.2 && < 0.2, xmonad-contrib, xmonad,
+                  xdg-basedir, filepath, utf8-string, process
+   hs-source-dirs: src
diff --git a/patches/taffybar/0.2.1/series b/patches/taffybar/0.2.1/series
new file mode 100644
index 0000000..db1b3be
--- /dev/null
+++ b/patches/taffybar/0.2.1/series
@@ -0,0 +1,4 @@
+eliminate-web-encodings-dependency.patch
+port-from-dbus-core-to-dbus.patch
+man-page.patch
+cabal-bug-626.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-haskell/package-plan.git



More information about the Pkg-haskell-commits mailing list