- update to 2.5
This commit is contained in:
parent
64bd2d9a22
commit
c23cfb031c
@ -1,14 +1,13 @@
|
||||
# $OpenBSD: Makefile,v 1.1.1.1 2012/05/02 07:37:10 jasper Exp $
|
||||
# $OpenBSD: Makefile,v 1.2 2012/05/03 20:27:26 jasper Exp $
|
||||
|
||||
ONLY_FOR_ARCHS= ${APM_ARCHS}
|
||||
|
||||
COMMENT= generate a statusbar for use with i3/xmobar/dzen2
|
||||
|
||||
# git snapshot as of 2011-04-08
|
||||
DISTNAME= i3status-2.4.0.1
|
||||
DISTNAME= i3status-2.5
|
||||
CATEGORIES= x11 sysutils
|
||||
|
||||
HOMEPAGE= http://i3wm.org/i3status
|
||||
HOMEPAGE= http://i3wm.org/i3status/
|
||||
|
||||
MAINTAINER= Jasper Lievisse Adriaanse <jasper@openbsd.org>
|
||||
|
||||
@ -18,7 +17,8 @@ PERMIT_PACKAGE_FTP= Yes
|
||||
PERMIT_DISTFILES_CDROM= Yes
|
||||
PERMIT_DISTFILES_FTP= Yes
|
||||
|
||||
MASTER_SITES= http://distfiles.nl/
|
||||
MASTER_SITES= ${HOMEPAGE}
|
||||
EXTRACT_SUFX= .tar.bz2
|
||||
|
||||
WANTLIB += c confuse ossaudio yajl
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
MD5 (i3status-2.4.0.1.tar.gz) = dn3Y+jngxZzCAXvmeav8PQ==
|
||||
RMD160 (i3status-2.4.0.1.tar.gz) = u8Pi8Gg0Si4O9WZtGm33nuxlxXY=
|
||||
SHA1 (i3status-2.4.0.1.tar.gz) = e6GfJ0+L8vTahqTsprRLoNRuxW4=
|
||||
SHA256 (i3status-2.4.0.1.tar.gz) = bDg0NfgTQMy7szMX052P19LQ12utUj+f//O0mAOI3TI=
|
||||
SIZE (i3status-2.4.0.1.tar.gz) = 33379
|
||||
MD5 (i3status-2.5.tar.bz2) = bDwdkfrh3JOaUXvDuFP2Xw==
|
||||
RMD160 (i3status-2.5.tar.bz2) = x2SbNjX7w5caycobPOyDoV4EJ2E=
|
||||
SHA1 (i3status-2.5.tar.bz2) = bHHiwH1To2s45V1agcc1rN5YCiA=
|
||||
SHA256 (i3status-2.5.tar.bz2) = gxBpRRJQdstfkXukUlvdmRdbxbA5am8OR7ZiOiVMCu4=
|
||||
SIZE (i3status-2.5.tar.bz2) = 30540
|
||||
|
@ -1,41 +1,21 @@
|
||||
$OpenBSD: patch-Makefile,v 1.1.1.1 2012/05/02 07:37:10 jasper Exp $
|
||||
$OpenBSD: patch-Makefile,v 1.2 2012/05/03 20:27:26 jasper Exp $
|
||||
|
||||
- Remove git dependency.
|
||||
- Add some extra paths if we're compiling on OpenBSD (committed upstream).
|
||||
- Print volume on OpenBSD and add missing library accordingly (committed upstream).
|
||||
- Don't do a silent build.
|
||||
|
||||
--- Makefile.orig Fri Apr 27 16:00:41 2012
|
||||
+++ Makefile Mon Apr 30 16:31:08 2012
|
||||
@@ -14,12 +14,12 @@ CFLAGS+=-g
|
||||
CFLAGS+=-std=gnu99
|
||||
CFLAGS+=-pedantic
|
||||
CPPFLAGS+=-DSYSCONFDIR=\"$(SYSCONFDIR)\"
|
||||
-CPPFLAGS+=-DVERSION=\"${GIT_VERSION}\"
|
||||
+CPPFLAGS+=-DVERSION=\"${VERSION}\"
|
||||
CFLAGS+=-Iinclude
|
||||
LIBS+=-lconfuse
|
||||
LIBS+=-lyajl
|
||||
|
||||
-VERSION:=$(shell git describe --tags --abbrev=0)
|
||||
+VERSION="2.4.0.1"
|
||||
GIT_VERSION:="$(shell git describe --tags --always) ($(shell git log --pretty=format:%cd --date=short -n1))"
|
||||
|
||||
ifeq ($(shell uname),Linux)
|
||||
@@ -33,6 +33,12 @@ ifeq ($(shell uname),GNU/kFreeBSD)
|
||||
LIBS+=-lbsd
|
||||
--- Makefile.orig Thu May 3 22:22:19 2012
|
||||
+++ Makefile Thu May 3 22:23:05 2012
|
||||
@@ -34,8 +34,8 @@ LIBS+=-lbsd
|
||||
endif
|
||||
|
||||
+ifeq ($(shell uname),OpenBSD)
|
||||
ifeq ($(shell uname),OpenBSD)
|
||||
-CFLAGS+=-I/usr/local/include/
|
||||
-LDFLAGS+=-L/usr/local/lib/
|
||||
+CFLAGS+=-I${LOCALBASE}/include/
|
||||
+LDFLAGS+=-L${LOCALBASE}/lib/
|
||||
+LIBS+=-lossaudio
|
||||
+endif
|
||||
+
|
||||
CFLAGS+=$(EXTRA_CFLAGS)
|
||||
LIBS+=-lossaudio
|
||||
endif
|
||||
|
||||
# Fallback for libyajl 1 which did not include yajl_version.h. We need
|
||||
@@ -43,17 +49,17 @@ OBJS:=$(wildcard src/*.c *.c)
|
||||
@@ -49,17 +49,17 @@ OBJS:=$(wildcard src/*.c *.c)
|
||||
OBJS:=$(OBJS:.c=.o)
|
||||
|
||||
src/%.o: src/%.c
|
||||
|
@ -1,22 +0,0 @@
|
||||
$OpenBSD: patch-include_i3status_h,v 1.1.1.1 2012/05/02 07:37:10 jasper Exp $
|
||||
|
||||
Implement basic fetching of cpu temperature on OpenBSD (committed upstream).
|
||||
|
||||
--- include/i3status.h.orig Sun Apr 29 16:55:04 2012
|
||||
+++ include/i3status.h Sun Apr 29 16:55:09 2012
|
||||
@@ -26,6 +26,15 @@ enum { O_DZEN2, O_XMOBAR, O_I3BAR, O_NONE } output_for
|
||||
#define BATT_TIME "hw.acpi.battery.time"
|
||||
#define BATT_STATE "hw.acpi.battery.state"
|
||||
|
||||
+#elif defined(__OpenBSD__)
|
||||
+/*
|
||||
+ * Due to the fact there are various ways to obtain a temperature reading, THERMAL_ZONE will need
|
||||
+ * to be adjustable enough for those situations. As it can either be hw.sensors.cpu%d.temp0, or
|
||||
+ * hw.sensors.acpitz%d.temp0 or even something different entirely within hw.sensors.%s.temp0.
|
||||
+ * XXX: For now just check cpu%d.temp0. Adjust this later.
|
||||
+ */
|
||||
+#define THERMAL_ZONE "cpu%d"
|
||||
+
|
||||
#endif
|
||||
|
||||
#if defined(__FreeBSD_kernel__) && defined(__GLIBC__)
|
@ -1,17 +0,0 @@
|
||||
$OpenBSD: patch-man_Makefile,v 1.1.1.1 2012/05/02 07:37:10 jasper Exp $
|
||||
|
||||
Allow overriding of a2x in the environment; as it may also be installed as a2x.py (committed upstream).
|
||||
|
||||
|
||||
--- man/Makefile.orig Fri Apr 27 16:00:41 2012
|
||||
+++ man/Makefile Sun Apr 29 15:03:11 2012
|
||||
@@ -1,6 +1,8 @@
|
||||
all: i3status.1
|
||||
|
||||
+A2X?=a2x
|
||||
+
|
||||
i3status.1: asciidoc.conf i3status.man
|
||||
- a2x -f manpage --asciidoc-opts="-f asciidoc.conf" i3status.man
|
||||
+ ${A2X} -f manpage --asciidoc-opts="-f asciidoc.conf" i3status.man
|
||||
clean:
|
||||
rm -f i3status.xml i3status.1 i3status.html
|
@ -1,78 +0,0 @@
|
||||
$OpenBSD: patch-src_print_battery_info_c,v 1.1.1.1 2012/05/02 07:37:10 jasper Exp $
|
||||
|
||||
Implement displaying battery status on OpenBSD (committed upstream).
|
||||
|
||||
--- src/print_battery_info.c.orig Sun Apr 29 20:22:33 2012
|
||||
+++ src/print_battery_info.c Sun Apr 29 20:22:39 2012
|
||||
@@ -13,6 +13,13 @@
|
||||
#include <sys/sysctl.h>
|
||||
#endif
|
||||
|
||||
+#if defined(__OpenBSD__)
|
||||
+#include <sys/types.h>
|
||||
+#include <sys/ioctl.h>
|
||||
+#include <sys/fcntl.h>
|
||||
+#include <machine/apmvar.h>
|
||||
+#endif
|
||||
+
|
||||
/*
|
||||
* Get battery information from /sys. Note that it uses the design capacity to
|
||||
* calculate the percentage, not the last full capacity, so you can see how
|
||||
@@ -168,6 +175,57 @@ void print_battery_info(yajl_gen json_gen, char *buffe
|
||||
(void)snprintf(remainingbuf, sizeof(remainingbuf), "%02dh%02d",
|
||||
max(hours, 0), max(minutes, 0));
|
||||
}
|
||||
+#elif defined(__OpenBSD__)
|
||||
+ /*
|
||||
+ * We're using apm(4) here, which is the interface to acpi(4) on amd64/i386 and
|
||||
+ * the generic interface on macppc/sparc64/zaurus, instead of using sysctl(3) and
|
||||
+ * probing acpi(4) devices.
|
||||
+ */
|
||||
+ struct apm_power_info apm_info;
|
||||
+ int apm_fd, ac_status, charging;
|
||||
+
|
||||
+ apm_fd = open("/dev/apm", O_RDONLY);
|
||||
+ if (apm_fd < 0) {
|
||||
+ OUTPUT_FULL_TEXT("can't open /dev/apm");
|
||||
+ return;
|
||||
+ }
|
||||
+ if (ioctl(apm_fd, APM_IOC_GETPOWER, &apm_info) < 0)
|
||||
+ OUTPUT_FULL_TEXT("can't read power info");
|
||||
+
|
||||
+ close(apm_fd);
|
||||
+
|
||||
+ /* Don't bother to go further if there's no battery present. */
|
||||
+ if ((apm_info.battery_state == APM_BATTERY_ABSENT) ||
|
||||
+ (apm_info.battery_state == APM_BATT_UNKNOWN)) {
|
||||
+ OUTPUT_FULL_TEXT("No battery");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ switch(apm_info.ac_state) {
|
||||
+ case APM_AC_OFF:
|
||||
+ ac_status = CS_DISCHARGING;
|
||||
+ break;
|
||||
+ case APM_AC_ON:
|
||||
+ ac_status = CS_CHARGING;
|
||||
+ break;
|
||||
+ default:
|
||||
+ /* If we don't know what's going on, just assume we're discharging. */
|
||||
+ ac_status = CS_DISCHARGING;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ (void)snprintf(statusbuf, sizeof(statusbuf), "%s",
|
||||
+ (ac_status == CS_CHARGING ? "CHR" :
|
||||
+ (ac_status == CS_DISCHARGING ? "BAT" : "FULL")));
|
||||
+
|
||||
+ (void)snprintf(percentagebuf, sizeof(percentagebuf), "%02d%%", apm_info.battery_life);
|
||||
+
|
||||
+ /* Can't give a meaningful value for remaining minutes if we're charging. */
|
||||
+ if (ac_status == CS_CHARGING)
|
||||
+ charging = 1;
|
||||
+
|
||||
+ (void)snprintf(remainingbuf, sizeof(remainingbuf), (charging ? "%s" : "%d"),
|
||||
+ (charging ? "(CHR)" : apm_info.minutes_left));
|
||||
#endif
|
||||
|
||||
for (walk = format; *walk != '\0'; walk++) {
|
@ -1,70 +0,0 @@
|
||||
$OpenBSD: patch-src_print_cpu_temperature_c,v 1.1.1.1 2012/05/02 07:37:10 jasper Exp $
|
||||
|
||||
Implement basic fetching of cpu temperature on OpenBSD (committed upstream).
|
||||
|
||||
--- src/print_cpu_temperature.c.orig Sun Apr 29 16:54:46 2012
|
||||
+++ src/print_cpu_temperature.c Sun Apr 29 16:54:56 2012
|
||||
@@ -16,6 +16,15 @@
|
||||
#define TZ_KELVTOC(x) (((x) - TZ_ZEROC) / 10), abs(((x) - TZ_ZEROC) % 10)
|
||||
#endif
|
||||
|
||||
+#if defined(__OpenBSD__)
|
||||
+#include <sys/param.h>
|
||||
+#include <sys/types.h>
|
||||
+#include <sys/sysctl.h>
|
||||
+#include <sys/sensors.h>
|
||||
+#include <errno.h>
|
||||
+#include <err.h>
|
||||
+#endif
|
||||
+
|
||||
static char *thermal_zone;
|
||||
|
||||
/*
|
||||
@@ -59,11 +68,46 @@ void print_cpu_temperature_info(yajl_gen json_gen, cha
|
||||
goto error;
|
||||
|
||||
outwalk += sprintf(outwalk, "%d.%d", TZ_KELVTOC(sysctl_rslt));
|
||||
+#elif defined(__OpenBSD__)
|
||||
+ struct sensordev sensordev;
|
||||
+ struct sensor sensor;
|
||||
+ size_t sdlen, slen;
|
||||
+ int dev, numt, mib[5] = { CTL_HW, HW_SENSORS, 0, 0, 0 };
|
||||
+
|
||||
+ sdlen = sizeof(sensordev);
|
||||
+ slen = sizeof(sensor);
|
||||
+
|
||||
+ for (dev = 0; ; dev++) {
|
||||
+ mib[2] = dev;
|
||||
+ if (sysctl(mib, 3, &sensordev, &sdlen, NULL, 0) == -1) {
|
||||
+ if (errno == ENXIO)
|
||||
+ continue;
|
||||
+ if (errno == ENOENT)
|
||||
+ break;
|
||||
+ goto error;
|
||||
+ }
|
||||
+ /*
|
||||
+ * 'path' is actually the node within the full path (eg, cpu0).
|
||||
+ * XXX: Extend the API to allow a string instead of just an int for path, this would
|
||||
+ * allow us to have a path of 'acpitz0' for example.
|
||||
+ */
|
||||
+ if (strncmp(sensordev.xname, path, strlen(path)) == 0) {
|
||||
+ mib[3] = SENSOR_TEMP;
|
||||
+ for (numt = 0; numt < sensordev.maxnumt[SENSOR_TEMP]; numt++) {
|
||||
+ mib[4] = numt;
|
||||
+ if (sysctl(mib, 5, &sensor, &slen, NULL, 0) == -1) {
|
||||
+ if (errno != ENOENT)
|
||||
+ warn("sysctl");
|
||||
+ continue;
|
||||
+ }
|
||||
+ outwalk += sprintf(outwalk, "%.2f", (sensor.value - 273150000) / 1000000.0 );
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
#endif
|
||||
walk += strlen("degrees");
|
||||
}
|
||||
}
|
||||
-
|
||||
OUTPUT_FULL_TEXT(buffer);
|
||||
return;
|
||||
error:
|
@ -1,45 +0,0 @@
|
||||
$OpenBSD: patch-src_print_cpu_usage_c,v 1.1.1.1 2012/05/02 07:37:10 jasper Exp $
|
||||
|
||||
Fix CPU usage on OpenBSD. Currently only takes the first cpu into account,
|
||||
but works fine otherwise (committed upstream).
|
||||
|
||||
--- src/print_cpu_usage.c.orig Fri Apr 27 16:00:41 2012
|
||||
+++ src/print_cpu_usage.c Fri Apr 27 17:31:08 2012
|
||||
@@ -6,7 +6,8 @@
|
||||
#include <yajl/yajl_gen.h>
|
||||
#include <yajl/yajl_version.h>
|
||||
|
||||
-#ifdef __FreeBSD__
|
||||
+#if defined(__FreeBSD__) || defined(__OpenBSD__)
|
||||
+#include <sys/param.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/sysctl.h>
|
||||
#include <sys/dkstat.h>
|
||||
@@ -42,12 +43,26 @@ void print_cpu_usage(yajl_gen json_gen, char *buffer,
|
||||
diff_usage = (1000 * (diff_total - diff_idle)/diff_total + 5)/10;
|
||||
prev_total = curr_total;
|
||||
prev_idle = curr_idle;
|
||||
-#elif defined(__FreeBSD__)
|
||||
+#elif defined(__FreeBSD__) || defined(__OpenBSD__)
|
||||
+
|
||||
+#if defined(__FreeBSD__)
|
||||
size_t size;
|
||||
long cp_time[CPUSTATES];
|
||||
size = sizeof cp_time;
|
||||
if (sysctlbyname("kern.cp_time", &cp_time, &size, NULL, 0) < 0)
|
||||
goto error;
|
||||
+#else
|
||||
+ /* This information is taken from the boot cpu, any other cpus are currently ignored. */
|
||||
+ long cp_time[CPUSTATES];
|
||||
+ int mib[2];
|
||||
+ size_t size = sizeof(cp_time);
|
||||
+
|
||||
+ mib[0] = CTL_KERN;
|
||||
+ mib[1] = KERN_CPTIME;
|
||||
+
|
||||
+ if (sysctl(mib, 2, cp_time, &size, NULL, 0))
|
||||
+ goto error;
|
||||
+#endif
|
||||
|
||||
curr_user = cp_time[CP_USER];
|
||||
curr_nice = cp_time[CP_NICE];
|
@ -1,24 +0,0 @@
|
||||
$OpenBSD: patch-src_print_disk_info_c,v 1.1.1.1 2012/05/02 07:37:10 jasper Exp $
|
||||
|
||||
Fix disk usage printing on OpenBSD (committed upstream).
|
||||
|
||||
--- src/print_disk_info.c.orig Fri Apr 27 18:35:05 2012
|
||||
+++ src/print_disk_info.c Fri Apr 27 18:35:08 2012
|
||||
@@ -6,7 +6,7 @@
|
||||
#include <stdint.h>
|
||||
#include <sys/statvfs.h>
|
||||
#include <sys/types.h>
|
||||
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || (__OpenBSD__)
|
||||
#include <sys/param.h>
|
||||
#include <sys/mount.h>
|
||||
#endif
|
||||
@@ -49,7 +49,7 @@ void print_disk_info(yajl_gen json_gen, char *buffer,
|
||||
|
||||
INSTANCE(path);
|
||||
|
||||
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
|
||||
struct statfs buf;
|
||||
|
||||
if (statfs(path, &buf) == -1)
|
@ -1,17 +0,0 @@
|
||||
$OpenBSD: patch-src_print_ip_addr_c,v 1.1.1.1 2012/05/02 07:37:10 jasper Exp $
|
||||
|
||||
Fix include order; fixes build on OpenBSD (committed upstream).
|
||||
|
||||
--- src/print_ip_addr.c.orig Fri Apr 27 16:00:41 2012
|
||||
+++ src/print_ip_addr.c Fri Apr 27 16:03:29 2012
|
||||
@@ -1,7 +1,8 @@
|
||||
// vim:ts=8:expandtab
|
||||
-#include <netinet/in.h>
|
||||
-#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
+#include <sys/socket.h>
|
||||
+#include <netinet/in.h>
|
||||
+
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
@ -1,25 +0,0 @@
|
||||
$OpenBSD: patch-src_print_ipv6_addr_c,v 1.1.1.1 2012/05/02 07:37:10 jasper Exp $
|
||||
|
||||
Fix include order; fixes build on OpenBSD (committed upstream).
|
||||
|
||||
--- src/print_ipv6_addr.c.orig Fri Apr 27 16:00:41 2012
|
||||
+++ src/print_ipv6_addr.c Fri Apr 27 16:03:29 2012
|
||||
@@ -1,13 +1,15 @@
|
||||
// vim:ts=8:expandtab
|
||||
+#include <sys/types.h>
|
||||
+#include <sys/socket.h>
|
||||
+#include <netinet/in.h>
|
||||
+#include <arpa/inet.h>
|
||||
+
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
-#include <sys/types.h>
|
||||
-#include <sys/socket.h>
|
||||
#include <netdb.h>
|
||||
#include <string.h>
|
||||
-#include <arpa/inet.h>
|
||||
#include <yajl/yajl_gen.h>
|
||||
#include <yajl/yajl_version.h>
|
||||
|
@ -1,28 +0,0 @@
|
||||
$OpenBSD: patch-src_print_volume_c,v 1.1.1.1 2012/05/02 07:37:10 jasper Exp $
|
||||
|
||||
Print volume on OpenBSD and add missing library accordingly (committed upstream).
|
||||
|
||||
--- src/print_volume.c.orig Fri Apr 27 19:04:24 2012
|
||||
+++ src/print_volume.c Fri Apr 27 19:04:30 2012
|
||||
@@ -17,6 +17,12 @@
|
||||
#include <sys/soundcard.h>
|
||||
#endif
|
||||
|
||||
+#ifdef __OpenBSD__
|
||||
+#include <fcntl.h>
|
||||
+#include <unistd.h>
|
||||
+#include <soundcard.h>
|
||||
+#endif
|
||||
+
|
||||
#include "i3status.h"
|
||||
#include "queue.h"
|
||||
|
||||
@@ -166,7 +172,7 @@ void print_volume(yajl_gen json_gen, char *buffer, con
|
||||
}
|
||||
}
|
||||
#endif
|
||||
-#ifdef __FreeBSD__
|
||||
+#if defined(__FreeBSD__) || defined(__OpenBSD__)
|
||||
char mixerpath[] = "/dev/mixer";
|
||||
int mixfd, vol, devmask = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user