Wed Dec 17 12:57:27 2008 UTC ()
Update to 0.5.1.
  * Apply patch to fix compilation with kfreebsd (Bug #3040).
  * Apply patch to make the plugin work with newer kernels (Bug #3190).


(hira)
diff -r1.6 -r1.7 pkgsrc/sysutils/xfce4-battery-plugin/Makefile
diff -r1.6 -r1.7 pkgsrc/sysutils/xfce4-battery-plugin/distinfo
diff -r1.6 -r1.7 pkgsrc/sysutils/xfce4-battery-plugin/patches/patch-aa

cvs diff -r1.6 -r1.7 pkgsrc/sysutils/xfce4-battery-plugin/Makefile (expand / switch to unified diff)

--- pkgsrc/sysutils/xfce4-battery-plugin/Makefile 2008/01/05 05:42:02 1.6
+++ pkgsrc/sysutils/xfce4-battery-plugin/Makefile 2008/12/17 12:57:27 1.7
@@ -1,21 +1,20 @@ @@ -1,21 +1,20 @@
1# $NetBSD: Makefile,v 1.6 2008/01/05 05:42:02 hira Exp $ 1# $NetBSD: Makefile,v 1.7 2008/12/17 12:57:27 hira Exp $
2 2
3.include "../../meta-pkgs/xfce4/Makefile.common" 3.include "../../meta-pkgs/xfce4/Makefile.common"
4 4
5XFCE4_VERSION= 0.5.0 5XFCE4_VERSION= 0.5.1
6 6
7DISTNAME= xfce4-battery-plugin-${XFCE4_VERSION} 7DISTNAME= xfce4-battery-plugin-${XFCE4_VERSION}
8PKGREVISION= 2 
9CATEGORIES= sysutils 8CATEGORIES= sysutils
10MASTER_SITES= http://goodies.xfce.org/releases/xfce4-battery-plugin/ 9MASTER_SITES= http://goodies.xfce.org/releases/xfce4-battery-plugin/
11COMMENT= Xfce battey monitor plugin 10COMMENT= Xfce battey monitor plugin
12 11
13# On NetBSD/sparc64, apmvar.h is not exist in /usr/include/machine. 12# On NetBSD/sparc64, apmvar.h is not exist in /usr/include/machine.
14# Reported in PR port-sparc64/36735. 13# Reported in PR port-sparc64/36735.
15.if ${OPSYS} == "NetBSD" && \ 14.if ${OPSYS} == "NetBSD" && \
16 (!exists(/usr/include/machine/apmvar.h) && \ 15 (!exists(/usr/include/machine/apmvar.h) && \
17 !exists(/usr/include/sparc/apmvar.h)) 16 !exists(/usr/include/sparc/apmvar.h))
18PKG_FAIL_REASON+= "APM is not available on ${MACHINE_PLATFORM}." 17PKG_FAIL_REASON+= "APM is not available on ${MACHINE_PLATFORM}."
19.endif 18.endif
20 19
21USE_TOOLS+= perl:run 20USE_TOOLS+= perl:run

cvs diff -r1.6 -r1.7 pkgsrc/sysutils/xfce4-battery-plugin/distinfo (expand / switch to unified diff)

--- pkgsrc/sysutils/xfce4-battery-plugin/distinfo 2008/01/05 05:42:02 1.6
+++ pkgsrc/sysutils/xfce4-battery-plugin/distinfo 2008/12/17 12:57:27 1.7
@@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
1$NetBSD: distinfo,v 1.6 2008/01/05 05:42:02 hira Exp $ 1$NetBSD: distinfo,v 1.7 2008/12/17 12:57:27 hira Exp $
2 2
3SHA1 (xfce4-battery-plugin-0.5.0.tar.bz2) = 63439d32bfe8411458d41c38824cb393bc31d6e0 3SHA1 (xfce4-battery-plugin-0.5.1.tar.bz2) = f97c1b6445c8da07c17353ae385b5fadb2fd5f1a
4RMD160 (xfce4-battery-plugin-0.5.0.tar.bz2) = bbf64994c7686b11b6a51bd7728569cd2a5d9777 4RMD160 (xfce4-battery-plugin-0.5.1.tar.bz2) = ee770f06226cf8dfed95892c152ae3a2a446079a
5Size (xfce4-battery-plugin-0.5.0.tar.bz2) = 222269 bytes 5Size (xfce4-battery-plugin-0.5.1.tar.bz2) = 227940 bytes
6SHA1 (patch-aa) = 350959404b2c1d9f5cfa8c360cfd9d9eec6ce5e0 6SHA1 (patch-aa) = 2293c172ad3f8414168e012d6a982d1ff017c5e3

cvs diff -r1.6 -r1.7 pkgsrc/sysutils/xfce4-battery-plugin/patches/Attic/patch-aa (expand / switch to unified diff)

--- pkgsrc/sysutils/xfce4-battery-plugin/patches/Attic/patch-aa 2008/01/05 05:42:02 1.6
+++ pkgsrc/sysutils/xfce4-battery-plugin/patches/Attic/patch-aa 2008/12/17 12:57:27 1.7
@@ -1,23 +1,23 @@ @@ -1,23 +1,23 @@
1$NetBSD: patch-aa,v 1.6 2008/01/05 05:42:02 hira Exp $ 1$NetBSD: patch-aa,v 1.7 2008/12/17 12:57:27 hira Exp $
2 2
3--- panel-plugin/battery.c.orig 2007-01-18 02:56:51.000000000 +0900 3--- panel-plugin/battery.c.orig 2008-09-05 05:53:40.000000000 +0900
4+++ panel-plugin/battery.c 2008-01-03 21:30:22.000000000 +0900 4+++ panel-plugin/battery.c 2008-11-27 22:16:05.000000000 +0900
5@@ -25,7 +25,7 @@ 5@@ -25,7 +25,7 @@
6 #include <config.h> 6 #include <config.h>
7 #endif 7 #endif
8  8
9-#ifdef __FreeBSD__ 9-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
10+#if defined(__FreeBSD__) || defined(__DragonFly__) 10+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
11 #include <machine/apm_bios.h> 11 #include <machine/apm_bios.h>
12 #elif __OpenBSD__ 12 #elif __OpenBSD__
13 #include <sys/param.h> 13 #include <sys/param.h>
14@@ -33,8 +33,15 @@ 14@@ -33,8 +33,15 @@
15 #elif __NetBSD__ 15 #elif __NetBSD__
16 #include <sys/param.h> 16 #include <sys/param.h>
17 #include <sys/ioctl.h> 17 #include <sys/ioctl.h>
18+#if defined(__sparc64__) 18+#if defined(__sparc64__)
19+/* On NetBSD/sparc64, apmvar.h is not exist in /usr/include/machine. */ 19+/* On NetBSD/sparc64, apmvar.h is not exist in /usr/include/machine. */
20+/* Reported in PR port-sparc64/36735. */ 20+/* Reported in PR port-sparc64/36735. */
21+#include <sparc/apmvar.h> 21+#include <sparc/apmvar.h>
22+#else 22+#else
23 #include <machine/apmvar.h> 23 #include <machine/apmvar.h>
@@ -53,46 +53,46 @@ $NetBSD: patch-aa,v 1.6 2008/01/05 05:42 @@ -53,46 +53,46 @@ $NetBSD: patch-aa,v 1.6 2008/01/05 05:42
53+ if (ioctl(fd, APM_IOC_GETPOWER, &apm) == -1) 53+ if (ioctl(fd, APM_IOC_GETPOWER, &apm) == -1)
54 return TRUE; 54 return TRUE;
55 close(fd); 55 close(fd);
56 charge = apm.battery_life; 56 charge = apm.battery_life;
57 time_remaining = apm.minutes_left; 57 time_remaining = apm.minutes_left;
58 acline = apm.ac_state ? TRUE : FALSE; 58 acline = apm.ac_state ? TRUE : FALSE;
59  59
60+ if(battmon->timeoutid != 0) g_source_remove(battmon->timeoutid); 60+ if(battmon->timeoutid != 0) g_source_remove(battmon->timeoutid);
61+ battmon->timeoutid = g_timeout_add(2 * 1024, 61+ battmon->timeoutid = g_timeout_add(2 * 1024,
62+ (GSourceFunc) update_apm_status, battmon); 62+ (GSourceFunc) update_apm_status, battmon);
63 #else 63 #else
64 struct apm_info apm; 64 struct apm_info apm;
65 DBG ("Updating battery status..."); 65 DBG ("Updating battery status...");
66@@ -400,7 +410,7 @@ 66@@ -404,7 +414,7 @@
67 acline = apm.ac_line_status ? TRUE : FALSE; 67 acline = apm.ac_line_status ? TRUE : FALSE;
68  68
69 } 69 }
70-#elif __FreeBSD__ 70-#elif __FreeBSD__
71+#elif defined(__FreeBSD__) || defined(__DragonFly__) 71+#elif defined(__FreeBSD__) || defined(__DragonFly__)
72 else { 72 else {
73 /* This is how I read the information from the APM subsystem under 73 /* This is how I read the information from the APM subsystem under
74 FreeBSD. Each time this functions is called (once every second) 74 FreeBSD. Each time this functions is called (once every second)
75@@ -460,6 +470,11 @@ 75@@ -464,6 +474,11 @@
76  76
77 if(battmon->options.display_percentage && !(battmon->options.hide_when_full && acline && charge >= 99)){ 77 if(battmon->options.display_percentage && !(battmon->options.hide_when_full && acline && charge >= 99)){
78 gtk_widget_show((GtkWidget *)battmon->charge); 78 gtk_widget_show((GtkWidget *)battmon->charge);
79+#if defined(__NetBSD__) || defined(__OpenBSD__) 79+#if defined(__NetBSD__) || defined(__OpenBSD__)
80+ if (apm.battery_state == APM_BATT_ABSENT) 80+ if (apm.battery_state == APM_BATT_ABSENT)
81+ g_snprintf(buffer, sizeof(buffer),"--%% "); 81+ g_snprintf(buffer, sizeof(buffer),"--%% ");
82+ else 82+ else
83+#endif 83+#endif
84 g_snprintf(buffer, sizeof(buffer),"%d%% ", charge); 84 g_snprintf(buffer, sizeof(buffer),"%d%% ", charge);
85 gtk_label_set_text(battmon->charge,buffer); 85 gtk_label_set_text(battmon->charge,buffer);
86 } else { 86 } else {
87@@ -477,6 +492,11 @@ 87@@ -481,6 +496,11 @@
88 } 88 }
89  89
90 gtk_widget_show((GtkWidget *)active_label); 90 gtk_widget_show((GtkWidget *)active_label);
91+#if defined(__NetBSD__) 91+#if defined(__NetBSD__)
92+ if (acline || time_remaining == _ACPI_APM_BATT_UNKNOWN) 92+ if (acline || time_remaining == _ACPI_APM_BATT_UNKNOWN)
93+ g_snprintf(buffer, sizeof(buffer), "--:--"); 93+ g_snprintf(buffer, sizeof(buffer), "--:--");
94+ else 94+ else
95+#endif 95+#endif
96 g_snprintf(buffer, sizeof(buffer),"%02d:%02d ",time_remaining/60,time_remaining%60); 96 g_snprintf(buffer, sizeof(buffer),"%02d:%02d ",time_remaining/60,time_remaining%60);
97 gtk_label_set_text(active_label,buffer); 97 gtk_label_set_text(active_label,buffer);
98  98