summaryrefslogtreecommitdiff
path: root/sysutils/i3status
diff options
context:
space:
mode:
authorkamil <kamil@pkgsrc.org>2016-06-14 06:39:37 +0000
committerkamil <kamil@pkgsrc.org>2016-06-14 06:39:37 +0000
commit115b63e32ffd052bebaa46fff0093ae4ed6018c0 (patch)
tree370a592ed3eb8f1d898871e3510ba597eabd5548 /sysutils/i3status
parentf50f914b0da4a806f8544edf06fa6261d0fdd159 (diff)
downloadpkgsrc-115b63e32ffd052bebaa46fff0093ae4ed6018c0.tar.gz
Import i3status-2.10 as sysutils/i3status
i3status is a small program (about 3000 SLOC) for generating a status bar for dzen2, xmobar or similar programs. It is designed to be very efficient by issuing a very small number of system calls, as one generally wants to update such a status line every second. This ensures that even under high load, your status bar is updated correctly. Also, it saves a bit of energy by not hogging your CPU as much as spawning the corresponding amount of shell commands would. Originally packaged in pkgsrc-wip by: - Pierre Allegraud, - Vitaly Shevtsov, - Niclas Rosenvik, - Mateusz Poszwa, - myself, with maintanance commits by: - Aleksej Saushev.
Diffstat (limited to 'sysutils/i3status')
-rw-r--r--sysutils/i3status/DESCR7
-rw-r--r--sysutils/i3status/Makefile25
-rw-r--r--sysutils/i3status/PLIST5
-rw-r--r--sysutils/i3status/distinfo9
-rw-r--r--sysutils/i3status/patches/patch-Makefile36
-rw-r--r--sysutils/i3status/patches/patch-src_print__disk__info.c53
-rw-r--r--sysutils/i3status/patches/patch-src_print__wireless__info.c19
7 files changed, 154 insertions, 0 deletions
diff --git a/sysutils/i3status/DESCR b/sysutils/i3status/DESCR
new file mode 100644
index 00000000000..61d80262145
--- /dev/null
+++ b/sysutils/i3status/DESCR
@@ -0,0 +1,7 @@
+i3status is a small program (about 3000 SLOC) for generating a status bar
+for dzen2, xmobar or similar programs. It is designed to be very efficient
+by issuing a very small number of system calls, as one generally wants
+to update such a status line every second.
+This ensures that even under high load, your status bar is updated correctly.
+Also, it saves a bit of energy by not hogging your CPU as much as spawning
+the corresponding amount of shell commands would.
diff --git a/sysutils/i3status/Makefile b/sysutils/i3status/Makefile
new file mode 100644
index 00000000000..70e7f8daf9b
--- /dev/null
+++ b/sysutils/i3status/Makefile
@@ -0,0 +1,25 @@
+# $NetBSD: Makefile,v 1.1 2016/06/14 06:39:37 kamil Exp $
+#
+
+DISTNAME= i3status-2.10
+CATEGORIES= sysutils
+MASTER_SITES= http://i3wm.org/i3status/
+EXTRACT_SUFX= .tar.bz2
+
+MAINTAINER= pkgsrc-users@NetBSD.org
+HOMEPAGE= http://i3wm.org/i3status/
+COMMENT= Small program for generating a status bar
+LICENSE= modified-bsd
+
+USE_TOOLS+= gmake
+
+CONF_FILES= ${PREFIX}/share/examples/${PKGBASE}/i3status.conf ${PKG_SYSCONFDIR}/i3status.conf
+
+MAKE_ENV+= MANDIR=${PKGMANDIR}
+MAKE_ENV+= SYSCONFDIR=${PKG_SYSCONFDIR}
+MAKE_ENV+= DEBUG=0
+
+.include "../../devel/confuse/buildlink3.mk"
+.include "../../devel/yajl/buildlink3.mk"
+.include "../../audio/pulseaudio/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/sysutils/i3status/PLIST b/sysutils/i3status/PLIST
new file mode 100644
index 00000000000..85380970650
--- /dev/null
+++ b/sysutils/i3status/PLIST
@@ -0,0 +1,5 @@
+@comment $NetBSD: PLIST,v 1.1 2016/06/14 06:39:37 kamil Exp $
+bin/i3status
+man/man1/i3status.1
+share/doc/i3status/LICENSE
+share/examples/i3status/i3status.conf
diff --git a/sysutils/i3status/distinfo b/sysutils/i3status/distinfo
new file mode 100644
index 00000000000..69484f286e0
--- /dev/null
+++ b/sysutils/i3status/distinfo
@@ -0,0 +1,9 @@
+$NetBSD: distinfo,v 1.1 2016/06/14 06:39:37 kamil Exp $
+
+SHA1 (i3status-2.10.tar.bz2) = b0bfcac24c9e57958eefd9c3b00aed4b73b2c708
+RMD160 (i3status-2.10.tar.bz2) = 78a2d26aea8d59e8b8e9f7a302e28688bd9ae516
+SHA512 (i3status-2.10.tar.bz2) = a514331d83458de15b548686d423b38a7a9198a7a31ca3001f3f136e4b873617c397a0073bb10b44fa8613bc12ed4fa4e384d099d31122a8afbd0df5de2e9c85
+Size (i3status-2.10.tar.bz2) = 53684 bytes
+SHA1 (patch-Makefile) = 2ca0cf79670e189a7e70e14247b1cd4aafb81ffd
+SHA1 (patch-src_print__disk__info.c) = e0662f65b21402e60a643374898707f5807077f2
+SHA1 (patch-src_print__wireless__info.c) = 4632c9eabd5b5d73bc67e541bf7dc93e883339d1
diff --git a/sysutils/i3status/patches/patch-Makefile b/sysutils/i3status/patches/patch-Makefile
new file mode 100644
index 00000000000..6662a3809bf
--- /dev/null
+++ b/sysutils/i3status/patches/patch-Makefile
@@ -0,0 +1,36 @@
+$NetBSD: patch-Makefile,v 1.1 2016/06/14 06:39:37 kamil Exp $
+
+Adjust paths and install LICENSE.
+
+--- Makefile.orig 2016-01-01 18:51:19.000000000 +0000
++++ Makefile
+@@ -11,6 +11,9 @@ ifndef SYSCONFDIR
+ SYSCONFDIR=$(PREFIX)/etc
+ endif
+ endif
++ifndef MANDIR
++ MANDIR=$(MANDIR)
++endif
+
+ CFLAGS+=-Wall -Wshadow -Wpointer-arith -Wcast-qual -Wsign-compare
+ CFLAGS+=-g
+@@ -100,13 +103,15 @@ manpage:
+
+ install:
+ install -m 755 -d $(DESTDIR)$(PREFIX)/bin
+- install -m 755 -d $(DESTDIR)$(SYSCONFDIR)
+- install -m 755 -d $(DESTDIR)$(MANPREFIX)/share/man/man1
++ install -m 755 -d $(DESTDIR)$(PREFIX)/share/examples/i3status
++ install -m 755 -d $(DESTDIR)$(PREFIX)/share/doc/i3status
++ install -m 755 -d $(DESTDIR)$(MANPREFIX)/$(MANDIR)/man1
+ install -m 755 i3status $(DESTDIR)$(PREFIX)/bin/i3status
+ # Allow network configuration for getting the link speed
+ (which setcap && setcap cap_net_admin=ep $(DESTDIR)$(PREFIX)/bin/i3status) || true
+- install -m 644 i3status.conf $(DESTDIR)$(SYSCONFDIR)/i3status.conf
+- install -m 644 man/i3status.1 $(DESTDIR)$(MANPREFIX)/share/man/man1
++ install -m 644 i3status.conf $(DESTDIR)$(PREFIX)/share/examples/i3status/i3status.conf
++ install -m 644 LICENSE $(DESTDIR)$(PREFIX)/share/doc/i3status
++ install -m 644 man/i3status.1 $(DESTDIR)$(MANPREFIX)/$(MANDIR)/man1
+
+ release:
+ [ -f i3status-${VERSION} ] || rm -rf i3status-${VERSION}
diff --git a/sysutils/i3status/patches/patch-src_print__disk__info.c b/sysutils/i3status/patches/patch-src_print__disk__info.c
new file mode 100644
index 00000000000..f57bbd513c2
--- /dev/null
+++ b/sysutils/i3status/patches/patch-src_print__disk__info.c
@@ -0,0 +1,53 @@
+$NetBSD: patch-src_print__disk__info.c,v 1.1 2016/06/14 06:39:37 kamil Exp $
+
+* mntent.h and setmntent stuff is linux only
+* NetBSD has statvfs structure, not statfs
+
+--- src/print_disk_info.c.orig 2016-01-01 18:51:19.000000000 +0000
++++ src/print_disk_info.c
+@@ -7,11 +7,11 @@
+ #include <sys/stat.h>
+ #include <sys/statvfs.h>
+ #include <sys/types.h>
+-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || (__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__)
++#if defined(__linux__)
++#include <mntent.h>
++#else
+ #include <sys/param.h>
+ #include <sys/mount.h>
+-#else
+-#include <mntent.h>
+ #endif
+ #include <yajl/yajl_gen.h>
+ #include <yajl/yajl_version.h>
+@@ -116,12 +116,7 @@ void print_disk_info(yajl_gen json_gen,
+
+ INSTANCE(path);
+
+-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__)
+- struct statfs buf;
+-
+- if (statfs(path, &buf) == -1)
+- return;
+-#else
++#if defined(__linux__)
+ struct statvfs buf;
+
+ if (statvfs(path, &buf) == -1) {
+@@ -145,6 +140,16 @@ void print_disk_info(yajl_gen json_gen,
+ format = format_not_mounted;
+ }
+ }
++#elif defined(__NetBSD__)
++ struct statvfs buf;
++
++ if (statvfs(path, &buf) == -1)
++ format = format_not_mounted;
++#else
++ struct statfs buf;
++
++ if (statfs(path, &buf) == -1)
++ return;
+ #endif
+
+ if (low_threshold > 0 && below_threshold(buf, prefix_type, threshold_type, low_threshold)) {
diff --git a/sysutils/i3status/patches/patch-src_print__wireless__info.c b/sysutils/i3status/patches/patch-src_print__wireless__info.c
new file mode 100644
index 00000000000..c48ef125d85
--- /dev/null
+++ b/sysutils/i3status/patches/patch-src_print__wireless__info.c
@@ -0,0 +1,19 @@
+$NetBSD: patch-src_print__wireless__info.c,v 1.1 2016/06/14 06:39:37 kamil Exp $
+
+Add support for NetBSD.
+
+--- src/print_wireless_info.c.orig 2016-01-01 18:51:19.000000000 +0000
++++ src/print_wireless_info.c
+@@ -52,6 +52,12 @@
+ #include <net80211/ieee80211_ioctl.h>
+ #endif
+
++#ifdef __NetBSD__
++#include <unistd.h>
++#include <net80211/ieee80211.h>
++#define IW_ESSID_MAX_SIZE IEEE80211_NWID_LEN
++#endif
++
+ #include "i3status.h"
+
+ #define WIRELESS_INFO_FLAG_HAS_ESSID (1 << 0)