pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/sysutils/xfce4-cpugraph-plugin Add DragonFly support.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/59d36060f057
branches:  trunk
changeset: 524174:59d36060f057
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Sat Jan 20 12:18:31 2007 +0000

description:
Add DragonFly support.

diffstat:

 sysutils/xfce4-cpugraph-plugin/Makefile         |   8 +++++-
 sysutils/xfce4-cpugraph-plugin/distinfo         |   5 +++-
 sysutils/xfce4-cpugraph-plugin/patches/patch-ab |  31 +++++++++++++++++++++++++
 sysutils/xfce4-cpugraph-plugin/patches/patch-ac |  16 ++++++++++++
 sysutils/xfce4-cpugraph-plugin/patches/patch-ad |  15 ++++++++++++
 5 files changed, 73 insertions(+), 2 deletions(-)

diffs (109 lines):

diff -r ecd0ed59b815 -r 59d36060f057 sysutils/xfce4-cpugraph-plugin/Makefile
--- a/sysutils/xfce4-cpugraph-plugin/Makefile   Sat Jan 20 12:15:38 2007 +0000
+++ b/sysutils/xfce4-cpugraph-plugin/Makefile   Sat Jan 20 12:18:31 2007 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.7 2006/04/17 13:46:14 wiz Exp $
+# $NetBSD: Makefile,v 1.8 2007/01/20 12:18:31 joerg Exp $
 
 .include "../../meta-pkgs/xfce4/Makefile.common"
 
@@ -12,5 +12,11 @@
 
 WRKSRC=                ${WRKDIR}/xfce4-cpugraph-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 ecd0ed59b815 -r 59d36060f057 sysutils/xfce4-cpugraph-plugin/distinfo
--- a/sysutils/xfce4-cpugraph-plugin/distinfo   Sat Jan 20 12:15:38 2007 +0000
+++ b/sysutils/xfce4-cpugraph-plugin/distinfo   Sat Jan 20 12:18:31 2007 +0000
@@ -1,6 +1,9 @@
-$NetBSD: distinfo,v 1.5 2005/02/24 13:40:59 agc Exp $
+$NetBSD: distinfo,v 1.6 2007/01/20 12:18:31 joerg Exp $
 
 SHA1 (xfce4-cpugraph-plugin-0.2.2.tar.gz) = 64914e2d766ba093b6158d45ab37c0021057121b
 RMD160 (xfce4-cpugraph-plugin-0.2.2.tar.gz) = c1af61ae6961b4cbdd16dad925bf805440c24aa5
 Size (xfce4-cpugraph-plugin-0.2.2.tar.gz) = 210953 bytes
 SHA1 (patch-aa) = fe1b2d46334ba73a9a6c661c09b14bc1f2a342a9
+SHA1 (patch-ab) = 547a43d4df832c0f08cc7dd27856d0542de7aa8a
+SHA1 (patch-ac) = 47c0e53b7dddf0307cc949aa69c335c1492e8584
+SHA1 (patch-ad) = a989f0ed1b91d2e1fbc61fa623b989d371be80e0
diff -r ecd0ed59b815 -r 59d36060f057 sysutils/xfce4-cpugraph-plugin/patches/patch-ab
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/xfce4-cpugraph-plugin/patches/patch-ab   Sat Jan 20 12:18:31 2007 +0000
@@ -0,0 +1,31 @@
+$NetBSD: patch-ab,v 1.1 2007/01/20 12:18:31 joerg Exp $
+
+--- panel-plugin/os.c.orig     2004-06-07 01:16:30.000000000 +0000
++++ panel-plugin/os.c
+@@ -63,6 +63,26 @@ long GetCPUUsage (int *oldusage, int *ol
+       
+       return usage;
+ }
++#elif defined(__DragonFly__)
++long GetCPUUsage (int *oldusage, int *oldtotal)
++{
++      long used, total, usage;
++      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 - *oldusage;
++      total = used + cp_time.cp_idle - *oldtotal;
++      if (total != 0)
++              usage = 100 * (used + used / 2) / total;
++      else
++              usage = 0;
++      *oldusage = used;
++      *oldtotal = total;
++      return usage;
++}
+ #elif defined (__NetBSD__)
+ long GetCPUUsage (int *oldusage, int *oldtotal)
+ {
diff -r ecd0ed59b815 -r 59d36060f057 sysutils/xfce4-cpugraph-plugin/patches/patch-ac
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/xfce4-cpugraph-plugin/patches/patch-ac   Sat Jan 20 12:18:31 2007 +0000
@@ -0,0 +1,16 @@
+$NetBSD: patch-ac,v 1.1 2007/01/20 12:18:31 joerg Exp $
+
+OS_LIBS contains -lkinfo on DragonFly.
+
+--- panel-plugin/Makefile.in.orig      2007-01-20 12:00:36.000000000 +0000
++++ panel-plugin/Makefile.in
+@@ -150,7 +150,8 @@ libcpugraph_la_CFLAGS = \
+ 
+ 
+ libcpugraph_la_LIBADD = \
+-      @XFCE4_PANEL_LIBS@
++      @XFCE4_PANEL_LIBS@ \
++      ${OS_LIBS}
+ 
+ subdir = panel-plugin
+ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
diff -r ecd0ed59b815 -r 59d36060f057 sysutils/xfce4-cpugraph-plugin/patches/patch-ad
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/xfce4-cpugraph-plugin/patches/patch-ad   Sat Jan 20 12:18:31 2007 +0000
@@ -0,0 +1,15 @@
+$NetBSD: patch-ad,v 1.1 2007/01/20 12:18:31 joerg Exp $
+
+--- panel-plugin/os.h.orig     2007-01-20 12:05:51.000000000 +0000
++++ panel-plugin/os.h
+@@ -17,6 +17,10 @@
+ #include <nlist.h>
+ #endif
+ 
++#if defined(__DragonFly__)
++#include <kinfo.h>
++#endif
++
+ #if defined (__NetBSD__)
+ #include <sys/param.h>
+ #include <sys/sched.h>



Home | Main Index | Thread Index | Old Index