pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/sysutils/xbattbar PR/37442 - Jared D. McNeill -- xbatt...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/ec65246b965d
branches:  trunk
changeset: 535786:ec65246b965d
user:      jnemeth <jnemeth%pkgsrc.org@localhost>
date:      Wed Nov 28 22:33:17 2007 +0000

description:
PR/37442 - Jared D. McNeill -- xbattbar does not work on machines that have APM

diffstat:

 sysutils/xbattbar/Makefile         |   8 +++++---
 sysutils/xbattbar/distinfo         |   4 ++--
 sysutils/xbattbar/patches/patch-ab |  31 ++++++++++++++++++++++++-------
 3 files changed, 31 insertions(+), 12 deletions(-)

diffs (127 lines):

diff -r 9b11a4993d74 -r ec65246b965d sysutils/xbattbar/Makefile
--- a/sysutils/xbattbar/Makefile        Wed Nov 28 21:59:36 2007 +0000
+++ b/sysutils/xbattbar/Makefile        Wed Nov 28 22:33:17 2007 +0000
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.30 2007/07/25 15:09:32 xtraeme Exp $
+# $NetBSD: Makefile,v 1.31 2007/11/28 22:33:17 jnemeth Exp $
 
 DISTNAME=      xbattbar_1.4.2
 PKGNAME=       ${DISTNAME:S/_/-/}
-PKGREVISION=   7
+PKGREVISION=   8
 CATEGORIES=    sysutils x11
 MASTER_SITES=  http://iplab.aist-nara.ac.jp/member/suguru/
 
@@ -10,12 +10,14 @@
 HOMEPAGE=      http://iplab.aist-nara.ac.jp/member/suguru/xbattbar.html
 COMMENT=       X11 battery graph for laptops
 
+PKG_DESTDIR_SUPPORT=   user-destdir
+
 WRKSRC=                ${WRKDIR}/${DISTNAME:S/_/-/}
 
 USE_IMAKE=     yes
 
 .if !exists(/usr/include/machine/apmvar.h)
-PKG_SKIP_REASON+=      "APM is not available for ${MACHINE_PLATFORM}"
+CPPFLAGS+=     -D_NO_APM
 .endif
 
 .include "../../x11/libX11/buildlink3.mk"
diff -r 9b11a4993d74 -r ec65246b965d sysutils/xbattbar/distinfo
--- a/sysutils/xbattbar/distinfo        Wed Nov 28 21:59:36 2007 +0000
+++ b/sysutils/xbattbar/distinfo        Wed Nov 28 22:33:17 2007 +0000
@@ -1,8 +1,8 @@
-$NetBSD: distinfo,v 1.12 2007/07/25 15:09:32 xtraeme Exp $
+$NetBSD: distinfo,v 1.13 2007/11/28 22:33:17 jnemeth Exp $
 
 SHA1 (xbattbar_1.4.2.tar.gz) = 14e9aafd62919e4a625d3f84df3b074b9eef8279
 RMD160 (xbattbar_1.4.2.tar.gz) = f28a273a1865a0919e32144bbb5b16b3c0340061
 Size (xbattbar_1.4.2.tar.gz) = 14079 bytes
 SHA1 (patch-aa) = 3bd4b688ccaeebe766335245c1a8c5dde52768c2
-SHA1 (patch-ab) = b3115d01555e62c0229350213b003d9f2d554968
+SHA1 (patch-ab) = f9ad127d4d3f9c4d5c6c01b9d476f74faf665fdb
 SHA1 (patch-ac) = 507cdf9b4e79dc577d020963142e262d04536527
diff -r 9b11a4993d74 -r ec65246b965d sysutils/xbattbar/patches/patch-ab
--- a/sysutils/xbattbar/patches/patch-ab        Wed Nov 28 21:59:36 2007 +0000
+++ b/sysutils/xbattbar/patches/patch-ab        Wed Nov 28 22:33:17 2007 +0000
@@ -1,7 +1,7 @@
-$NetBSD: patch-ab,v 1.7 2007/07/25 15:09:32 xtraeme Exp $
+$NetBSD: patch-ab,v 1.8 2007/11/28 22:33:18 jnemeth Exp $
 
---- xbattbar.c.orig    2001-02-02 06:25:29.000000000 +0100
-+++ xbattbar.c 2007-07-25 17:03:43.000000000 +0200
+--- xbattbar.c.orig    2001-02-02 00:25:29.000000000 -0500
++++ xbattbar.c 2007-11-27 20:56:25.000000000 -0500
 @@ -27,6 +27,14 @@
  
  #include <sys/types.h>
@@ -17,7 +17,18 @@
  #include <signal.h>
  #include <stdio.h>
  #include <unistd.h>
-@@ -583,27 +591,161 @@
+@@ -577,33 +585,177 @@
+ 
+ #ifdef __NetBSD__
+ 
++#ifndef _NO_APM
+ #include <machine/apmvar.h>
++#else
++#define APM_AC_OFF    0x00
++#define APM_AC_ON     0x01
++#endif
+ 
+ #define _PATH_APM_SOCKET       "/var/run/apmdev"
  #define _PATH_APM_CTLDEV       "/dev/apmctl"
  #define _PATH_APM_NORMAL       "/dev/apm"
  
@@ -88,7 +99,9 @@
  void battery_check(void)
  {
         int fd, r, p;
++#ifndef _NO_APM
         struct apm_power_info info;
++#endif
 +       int acpi;
 +       size_t ns;
 +       size_t cc;
@@ -128,15 +141,17 @@
 +              }
 +
 +              fillsensors(fd, etds, ebis, ns);
- 
++
 +#endif
++#ifndef _NO_APM
 +       } else {
-+
+ 
 +             memset(&info, 0, sizeof(info));
         if (ioctl(fd, APM_IOC_GETPOWER, &info) != 0) {
                 fprintf(stderr, "xbattbar: ioctl APM_IOC_GETPOWER failed\n");
                 exit(1);
         }
++#endif
 +       }
  
         close(fd);
@@ -177,15 +192,17 @@
 +              }
 +              r = (rtot * 100.0) / maxtot;
 +#endif
++#ifndef _NO_APM
 +       } else {
 +             /* get current remain */
         if (info.battery_life > 100) {
                 /* some APM BIOSes return values slightly > 100 */
                 r = 100;
-@@ -617,6 +759,7 @@
+@@ -617,6 +769,8 @@
         } else {
                 p = APM_AC_OFF;
         }
++#endif
 +       }
  
         if (first || ac_line != p || battery_level != r) {



Home | Main Index | Thread Index | Old Index