From 3469be41a1f51feca77f076f9c20d4079838df19 Mon Sep 17 00:00:00 2001 From: jnemeth Date: Wed, 28 Nov 2007 22:33:17 +0000 Subject: PR/37442 - Jared D. McNeill -- xbattbar does not work on machines that have APM --- sysutils/xbattbar/Makefile | 8 +++++--- sysutils/xbattbar/distinfo | 4 ++-- sysutils/xbattbar/patches/patch-ab | 31 ++++++++++++++++++++++++------- 3 files changed, 31 insertions(+), 12 deletions(-) (limited to 'sysutils/xbattbar') diff --git a/sysutils/xbattbar/Makefile b/sysutils/xbattbar/Makefile index f49e481be52..e78b8af68f8 100644 --- a/sysutils/xbattbar/Makefile +++ b/sysutils/xbattbar/Makefile @@ -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 @@ MAINTAINER= pkgsrc-users@NetBSD.org 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 --git a/sysutils/xbattbar/distinfo b/sysutils/xbattbar/distinfo index 5676c4e5487..5864d16946f 100644 --- a/sysutils/xbattbar/distinfo +++ b/sysutils/xbattbar/distinfo @@ -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 --git a/sysutils/xbattbar/patches/patch-ab b/sysutils/xbattbar/patches/patch-ab index c6e74155e3a..e028534381b 100644 --- a/sysutils/xbattbar/patches/patch-ab +++ b/sysutils/xbattbar/patches/patch-ab @@ -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 @@ -17,7 +17,18 @@ $NetBSD: patch-ab,v 1.7 2007/07/25 15:09:32 xtraeme Exp $ #include #include #include -@@ -583,27 +591,161 @@ +@@ -577,33 +585,177 @@ + + #ifdef __NetBSD__ + ++#ifndef _NO_APM + #include ++#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 @@ $NetBSD: patch-ab,v 1.7 2007/07/25 15:09:32 xtraeme Exp $ 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 @@ $NetBSD: patch-ab,v 1.7 2007/07/25 15:09:32 xtraeme Exp $ + } + + 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 @@ $NetBSD: patch-ab,v 1.7 2007/07/25 15:09:32 xtraeme Exp $ + } + 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) { -- cgit v1.2.3