diff --git a/x11/i3status/Makefile b/x11/i3status/Makefile index 7edb6b31801..f239f343a96 100644 --- a/x11/i3status/Makefile +++ b/x11/i3status/Makefile @@ -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 @@ -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 diff --git a/x11/i3status/distinfo b/x11/i3status/distinfo index a70aa377328..3d489ef658f 100644 --- a/x11/i3status/distinfo +++ b/x11/i3status/distinfo @@ -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 diff --git a/x11/i3status/patches/patch-Makefile b/x11/i3status/patches/patch-Makefile index 7c7885cd1a8..083ca92be95 100644 --- a/x11/i3status/patches/patch-Makefile +++ b/x11/i3status/patches/patch-Makefile @@ -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 diff --git a/x11/i3status/patches/patch-include_i3status_h b/x11/i3status/patches/patch-include_i3status_h deleted file mode 100644 index 46edc054b16..00000000000 --- a/x11/i3status/patches/patch-include_i3status_h +++ /dev/null @@ -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__) diff --git a/x11/i3status/patches/patch-man_Makefile b/x11/i3status/patches/patch-man_Makefile deleted file mode 100644 index 7a9a73186a6..00000000000 --- a/x11/i3status/patches/patch-man_Makefile +++ /dev/null @@ -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 diff --git a/x11/i3status/patches/patch-src_print_battery_info_c b/x11/i3status/patches/patch-src_print_battery_info_c deleted file mode 100644 index 34e6db582fd..00000000000 --- a/x11/i3status/patches/patch-src_print_battery_info_c +++ /dev/null @@ -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 - #endif - -+#if defined(__OpenBSD__) -+#include -+#include -+#include -+#include -+#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++) { diff --git a/x11/i3status/patches/patch-src_print_cpu_temperature_c b/x11/i3status/patches/patch-src_print_cpu_temperature_c deleted file mode 100644 index 43426ab7a49..00000000000 --- a/x11/i3status/patches/patch-src_print_cpu_temperature_c +++ /dev/null @@ -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 -+#include -+#include -+#include -+#include -+#include -+#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: diff --git a/x11/i3status/patches/patch-src_print_cpu_usage_c b/x11/i3status/patches/patch-src_print_cpu_usage_c deleted file mode 100644 index ed9c187d077..00000000000 --- a/x11/i3status/patches/patch-src_print_cpu_usage_c +++ /dev/null @@ -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 - #include - --#ifdef __FreeBSD__ -+#if defined(__FreeBSD__) || defined(__OpenBSD__) -+#include - #include - #include - #include -@@ -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]; diff --git a/x11/i3status/patches/patch-src_print_disk_info_c b/x11/i3status/patches/patch-src_print_disk_info_c deleted file mode 100644 index c0085928640..00000000000 --- a/x11/i3status/patches/patch-src_print_disk_info_c +++ /dev/null @@ -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 - #include - #include --#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) -+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || (__OpenBSD__) - #include - #include - #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) diff --git a/x11/i3status/patches/patch-src_print_ip_addr_c b/x11/i3status/patches/patch-src_print_ip_addr_c deleted file mode 100644 index d771cca5dfe..00000000000 --- a/x11/i3status/patches/patch-src_print_ip_addr_c +++ /dev/null @@ -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 --#include - #include -+#include -+#include -+ - #include - #include - #include diff --git a/x11/i3status/patches/patch-src_print_ipv6_addr_c b/x11/i3status/patches/patch-src_print_ipv6_addr_c deleted file mode 100644 index 1778b8603db..00000000000 --- a/x11/i3status/patches/patch-src_print_ipv6_addr_c +++ /dev/null @@ -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 -+#include -+#include -+#include -+ - #include - #include - #include - #include --#include --#include - #include - #include --#include - #include - #include - diff --git a/x11/i3status/patches/patch-src_print_volume_c b/x11/i3status/patches/patch-src_print_volume_c deleted file mode 100644 index 0317cb001a4..00000000000 --- a/x11/i3status/patches/patch-src_print_volume_c +++ /dev/null @@ -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 - #endif - -+#ifdef __OpenBSD__ -+#include -+#include -+#include -+#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; -