pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/sysutils/wmcpuload Add DragonFly and modular Xorg supp...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/15a52eff09cc
branches:  trunk
changeset: 524176:15a52eff09cc
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Sat Jan 20 12:56:27 2007 +0000

description:
Add DragonFly and modular Xorg support.

diffstat:

 sysutils/wmcpuload/Makefile              |   7 ++++-
 sysutils/wmcpuload/distinfo              |   3 +-
 sysutils/wmcpuload/files/cpu_dragonfly.c |  43 ++++++++++++++++++++++++++++++++
 sysutils/wmcpuload/patches/patch-aa      |  16 +++++++++++
 4 files changed, 67 insertions(+), 2 deletions(-)

diffs (98 lines):

diff -r 735776dbb60a -r 15a52eff09cc sysutils/wmcpuload/Makefile
--- a/sysutils/wmcpuload/Makefile       Sat Jan 20 12:33:37 2007 +0000
+++ b/sysutils/wmcpuload/Makefile       Sat Jan 20 12:56:27 2007 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.9 2006/12/15 20:33:01 joerg Exp $
+# $NetBSD: Makefile,v 1.10 2007/01/20 12:56:27 joerg Exp $
 #
 
 DISTNAME=      wmcpuload-1.0.1
@@ -13,5 +13,10 @@
 
 GNU_CONFIGURE=         YES
 
+post-extract:
+       ${CP} ${FILESDIR}/cpu_dragonfly.c ${WRKSRC}/src
+
+.include "../../x11/libXext/buildlink3.mk"
 .include "../../x11/libXpm/buildlink3.mk"
+.include "../../x11/xextproto/buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
diff -r 735776dbb60a -r 15a52eff09cc sysutils/wmcpuload/distinfo
--- a/sysutils/wmcpuload/distinfo       Sat Jan 20 12:33:37 2007 +0000
+++ b/sysutils/wmcpuload/distinfo       Sat Jan 20 12:56:27 2007 +0000
@@ -1,5 +1,6 @@
-$NetBSD: distinfo,v 1.3 2005/02/24 13:40:59 agc Exp $
+$NetBSD: distinfo,v 1.4 2007/01/20 12:56:27 joerg Exp $
 
 SHA1 (wmcpuload-1.0.1.tar.bz2) = 6e767dd5acd291cfe3fc4fece5ff32eef78915e4
 RMD160 (wmcpuload-1.0.1.tar.bz2) = 1ff01f09464dc8628acd7d375adcd106ea7ce317
 Size (wmcpuload-1.0.1.tar.bz2) = 92457 bytes
+SHA1 (patch-aa) = 581eb45891beace0fae14cf77329921e9146762e
diff -r 735776dbb60a -r 15a52eff09cc sysutils/wmcpuload/files/cpu_dragonfly.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/wmcpuload/files/cpu_dragonfly.c  Sat Jan 20 12:56:27 2007 +0000
@@ -0,0 +1,43 @@
+/*
+ * cpu_freebsd.c - module to get cpu usage, for DragonFly
+ *
+ * Copyright (c) 2007 Joerg Sonnenberger <joerg%leaf.dragonflybsd.org@localhost>
+ *
+ * Licensed under the GPL
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <kinfo.h>
+#include "cpu.h"
+
+void
+cpu_init(void)
+{
+}
+
+/* returns current CPU usage in percent */
+int
+cpu_get_usage(cpu_options *opts)
+{
+       static uint64_t old_used, old_total;
+       uint64_t used, total;
+       struct kinfo_cputime cp_time;
+       int usage;
+
+       if (kinfo_get_sched_cputime(&cp_time) < 0)
+               return 0;
+       used = cp_time.cp_user + cp_time.cp_sys;
+       if (!opts->ignore_nice)
+               used += cp_time.cp_nice;
+       total = used + cp_time.cp_idle;
+       if (old_total == 0 || total == old_total) 
+               usage = 0;
+       else
+               usage = 100 * (used - old_used + used / 2 - old_used / 2) / (total - old_total);
+       old_used = used;
+       old_total = total;
+       return usage;
+}
diff -r 735776dbb60a -r 15a52eff09cc sysutils/wmcpuload/patches/patch-aa
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/wmcpuload/patches/patch-aa       Sat Jan 20 12:56:27 2007 +0000
@@ -0,0 +1,16 @@
+$NetBSD: patch-aa,v 1.3 2007/01/20 12:56:27 joerg Exp $
+
+--- configure.orig     2007-01-20 12:15:08.000000000 +0000
++++ configure
+@@ -4669,6 +4669,11 @@ freebsd*)
+   LIBS="$LIBS -lkvm"
+   SETGID_FLAGS="-g kmem -m 2755 -o  root"
+   ;;
++dragonfly*)
++  OS=dragonfly
++  ignore_nice=yes
++  LIBS="$LIBS -lkinfo"
++  ;;
+ openbsd*)
+   OS=openbsd
+   ignore_nice=yes



Home | Main Index | Thread Index | Old Index