summaryrefslogtreecommitdiff
path: root/sysutils/xfce4-systemload-plugin
diff options
context:
space:
mode:
authorjoerg <joerg>2007-01-19 16:28:15 +0000
committerjoerg <joerg>2007-01-19 16:28:15 +0000
commit875ad59cdbccd92565349d96582b95fcd3913f9c (patch)
tree7695e9ec1bc3ec0ac34dbcdf9423f04363173707 /sysutils/xfce4-systemload-plugin
parent0542f033d5c04954c64ba48576541d2026b94b88 (diff)
downloadpkgsrc-875ad59cdbccd92565349d96582b95fcd3913f9c.tar.gz
Add DragonFly support.
Diffstat (limited to 'sysutils/xfce4-systemload-plugin')
-rw-r--r--sysutils/xfce4-systemload-plugin/Makefile8
-rw-r--r--sysutils/xfce4-systemload-plugin/distinfo6
-rw-r--r--sysutils/xfce4-systemload-plugin/patches/patch-aa19
-rw-r--r--sysutils/xfce4-systemload-plugin/patches/patch-ab36
-rw-r--r--sysutils/xfce4-systemload-plugin/patches/patch-ac12
5 files changed, 73 insertions, 8 deletions
diff --git a/sysutils/xfce4-systemload-plugin/Makefile b/sysutils/xfce4-systemload-plugin/Makefile
index fd0890b3eb2..aa7935777fe 100644
--- a/sysutils/xfce4-systemload-plugin/Makefile
+++ b/sysutils/xfce4-systemload-plugin/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.13 2006/04/17 13:46:13 wiz Exp $
+# $NetBSD: Makefile,v 1.14 2007/01/19 16:28:15 joerg Exp $
.include "../../meta-pkgs/xfce4/Makefile.common"
@@ -10,5 +10,11 @@ CATEGORIES= sysutils
MASTER_SITES= http://download.berlios.de/xfce-goodies/
COMMENT= Xfce system load plugin
+.include "../../mk/bsd.prefs.mk"
+
+.if ${OPSYS} == "DragonFly"
+MAKE_ENV+= OS_LIBS=-lkinfo
+.endif
+
.include "../../x11/xfce4-panel/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/sysutils/xfce4-systemload-plugin/distinfo b/sysutils/xfce4-systemload-plugin/distinfo
index 50f2052d859..4e822d8589c 100644
--- a/sysutils/xfce4-systemload-plugin/distinfo
+++ b/sysutils/xfce4-systemload-plugin/distinfo
@@ -1,6 +1,8 @@
-$NetBSD: distinfo,v 1.6 2005/09/27 12:49:08 martti Exp $
+$NetBSD: distinfo,v 1.7 2007/01/19 16:28:15 joerg Exp $
SHA1 (xfce4-systemload-plugin-0.3.6.tar.gz) = ed477e9c8499b8e34031658237586a83bc12cef4
RMD160 (xfce4-systemload-plugin-0.3.6.tar.gz) = a7b3f28326262eeb5aa66d5cd966474ac0a4554b
Size (xfce4-systemload-plugin-0.3.6.tar.gz) = 229985 bytes
-SHA1 (patch-aa) = 8889a9dcf8f10fd4e6f8597d849efc838c202b56
+SHA1 (patch-aa) = f997c210580541883fa47738d2cec667517efcac
+SHA1 (patch-ab) = 51adca6bf236f78645b0ad0741f215603b7de8bf
+SHA1 (patch-ac) = b89f5233076c666133f08ef26f0e070d99d2d374
diff --git a/sysutils/xfce4-systemload-plugin/patches/patch-aa b/sysutils/xfce4-systemload-plugin/patches/patch-aa
index c0ce249532b..fd834abba32 100644
--- a/sysutils/xfce4-systemload-plugin/patches/patch-aa
+++ b/sysutils/xfce4-systemload-plugin/patches/patch-aa
@@ -1,8 +1,17 @@
-$NetBSD: patch-aa,v 1.2 2005/09/27 12:49:08 martti Exp $
+$NetBSD: patch-aa,v 1.3 2007/01/19 16:28:15 joerg Exp $
---- panel-plugin/memswap.c.orig 2003-11-06 02:39:52.000000000 +0200
-+++ panel-plugin/memswap.c 2005-09-27 12:39:16.000000000 +0300
-@@ -284,7 +284,24 @@
+--- panel-plugin/memswap.c.orig 2003-11-06 00:39:52.000000000 +0000
++++ panel-plugin/memswap.c
+@@ -113,7 +113,7 @@ gint read_memswap(gulong *mem, gulong *s
+ return 0;
+ }
+
+-#elif defined(__FreeBSD__)
++#elif defined(__FreeBSD__) || defined(__DragonFly__)
+ /*
+ * This is inspired by /usr/src/usr.bin/top/machine.c
+ *
+@@ -284,7 +284,24 @@ gint read_memswap(gulong *mem, gulong *s
#define ARRLEN(X) (sizeof(X)/sizeof(X[0]))
{
@@ -28,7 +37,7 @@ $NetBSD: patch-aa,v 1.2 2005/09/27 12:49:08 martti Exp $
len = sizeof(MTotal);
sysctl(mib, ARRLEN(mib), &MTotal, &len, NULL, 0);
MTotal >>= 10;
-@@ -395,7 +412,24 @@
+@@ -395,7 +412,24 @@ gint read_memswap(gulong *mem, gulong *s
#define ARRLEN(X) (sizeof(X)/sizeof(X[0]))
{
diff --git a/sysutils/xfce4-systemload-plugin/patches/patch-ab b/sysutils/xfce4-systemload-plugin/patches/patch-ab
new file mode 100644
index 00000000000..39cfef6c5f8
--- /dev/null
+++ b/sysutils/xfce4-systemload-plugin/patches/patch-ab
@@ -0,0 +1,36 @@
+$NetBSD: patch-ab,v 1.1 2007/01/19 16:28:15 joerg Exp $
+
+--- panel-plugin/cpu.c.orig 2007-01-19 15:10:47.000000000 +0000
++++ panel-plugin/cpu.c
+@@ -81,6 +81,31 @@ gulong read_cpuload()
+ return cpu_used;
+ }
+
++#elif defined(__DragonFly__)
++#include <kinfo.h>
++
++static struct kinfo_cputime old_cp_time;
++
++gulong read_cpuload()
++{
++ gulong used, total;
++ struct kinfo_cputime cp_time;
++
++ if (kinfo_get_sched_cputime(&cp_time) < 0) {
++ g_warning("kinfo_get_sched_cputime failed");
++ return 0;
++ }
++ used = cp_time.cp_user + cp_time.cp_nice + cp_time.cp_sys;
++ used -= old_cp_time.cp_user + old_cp_time.cp_nice + old_cp_time.cp_sys;
++ total = used + cp_time.cp_idle - old_cp_time.cp_idle;
++ old_cp_time = cp_time;
++
++ if (total)
++ return 100 * (used + used / 2) / total;
++ else
++ return 0;
++}
++
+ #elif defined(__FreeBSD__)
+
+ #include <osreldate.h>
diff --git a/sysutils/xfce4-systemload-plugin/patches/patch-ac b/sysutils/xfce4-systemload-plugin/patches/patch-ac
new file mode 100644
index 00000000000..7c8b7d8aa9c
--- /dev/null
+++ b/sysutils/xfce4-systemload-plugin/patches/patch-ac
@@ -0,0 +1,12 @@
+$NetBSD: patch-ac,v 1.1 2007/01/19 16:28:15 joerg Exp $
+
+--- panel-plugin/Makefile.in.orig 2007-01-19 15:42:16.000000000 +0000
++++ panel-plugin/Makefile.in
+@@ -206,6 +206,7 @@ libsystemload_la_CFLAGS = \
+ @XFCE4_PANEL_CFLAGS@
+
+ libsystemload_la_LIBADD = \
++ ${OS_LIBS} \
+ @XFCE4_PANEL_LIBS@
+
+ all: all-am