diff options
author | Rene Ladan <rene@FreeBSD.org> | 2019-10-16 15:29:32 +0000 |
---|---|---|
committer | Rene Ladan <rene@FreeBSD.org> | 2019-10-16 15:29:32 +0000 |
commit | 13d4527a34237c3848445140a659128518ca196f (patch) | |
tree | a59de3287464c291f091b739fe407ba6df10c951 /sysutils/xbattbar | |
parent | a12065703469e10f4f34b1e43555af92cfceaa6c (diff) | |
download | ports-13d4527a34237c3848445140a659128518ca196f.tar.gz ports-13d4527a34237c3848445140a659128518ca196f.zip |
Notes
Diffstat (limited to 'sysutils/xbattbar')
-rw-r--r-- | sysutils/xbattbar/Makefile | 27 | ||||
-rw-r--r-- | sysutils/xbattbar/distinfo | 2 | ||||
-rw-r--r-- | sysutils/xbattbar/files/patch-Imakefile | 12 | ||||
-rw-r--r-- | sysutils/xbattbar/files/patch-xbattbar.c | 149 | ||||
-rw-r--r-- | sysutils/xbattbar/files/patch-xbattbar.man | 11 | ||||
-rw-r--r-- | sysutils/xbattbar/pkg-descr | 7 |
6 files changed, 0 insertions, 208 deletions
diff --git a/sysutils/xbattbar/Makefile b/sysutils/xbattbar/Makefile deleted file mode 100644 index a81adb9dbef6..000000000000 --- a/sysutils/xbattbar/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -# Created by: sumikawa -# $FreeBSD$ - -PORTNAME= xbattbar -PORTVERSION= 1.4.2 -PORTREVISION= 7 -CATEGORIES= sysutils -MASTER_SITES= http://iplab.aist-nara.ac.jp/member/suguru/ -DISTNAME= ${PORTNAME}_${PORTVERSION} - -MAINTAINER= ports@FreeBSD.org -COMMENT= Simple battery meter - -LICENSE= GPLv2+ -LICENSE_FILE= ${WRKSRC}/COPYING - -BROKEN= unfetchable -DEPRECATED= Unfetchable, unmaintained -EXPIRATION_DATE= 2019-10-16 - -USES= imake -USE_XORG= x11 xext -WRKSRC= ${WRKDIR}/xbattbar-${PORTVERSION} -PLIST_FILES= bin/xbattbar \ - man/man1/xbattbar.1.gz - -.include <bsd.port.mk> diff --git a/sysutils/xbattbar/distinfo b/sysutils/xbattbar/distinfo deleted file mode 100644 index 3fed8893cfd3..000000000000 --- a/sysutils/xbattbar/distinfo +++ /dev/null @@ -1,2 +0,0 @@ -SHA256 (xbattbar_1.4.2.tar.gz) = 55a5ed609282398f55e0141e473f9f04300d1ad3070810c7c6930f6c45970b4a -SIZE (xbattbar_1.4.2.tar.gz) = 14079 diff --git a/sysutils/xbattbar/files/patch-Imakefile b/sysutils/xbattbar/files/patch-Imakefile deleted file mode 100644 index 1db9be1cb6ce..000000000000 --- a/sysutils/xbattbar/files/patch-Imakefile +++ /dev/null @@ -1,12 +0,0 @@ ---- Imakefile- Fri Oct 16 02:14:52 1998 -+++ Imakefile Fri Oct 16 02:15:41 1998 -@@ -4,9 +4,6 @@ - XCOMM All rights reserved. - XCOMM - --BINDIR = /usr/local/bin --MANDIR = /usr/local/man/cat1 -- - LOCAL_LIBRARIES = $(XLIB) - - SRCS = xbattbar.c diff --git a/sysutils/xbattbar/files/patch-xbattbar.c b/sysutils/xbattbar/files/patch-xbattbar.c deleted file mode 100644 index 65d3eaa7b1f8..000000000000 --- a/sysutils/xbattbar/files/patch-xbattbar.c +++ /dev/null @@ -1,149 +0,0 @@ ---- xbattbar.c.orig 2001-02-02 06:25:29.000000000 +0100 -+++ xbattbar.c 2012-04-04 17:47:34.000000000 +0200 -@@ -29,6 +29,8 @@ static char *ReleaseVersion="1.4.2"; - #include <sys/time.h> - #include <signal.h> - #include <stdio.h> -+#include <stdlib.h> -+#include <string.h> - #include <unistd.h> - #include <sys/file.h> - #include <sys/ioctl.h> -@@ -501,6 +503,10 @@ void battery_check(void) - - #ifdef __FreeBSD__ - -+#include <sys/types.h> -+#include <sys/sysctl.h> -+ -+#if defined(__i386__) - #include <machine/apm_bios.h> - - #define APMDEV21 "/dev/apm0" -@@ -515,54 +521,90 @@ void battery_check(void) - #define APM_STAT_BATT_LOW 1 - #define APM_STAT_BATT_CRITICAL 2 - #define APM_STAT_BATT_CHARGING 3 -+#endif /* i386 */ - - int first = 1; - void battery_check(void) - { -- int fd, r, p; -- struct apm_info info; -+ int r, p; -+ static int sysctl = 1; - -- if ((fd = open(APMDEV21, O_RDWR)) == -1 && -- (fd = open(APMDEV22, O_RDWR)) == -1) { -- fprintf(stderr, "xbattbar: cannot open apm device\n"); -- exit(1); -- } -- if (ioctl(fd, APMIO_GETINFO, &info) == -1) { -- fprintf(stderr, "xbattbar: ioctl APMIO_GETINFO failed\n"); -- exit(1); -+ if (sysctl) { -+ size_t r_size, p_size; -+ -+ /* get current status */ -+ r_size = sizeof(r); -+ if (sysctl && sysctlbyname("hw.acpi.battery.life", &r, &r_size, NULL, 0) == -1) { -+#if defined(__i386__) -+ fprintf(stderr, "xbattbar: fall back to apm interface\n"); -+ sysctl = 0; -+#else /* !i386 */ -+ fprintf(stderr, "xbattbar: can not get battery status\n"); -+ exit(1); -+#endif /* i386 */ -+ } -+ -+ /* get AC-line status */ -+ p_size = sizeof(p); -+ if (sysctl && sysctlbyname("hw.acpi.acline", &p, &p_size, NULL, 0) == -1) { -+#if defined(__i386__) -+ fprintf(stderr, "xbattbar: fall back to apm interface\n"); -+ sysctl = 0; -+#else /* !i386 */ -+ fprintf(stderr, "xbattbar: can not get AC-line status\n"); -+ exit(1); -+#endif /* i386 */ -+ } - } -- close (fd); - -- ++elapsed_time; -+#if defined(__i386__) -+ if (!sysctl) { -+ int fd; -+ struct apm_info info; -+ -+ if ((fd = open(APMDEV21, O_RDONLY)) == -1 && -+ (fd = open(APMDEV22, O_RDONLY)) == -1) { -+ fprintf(stderr, "xbattbar: cannot open apm device\n"); -+ exit(1); -+ } -+ if (ioctl(fd, APMIO_GETINFO, &info) == -1) { -+ fprintf(stderr, "xbattbar: ioctl APMIO_GETINFO failed\n"); -+ exit(1); -+ } -+ close (fd); - -- /* get current status */ -- if (info.ai_batt_life == APM_STAT_UNKNOWN) { -- switch (info.ai_batt_stat) { -- case APM_STAT_BATT_HIGH: -- r = 100; -- break; -- case APM_STAT_BATT_LOW: -- r = 40; -- break; -- case APM_STAT_BATT_CRITICAL: -- r = 10; -- break; -- default: /* expected to be APM_STAT_UNKNOWN */ -+ /* get current status */ -+ if (info.ai_batt_life == APM_STAT_UNKNOWN) { -+ switch (info.ai_batt_stat) { -+ case APM_STAT_BATT_HIGH: -+ r = 100; -+ break; -+ case APM_STAT_BATT_LOW: -+ r = 40; -+ break; -+ case APM_STAT_BATT_CRITICAL: -+ r = 10; -+ break; -+ default: /* expected to be APM_STAT_UNKNOWN */ -+ r = 100; -+ } -+ } else if (info.ai_batt_life > 100) { -+ /* some APM BIOSes return values slightly > 100 */ - r = 100; -+ } else { -+ r = info.ai_batt_life; - } -- } else if (info.ai_batt_life > 100) { -- /* some APM BIOSes return values slightly > 100 */ -- r = 100; -- } else { -- r = info.ai_batt_life; -- } - -- /* get AC-line status */ -- if (info.ai_acline == APM_STAT_LINE_ON) { -- p = APM_STAT_LINE_ON; -- } else { -- p = APM_STAT_LINE_OFF; -+ /* get AC-line status */ -+ if (info.ai_acline == APM_STAT_LINE_ON) { -+ p = APM_STAT_LINE_ON; -+ } else { -+ p = APM_STAT_LINE_OFF; -+ } - } -+#endif /* i386 */ -+ -+ ++elapsed_time; - - if (first || ac_line != p || battery_level != r) { - first = 0; diff --git a/sysutils/xbattbar/files/patch-xbattbar.man b/sysutils/xbattbar/files/patch-xbattbar.man deleted file mode 100644 index dfc205599164..000000000000 --- a/sysutils/xbattbar/files/patch-xbattbar.man +++ /dev/null @@ -1,11 +0,0 @@ ---- xbattbar.man.orig 2012-04-04 17:49:01.000000000 +0200 -+++ xbattbar.man 2012-04-04 17:49:17.000000000 +0200 -@@ -58,7 +58,7 @@ forces the status indicator to be at the - display, - respectively. - Though it's a default, you can also use --.Nm buttom -+.Nm bottom - as the option. - .Pp - In the case the AC line is on-line (plugged in), diff --git a/sysutils/xbattbar/pkg-descr b/sysutils/xbattbar/pkg-descr deleted file mode 100644 index 18ba1422710b..000000000000 --- a/sysutils/xbattbar/pkg-descr +++ /dev/null @@ -1,7 +0,0 @@ -Xbattbar shows the current (laptop) battery status in the X window -environment. The battery indicator of this program is very simple: a simple -bar in the bottom of your display. With its color, it indicates the -AC-line status (plugged in or off-line), and battery -charging/remaining level. - -WWW: http://iplab.aist-nara.ac.jp/member/suguru/xbattbar.html |