pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/sysutils/xfce4-systemload-plugin Add DragonFly support.
details: https://anonhg.NetBSD.org/pkgsrc/rev/4bd7b590ea51
branches: trunk
changeset: 524155:4bd7b590ea51
user: joerg <joerg%pkgsrc.org@localhost>
date: Fri Jan 19 16:28:15 2007 +0000
description:
Add DragonFly support.
diffstat:
sysutils/xfce4-systemload-plugin/Makefile | 8 ++++-
sysutils/xfce4-systemload-plugin/distinfo | 6 ++-
sysutils/xfce4-systemload-plugin/patches/patch-aa | 19 ++++++++---
sysutils/xfce4-systemload-plugin/patches/patch-ab | 36 +++++++++++++++++++++++
sysutils/xfce4-systemload-plugin/patches/patch-ac | 12 +++++++
5 files changed, 73 insertions(+), 8 deletions(-)
diffs (125 lines):
diff -r 6f2c933d3749 -r 4bd7b590ea51 sysutils/xfce4-systemload-plugin/Makefile
--- a/sysutils/xfce4-systemload-plugin/Makefile Fri Jan 19 15:34:15 2007 +0000
+++ b/sysutils/xfce4-systemload-plugin/Makefile Fri Jan 19 16:28:15 2007 +0000
@@ -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 @@
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 -r 6f2c933d3749 -r 4bd7b590ea51 sysutils/xfce4-systemload-plugin/distinfo
--- a/sysutils/xfce4-systemload-plugin/distinfo Fri Jan 19 15:34:15 2007 +0000
+++ b/sysutils/xfce4-systemload-plugin/distinfo Fri Jan 19 16:28:15 2007 +0000
@@ -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 -r 6f2c933d3749 -r 4bd7b590ea51 sysutils/xfce4-systemload-plugin/patches/patch-aa
--- a/sysutils/xfce4-systemload-plugin/patches/patch-aa Fri Jan 19 15:34:15 2007 +0000
+++ b/sysutils/xfce4-systemload-plugin/patches/patch-aa Fri Jan 19 16:28:15 2007 +0000
@@ -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 @@
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 -r 6f2c933d3749 -r 4bd7b590ea51 sysutils/xfce4-systemload-plugin/patches/patch-ab
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/xfce4-systemload-plugin/patches/patch-ab Fri Jan 19 16:28:15 2007 +0000
@@ -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 -r 6f2c933d3749 -r 4bd7b590ea51 sysutils/xfce4-systemload-plugin/patches/patch-ac
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/xfce4-systemload-plugin/patches/patch-ac Fri Jan 19 16:28:15 2007 +0000
@@ -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
Home |
Main Index |
Thread Index |
Old Index