pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/sysutils/asapm Fixed to work in NetBSD 1.6.* also. Tes...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/e884f2be763f
branches:  trunk
changeset: 477346:e884f2be763f
user:      kivinen <kivinen%pkgsrc.org@localhost>
date:      Wed Jun 30 14:22:48 2004 +0000

description:
Fixed to work in NetBSD 1.6.* also. Tested on NetBSD 2.0 BETA
        and NetBSD 1.6. Updated PKGREVISION and DESCR and MESSAGE
        texts.

diffstat:

 sysutils/asapm/DESCR            |   6 ++++--
 sysutils/asapm/MESSAGE          |   6 +++++-
 sysutils/asapm/Makefile         |   4 ++--
 sysutils/asapm/distinfo         |   6 +++---
 sysutils/asapm/patches/patch-ad |   8 ++++++--
 sysutils/asapm/patches/patch-af |  38 +++++++++++++++++++++++++++++---------
 6 files changed, 49 insertions(+), 19 deletions(-)

diffs (187 lines):

diff -r 182698b4808e -r e884f2be763f sysutils/asapm/DESCR
--- a/sysutils/asapm/DESCR      Wed Jun 30 13:48:55 2004 +0000
+++ b/sysutils/asapm/DESCR      Wed Jun 30 14:22:48 2004 +0000
@@ -1,5 +1,7 @@
 'asapm' is an X11 client which displays a battery status of your
-notebook computer equiped with APM (Advanced Power Management) BIOS.
+notebook computer equiped with APM (Advanced Power Management) BIOS
+or ACPI (Advanced Configuration and Power Interface).
 The status displayed consists remaining battery life, an AC line
 status, a charging status and a digital readout with (a) Percent
-battery remaining and (b) estimated time to dead.
+battery remaining and (b) estimated time to dead. If using ACPI this
+version can also show the time left to recharge the battery.
diff -r 182698b4808e -r e884f2be763f sysutils/asapm/MESSAGE
--- a/sysutils/asapm/MESSAGE    Wed Jun 30 13:48:55 2004 +0000
+++ b/sysutils/asapm/MESSAGE    Wed Jun 30 14:22:48 2004 +0000
@@ -1,7 +1,11 @@
 ===========================================================================
-$NetBSD: MESSAGE,v 1.1 2001/10/31 22:52:53 zuntum Exp $
+$NetBSD: MESSAGE,v 1.2 2004/06/30 14:22:49 kivinen Exp $
 
 This package requires that the APM driver be enabled in your kernel.
 See apm(4) for details.
 
+This package has also special NetBSD modifications to work also with the
+sysmon interface, which allows it also work with the ACPI driver if
+installed in the kernel. 
+
 ===========================================================================
diff -r 182698b4808e -r e884f2be763f sysutils/asapm/Makefile
--- a/sysutils/asapm/Makefile   Wed Jun 30 13:48:55 2004 +0000
+++ b/sysutils/asapm/Makefile   Wed Jun 30 14:22:48 2004 +0000
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.27 2004/06/09 21:00:05 kivinen Exp $
+# $NetBSD: Makefile,v 1.28 2004/06/30 14:22:49 kivinen Exp $
 #
 
 DISTNAME=              asapm-2.11
 CATEGORIES=            sysutils x11
-PKGREVISION=           1
+PKGREVISION=           2
 MASTER_SITES=          http://www.tigr.net/afterstep/download/asapm/ \
                        ftp://ftp.afterstep.org/apps/asapm/ \
                        ftp://fuf.sh.cvut.cz/pub/AfterStep/apps/asapm/
diff -r 182698b4808e -r e884f2be763f sysutils/asapm/distinfo
--- a/sysutils/asapm/distinfo   Wed Jun 30 13:48:55 2004 +0000
+++ b/sysutils/asapm/distinfo   Wed Jun 30 14:22:48 2004 +0000
@@ -1,10 +1,10 @@
-$NetBSD: distinfo,v 1.7 2004/06/09 22:22:09 kivinen Exp $
+$NetBSD: distinfo,v 1.8 2004/06/30 14:22:49 kivinen Exp $
 
 SHA1 (asapm-2.11.tar.gz) = cd89c5557d76dbb19ee565435b533ab48f05f102
 Size (asapm-2.11.tar.gz) = 58729 bytes
 SHA1 (patch-aa) = 570d2240f6afbf78d3cd72e1c1b963beb7ae074d
 SHA1 (patch-ab) = 8796f1f6220ecdbd23d360bb18f721e1ef83febf
 SHA1 (patch-ac) = edfe7deae628b9e2aa57b67666f4e7dea13c19bf
-SHA1 (patch-ad) = f6a82aa2cff611f03e999a0773f8b47156b9550f
+SHA1 (patch-ad) = 4b6bf84a4cf1881ef0c4e97fbe64201e3437aba1
 SHA1 (patch-ae) = 28b0e4c446c466a90d4a2ae0952b2326385a8c6c
-SHA1 (patch-af) = 74a344768c237505c3bd63d757fd6aeac8b46f2a
+SHA1 (patch-af) = 8ae72f1cb8eb6e2d449f37dd186b0bae362c6a13
diff -r 182698b4808e -r e884f2be763f sysutils/asapm/patches/patch-ad
--- a/sysutils/asapm/patches/patch-ad   Wed Jun 30 13:48:55 2004 +0000
+++ b/sysutils/asapm/patches/patch-ad   Wed Jun 30 14:22:48 2004 +0000
@@ -1,13 +1,17 @@
-$NetBSD: patch-ad,v 1.1 2004/06/09 21:00:05 kivinen Exp $
+$NetBSD: patch-ad,v 1.2 2004/06/30 14:22:49 kivinen Exp $
 
 --- state.h.orig       1999-03-09 12:35:24.000000000 +0200
 +++ state.h
-@@ -13,6 +13,8 @@
+@@ -13,6 +13,12 @@
  /* file -> APM device */
  #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
  #define APM_PROC "/dev/apm"
 +#include <paths.h>
++#ifdef _PATH_SYSMON
 +#define SYSMON_DEV _PATH_SYSMON
++#else
++#define SYSMON_DEV "/dev/sysmon"
++#endif
  #else
  #define APM_PROC "/proc/apm"
  #endif
diff -r 182698b4808e -r e884f2be763f sysutils/asapm/patches/patch-af
--- a/sysutils/asapm/patches/patch-af   Wed Jun 30 13:48:55 2004 +0000
+++ b/sysutils/asapm/patches/patch-af   Wed Jun 30 14:22:48 2004 +0000
@@ -1,4 +1,4 @@
-$NetBSD: patch-af,v 1.3 2004/06/09 22:22:09 kivinen Exp $
+$NetBSD: patch-af,v 1.4 2004/06/30 14:22:49 kivinen Exp $
 
 --- apm_read.c.orig    2001-11-23 23:07:19.000000000 +0200
 +++ apm_read.c
@@ -10,13 +10,21 @@
  
  #include "state.h"
  extern struct apm_state state;
-@@ -136,18 +137,163 @@ void ReadAPMDevice( )           /* FreeBSD versio
+@@ -136,18 +137,183 @@ void ReadAPMDevice( )           /* FreeBSD versio
        state.time_left = info.ai_batt_time / 60;
  }
  #elif defined(__NetBSD__)||defined(__OpenBSD__)
 +
 +#include <sys/envsys.h>
 +
++/* We cannot use ifdef ENVSYS_SWATTHOUR etc as it is enum. The
++   ENVSYS_FFRACVALID was added at the same time as WATTHOUR and INDICATOR, so
++   we use it to see if we have the support for those. */
++#ifdef ENVSYS_FFRACVALID
++#define HAVE_ENVSYS_SWATTHOUR
++#define HAVE_ENVSYS_INDICATOR
++#endif /* ENVSYS_FFRACVALID */
++
 +int match_end(const char *str, const char *end_part)
 +{
 +      int len1, len2;
@@ -33,7 +41,7 @@
 +      int count = 0;
 +        envsys_basic_info_t ebis;
 +      envsys_tre_data_t etds;
-+      int32_t design, charge, warn_cap, low_cap, rate;
++      int32_t design, charge, warn_cap, low_cap, discharge_rate, charge_rate;
 +      int connected, charging, percent, time_units, battery_status;
 +
 +      if ((fd = open(sysmon_device_file, O_RDONLY)) == -1) {
@@ -45,7 +53,8 @@
 +      charge = 0;
 +      warn_cap = 0;
 +      low_cap = 0;
-+      rate = 0;
++      charge_rate = 0;
++      discharge_rate = 0;
 +      connected = 0;
 +      charging = 0;
 +      percent = 0;
@@ -74,6 +83,7 @@
 +              if (!(etds.validflags & ENVSYS_FCURVALID))
 +                      continue;
 +
++#ifdef HAVE_ENVSYS_SWATTHOUR
 +              if (etds.units == ENVSYS_SWATTHOUR) {
 +                      /* Watt hours, this must be battery capacity info. */
 +                      if (match_end(ebis.desc, " design cap")) {
@@ -85,7 +95,10 @@
 +                      } else if (match_end(ebis.desc, " low cap")) {
 +                              low_cap += etds.cur.data_s;
 +                      }
-+              } else if (etds.units == ENVSYS_INDICATOR) {
++              }
++#endif /* HAVE_ENVSYS_SWATTHOUR */
++#ifdef HAVE_ENVSYS_INDICATOR
++              if (etds.units == ENVSYS_INDICATOR) {
 +                      /* Indicator of something, check for connected. */
 +                      if (match_end(ebis.desc, " connected")) {
 +                              connected = etds.cur.data_us;
@@ -93,11 +106,16 @@
 +                              charging = etds.cur.data_us;
 +                      }
 +
-+              } else if (etds.units == ENVSYS_SWATTS) {
++              }
++#endif /* HAVE_ENVSYS_INDICATOR */
++              if (etds.units == ENVSYS_SWATTS) {
 +                      /* Watts, this must discharge rate. */
 +                      if (match_end(ebis.desc, " discharge rate")) {
-+                              rate += etds.cur.data_s;
++                              discharge_rate += etds.cur.data_s;
++                      } else if (match_end(ebis.desc, " charge rate")) {
++                              charge_rate += etds.cur.data_s;
 +                      }
++
 +              }
 +      }
 +
@@ -144,8 +162,10 @@
 +              ++state.update;
 +      }
 +
-+      if (rate > 0) {
-+              time_units = charge / (rate / 60);
++      if (discharge_rate > 0) {
++              time_units = charge / (discharge_rate / 60);
++      } else if (charge_rate > 0 && design > 0 && charging) {
++              time_units = (design - charge) / (charge_rate / 60);
 +      }
 +
 +      /* we can display maximum 99:59 */



Home | Main Index | Thread Index | Old Index