[Pkg-haskell-commits] darcs: taffybar: Initial Check-In

Louis Bettens louis at bettens.info
Wed Jul 17 20:48:23 UTC 2013


Wed Jul 17 20:47:36 UTC 2013  Louis Bettens <louis at bettens.info>
  * Initial Check-In

    A ./changelog
    A ./compat
    A ./control
    A ./copyright
    A ./patches/
    A ./patches/eliminate-web-encodings-dependency.patch
    A ./patches/port-from-dbus-core-to-dbus.patch
    A ./patches/series
    A ./rules
    A ./source/
    A ./source/format
    A ./watch

Wed Jul 17 20:47:36 UTC 2013  Louis Bettens <louis at bettens.info>
  * Initial Check-In
diff -rN -u old-taffybar/changelog new-taffybar/changelog
--- old-taffybar/changelog	1970-01-01 00:00:00.000000000 +0000
+++ new-taffybar/changelog	2013-07-17 20:48:23.839046411 +0000
@@ -0,0 +1,5 @@
+taffybar (0.2.1-1) UNRELEASED; urgency=low
+
+  * Initial release
+
+ -- Louis Bettens <louis at bettens.info>  Wed, 17 Jul 2013 19:20:48 +0200
diff -rN -u old-taffybar/compat new-taffybar/compat
--- old-taffybar/compat	1970-01-01 00:00:00.000000000 +0000
+++ new-taffybar/compat	2013-07-17 20:48:23.839046411 +0000
@@ -0,0 +1 @@
+9
diff -rN -u old-taffybar/control new-taffybar/control
--- old-taffybar/control	1970-01-01 00:00:00.000000000 +0000
+++ new-taffybar/control	2013-07-17 20:48:23.839046411 +0000
@@ -0,0 +1,115 @@
+Source: taffybar
+Section: haskell
+Priority: extra
+Maintainer: Debian Haskell Group <pkg-haskell-maintainers at lists.alioth.debian.org>
+Uploaders: Louis Bettens <louis at bettens.info>
+Build-Depends: debhelper (>= 9)
+  , cdbs
+  , haskell-devscripts (>= 0.8.15)
+  , ghc
+  , ghc-prof
+# Make sure all dependencies listed in the cabal file are represented here,
+# including their version bounds. It is sufficient to add the bounds to the
+# -dev package only.
+  , libghc-text-dev
+  , libghc-http-dev
+  , libghc-parsec3-dev (>= 3.1)
+  , libghc-mtl-dev (>= 2)
+  , libghc-network-dev
+  , libghc-cairo-dev
+  , libghc-dbus-dev (>= 0.10.1)
+  , libghc-dbus-dev (<< 1.0)
+  , libghc-gtk-dev (>= 0.12.1)
+  , libghc-dyre-dev (>= 0.8.6)
+  , libghc-hstringtemplate-dev
+  , libghc-gtk-traymanager-dev (>= 0.1.2)
+  , libghc-gtk-traymanager-dev (<< 0.2)
+  , libghc-xmonad-dev
+  , libghc-xmonad-contrib-dev
+  , libghc-xdg-basedir-dev
+  , libghc-utf8-string-dev
+  , libghc-stm-dev
+  , libghc-transformers-dev (>= 0.3.0.0)
+  , libghc-x11-dev (>= 1.5.0.1)
+  , libghc-split-dev (>= 0.1.4.2)
+  , libghc-text-prof
+  , libghc-http-prof
+  , libghc-parsec3-prof
+  , libghc-mtl-prof
+  , libghc-network-prof
+  , libghc-cairo-prof
+  , libghc-dbus-prof
+  , libghc-gtk-prof
+  , libghc-dyre-prof
+  , libghc-hstringtemplate-prof
+  , libghc-gtk-traymanager-prof
+  , libghc-xmonad-prof
+  , libghc-xmonad-contrib-prof
+  , libghc-xdg-basedir-prof
+  , libghc-utf8-string-prof
+  , libghc-stm-prof
+  , libghc-transformers-prof
+  , libghc-x11-prof
+  , libghc-split-prof
+Build-Depends-Indep: ghc-doc
+  , libghc-text-doc
+  , libghc-http-doc
+  , libghc-parsec3-doc
+  , libghc-mtl-doc
+  , libghc-network-doc
+  , libghc-cairo-doc
+  , libghc-dbus-doc
+  , libghc-gtk-doc
+  , libghc-dyre-doc
+  , libghc-hstringtemplate-doc
+  , libghc-gtk-traymanager-doc
+  , libghc-xmonad-doc
+  , libghc-xmonad-contrib-doc
+  , libghc-xdg-basedir-doc
+  , libghc-utf8-string-doc
+  , libghc-stm-doc
+  , libghc-transformers-doc
+  , libghc-x11-doc
+  , libghc-split-doc
+Standards-Version: 3.9.4
+Homepage: http://hackage.haskell.org/package/taffybar
+Vcs-Darcs: http://darcs.debian.org/pkg-haskell/taffybar
+Vcs-Browser: http://darcs.debian.org/cgi-bin/darcsweb.cgi?r=pkg-haskell/taffybar
+X-Description: Short description of foo
+ Long description of foo
+
+Package: libghc-taffybar-dev
+Architecture: any
+Depends: ${haskell:Depends}
+  , ${shlibs:Depends}
+  , ${misc:Depends}
+Recommends: ${haskell:Recommends}
+Suggests: ${haskell:Suggests}
+Provides: ${haskell:Provides}
+Description: ${haskell:ShortDescription}${haskell:ShortBlurb}
+ ${haskell:LongDescription}
+ .
+ ${haskell:Blurb}
+
+Package: libghc-taffybar-prof
+Architecture: any
+Depends: ${haskell:Depends}
+  , ${misc:Depends}
+Recommends: ${haskell:Recommends}
+Suggests: ${haskell:Suggests}
+Provides: ${haskell:Provides}
+Description: ${haskell:ShortDescription}${haskell:ShortBlurb}
+ ${haskell:LongDescription}
+ .
+ ${haskell:Blurb}
+
+Package: libghc-taffybar-doc
+Section: doc
+Architecture: all
+Depends: ${misc:Depends}, ${haskell:Depends}
+Recommends: ${haskell:Recommends}
+Suggests: ${haskell:Suggests}
+Description: ${haskell:ShortDescription}${haskell:ShortBlurb}
+ ${haskell:LongDescription}
+ .
+ ${haskell:Blurb}
diff -rN -u old-taffybar/copyright new-taffybar/copyright
--- old-taffybar/copyright	1970-01-01 00:00:00.000000000 +0000
+++ new-taffybar/copyright	2013-07-17 20:48:23.839046411 +0000
@@ -0,0 +1,50 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: taffybar
+Upstream-Contact: Tristan Ravitch <travitch at cs.wisc.edu>
+Source: http://hackage.haskell.org/package/taffybar
+
+Files: *
+Copyright: 2012 Tristan Ravitch
+License: BSD3
+
+License: BSD3
+ Copyright (c)2011, Tristan Ravitch
+ .
+ All rights reserved.
+ .
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ .
+     * Redistributions of source code must retain the above copyright
+       notice, this list of conditions and the following disclaimer.
+ .
+     * Redistributions in binary form must reproduce the above
+       copyright notice, this list of conditions and the following
+       disclaimer in the documentation and/or other materials provided
+       with the distribution.
+ .
+     * Neither the name of Tristan Ravitch nor the names of other
+       contributors may be used to endorse or promote products derived
+       from this software without specific prior written permission.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Files: debian/*
+Copyright: 2013 Louis Bettens
+License: permissive
+
+License: permissive
+ Copying and distribution of this package, with or without
+ modification, are permitted in any medium without royalty
+ provided the copyright notice and this notice are
+ preserved.
diff -rN -u old-taffybar/patches/eliminate-web-encodings-dependency.patch new-taffybar/patches/eliminate-web-encodings-dependency.patch
--- old-taffybar/patches/eliminate-web-encodings-dependency.patch	1970-01-01 00:00:00.000000000 +0000
+++ new-taffybar/patches/eliminate-web-encodings-dependency.patch	2013-07-17 20:48:23.843038965 +0000
@@ -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 -rN -u old-taffybar/patches/port-from-dbus-core-to-dbus.patch new-taffybar/patches/port-from-dbus-core-to-dbus.patch
--- old-taffybar/patches/port-from-dbus-core-to-dbus.patch	1970-01-01 00:00:00.000000000 +0000
+++ new-taffybar/patches/port-from-dbus-core-to-dbus.patch	2013-07-17 20:48:23.843038965 +0000
@@ -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") {[...incomplete...]



More information about the Pkg-haskell-commits mailing list