summaryrefslogtreecommitdiff
path: root/x11
diff options
context:
space:
mode:
authorahoka <ahoka>2010-12-16 11:37:38 +0000
committerahoka <ahoka>2010-12-16 11:37:38 +0000
commit0a29d82f836bffc06104458705b03a858c123341 (patch)
tree7ab903e5a5ee85725f41e2e57cb1dc2cfc440048 /x11
parent424823d2bea68a669f2cab949042546d6dc43dd6 (diff)
downloadpkgsrc-0a29d82f836bffc06104458705b03a858c123341.tar.gz
If we the battery 'remaining' propery is empty, try to calculate it
from discharge rate. make the battery applet work with netbsd (again?)
Diffstat (limited to 'x11')
-rw-r--r--x11/gnome-applets/Makefile3
-rw-r--r--x11/gnome-applets/distinfo3
-rw-r--r--x11/gnome-applets/patches/patch-hal26
3 files changed, 30 insertions, 2 deletions
diff --git a/x11/gnome-applets/Makefile b/x11/gnome-applets/Makefile
index 00fd8d9382b..9b79e32bd78 100644
--- a/x11/gnome-applets/Makefile
+++ b/x11/gnome-applets/Makefile
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.87 2010/12/01 09:38:21 cegger Exp $
+# $NetBSD: Makefile,v 1.88 2010/12/16 11:37:38 ahoka Exp $
#
DISTNAME= gnome-applets-2.32.1.1
+PKGREVISION= 1
CATEGORIES= x11 gnome
MASTER_SITES= ${MASTER_SITE_GNOME:=sources/gnome-applets/2.32/}
EXTRACT_SUFX= .tar.bz2
diff --git a/x11/gnome-applets/distinfo b/x11/gnome-applets/distinfo
index b4ffc02c78f..3e3ab133f69 100644
--- a/x11/gnome-applets/distinfo
+++ b/x11/gnome-applets/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.27 2010/11/26 11:34:41 drochner Exp $
+$NetBSD: distinfo,v 1.28 2010/12/16 11:37:38 ahoka Exp $
SHA1 (gnome-applets-2.32.1.1.tar.bz2) = 6edc3aea2bd2198b2bdbdb1fa63b481f724c8fe2
RMD160 (gnome-applets-2.32.1.1.tar.bz2) = 50c8e169b02aa002917f4c6ea0f575522e3ae984
@@ -6,3 +6,4 @@ Size (gnome-applets-2.32.1.1.tar.bz2) = 10083534 bytes
SHA1 (patch-aa) = 764fc46c7c000e21a1602286443e2633ec743631
SHA1 (patch-ab) = f880abec6df2254b6541d4e5a894559763ef674b
SHA1 (patch-ad) = 42fb64b30a031a1ea8f57f47cabdf63475b7987e
+SHA1 (patch-hal) = 8de5986b77a8ae7f99533eaff7f6a5a5c3069f3d
diff --git a/x11/gnome-applets/patches/patch-hal b/x11/gnome-applets/patches/patch-hal
new file mode 100644
index 00000000000..1a7907b306a
--- /dev/null
+++ b/x11/gnome-applets/patches/patch-hal
@@ -0,0 +1,26 @@
+$NetBSD: patch-hal,v 1.1 2010/12/16 11:37:39 ahoka Exp $
+
+--- battstat/battstat-hal.c.orig 2010-11-22 14:38:27.000000000 +0000
++++ battstat/battstat-hal.c
+@@ -549,7 +549,7 @@ battstat_hal_get_battery_info( BatterySt
+ status->percent = ( ((double) current_charge_total) /
+ ((double) full_capacity_total) ) * 100.0 + 0.5;
+
+- if( present == 1 )
++ if( present == 1 && remaining_time != 0 )
+ {
+ /* In the case of exactly one battery, report the time remaining figure
+ * from HAL directly since it might have come from an authorative source
+@@ -559,10 +559,11 @@ battstat_hal_get_battery_info( BatterySt
+ * remaining time is unknown. Battstat uses minutes and -1 for
+ * unknown time remaining.
+ */
+-
++#if 0
+ if( remaining_time == 0 )
+ status->minutes = -1;
+ else
++#endif
+ status->minutes = (remaining_time + 30) / 60;
+ }
+ /* Rest of cases to deal with multiple battery systems... */