app-laptop/batti: Support current upower version (#600914 by idl0r), hicolor-icon...
authorPacho Ramos <pacho@gentoo.org>
Sun, 18 Jun 2017 09:17:04 +0000 (11:17 +0200)
committerPacho Ramos <pacho@gentoo.org>
Sun, 18 Jun 2017 09:17:28 +0000 (11:17 +0200)
Package-Manager: Portage-2.3.6, Repoman-2.3.2

app-laptop/batti/batti-0.3.8-r4.ebuild [new file with mode: 0644]
app-laptop/batti/files/batti-0.3.8-upower-capital.patch [new file with mode: 0644]

diff --git a/app-laptop/batti/batti-0.3.8-r4.ebuild b/app-laptop/batti/batti-0.3.8-r4.ebuild
new file mode 100644 (file)
index 0000000..a0f42c0
--- /dev/null
@@ -0,0 +1,45 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python2_7 )
+
+inherit distutils-r1 gnome2-utils
+
+DESCRIPTION="A upower based battery monitor for the system tray, similar to batterymon"
+HOMEPAGE="https://code.google.com/p/batti-gtk/"
+SRC_URI="https://batti-gtk.googlecode.com/files/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="libnotify"
+
+RDEPEND="
+       dev-python/pygtk:2[${PYTHON_USEDEP}]
+       dev-python/dbus-python[${PYTHON_USEDEP}]
+       || ( sys-power/upower sys-power/upower-pm-utils )
+       x11-themes/hicolor-icon-theme
+       libnotify? ( x11-libs/libnotify )
+"
+DEPEND=""
+
+src_prepare() {
+       default
+       if has_version ">=sys-power/upower-0.99"; then
+               eapply "${FILESDIR}/${P}-upower-0.99.patch"
+               eapply "${FILESDIR}/${P}-upower-capital.patch"
+       fi
+}
+
+pkg_preinst() {
+       gnome2_icon_savelist
+}
+
+pkg_postinst() {
+       gnome2_icon_cache_update
+}
+
+pkg_postrm() {
+       gnome2_icon_cache_update
+}
diff --git a/app-laptop/batti/files/batti-0.3.8-upower-capital.patch b/app-laptop/batti/files/batti-0.3.8-upower-capital.patch
new file mode 100644 (file)
index 0000000..e7f6276
--- /dev/null
@@ -0,0 +1,32 @@
+From 1e0fe57a93ed3996bad295e20eeda81f6af483af Mon Sep 17 00:00:00 2001
+From: Christian Ruppert <idl0r@gentoo.org>
+Date: Wed, 20 Jul 2016 20:14:32 +0200
+Subject: [PATCH] The type property (in recent UPower at least) needs to have a
+ capital T - "Type"
+
+---
+ src/PowerBackend.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/PowerBackend.py b/src/PowerBackend.py
+index e020b98..56bcb61 100644
+--- a/src/PowerBackend.py
++++ b/src/PowerBackend.py
+@@ -165,7 +165,7 @@ def __init__(self):
+         self.__batteries = {}
+         for dev in devices:
+             (prop_iface, dev_iface) = self.__get_battery(dev)
+-            type = prop_iface.Get(self.device_interface, 'type')
++            type = prop_iface.Get(self.device_interface, 'Type')
+             if type == self.bat_type:
+                 power_bat = UPowerBattery(prop_iface, dev_iface)
+                 self.__batteries[dev] = power_bat
+@@ -228,7 +228,7 @@ def set_right_popup_menu_action(self, action):
+     def __device_added(self, udi):
+         (prop_iface, dev_iface) = self.__get_battery(udi)
+         try:
+-            type = prop_iface.Get(self.device_interface, 'type')
++            type = prop_iface.Get(self.device_interface, 'Type')
+             if type == self.bat_type:
+                 power_bat = UPowerBattery(prop_iface, dev_iface)
+                 power_bat.set_left_popup_menu_action(self.__mc_action)