summaryrefslogtreecommitdiff
path: root/x11/kdebase3
diff options
context:
space:
mode:
authormarkd <markd>2006-10-08 07:49:27 +0000
committermarkd <markd>2006-10-08 07:49:27 +0000
commit24ab08d3fbff3b553dce40d371cc3215af51ef20 (patch)
treee44e9583f6cb742f27d423e94885843950842044 /x11/kdebase3
parent64a452042dd61e6f7e9bc7ca46192c8b581bc351 (diff)
downloadpkgsrc-24ab08d3fbff3b553dce40d371cc3215af51ef20.tar.gz
Teach ksysguard more about NetBSD. Fixes PR pkg/28338.
Bump PKGREVISION.
Diffstat (limited to 'x11/kdebase3')
-rw-r--r--x11/kdebase3/Makefile3
-rw-r--r--x11/kdebase3/distinfo6
-rw-r--r--x11/kdebase3/patches/patch-fh133
-rw-r--r--x11/kdebase3/patches/patch-fi175
-rw-r--r--x11/kdebase3/patches/patch-fj25
-rw-r--r--x11/kdebase3/patches/patch-fk16
6 files changed, 356 insertions, 2 deletions
diff --git a/x11/kdebase3/Makefile b/x11/kdebase3/Makefile
index de7f88666e6..9390f8652ca 100644
--- a/x11/kdebase3/Makefile
+++ b/x11/kdebase3/Makefile
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.117 2006/08/02 13:45:51 markd Exp $
+# $NetBSD: Makefile,v 1.118 2006/10/08 07:49:27 markd Exp $
DISTNAME= kdebase-${_KDE_VERSION}
+PKGREVISION= 1
CATEGORIES= x11
COMMENT= Base modules for the KDE 3 integrated X11 desktop
diff --git a/x11/kdebase3/distinfo b/x11/kdebase3/distinfo
index 24fcddb3cfb..0ebc0924777 100644
--- a/x11/kdebase3/distinfo
+++ b/x11/kdebase3/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.88 2006/09/19 17:50:46 wiz Exp $
+$NetBSD: distinfo,v 1.89 2006/10/08 07:49:27 markd Exp $
SHA1 (Daemon.README) = eb1e6af52adc02ded77af17e8953134b7e60d23b
RMD160 (Daemon.README) = 39edd92ed4314397080f32a8caff0ac3f716ecf4
@@ -48,6 +48,10 @@ SHA1 (patch-fd) = 879a072170b5a38ae80d6854540ab1dae5f59bfc
SHA1 (patch-fe) = 3da89e7228d5246e98a244d7f52d9052c3dbcfa2
SHA1 (patch-ff) = a027ccd5f578d41560e970aa54fca9b5760da0ac
SHA1 (patch-fg) = bdd6fbbf1f82e174d5ceb70e67763813c13b14dd
+SHA1 (patch-fh) = 28e63604888b7b1a84cfadbc0b658347b1f42fbc
+SHA1 (patch-fi) = 80965bb595f91b96c5e417e08ed37af355542ae9
+SHA1 (patch-fj) = 25de89b959a365f57f68557a878cc7dff5f62df5
+SHA1 (patch-fk) = 05b3a6a6451185b3f0eee3a8b9d2001ead62211a
SHA1 (patch-ga) = 40ab73f3e32e8d8e8c58662df7c5dc54bd4acd29
SHA1 (patch-gb) = b36e23cf6c64e42269b396f389c5a0e24a40e67e
SHA1 (patch-gc) = e02ddb93ae7aa249b3b3e68690f587b2c98255b8
diff --git a/x11/kdebase3/patches/patch-fh b/x11/kdebase3/patches/patch-fh
new file mode 100644
index 00000000000..e97d0228d72
--- /dev/null
+++ b/x11/kdebase3/patches/patch-fh
@@ -0,0 +1,133 @@
+$NetBSD: patch-fh,v 1.5 2006/10/08 07:49:27 markd Exp $
+
+--- ksysguard/ksysguardd/NetBSD/CPU.c.orig 2005-10-11 04:04:31.000000000 +1300
++++ ksysguard/ksysguardd/NetBSD/CPU.c
+@@ -19,6 +19,8 @@
+
+ */
+
++#include <sys/param.h>
++#include <sys/sysctl.h>
+ #include <sys/dkstat.h>
+ #include <sys/sched.h> /* CPUSTATES */
+ #include <fcntl.h>
+@@ -33,20 +35,13 @@
+ #include "Command.h"
+ #include "ksysguardd.h"
+
+-long percentages(int cnt, int *out, long *new, long *old, long *diffs);
+-
+-struct nlist my_nlist[] = {
+- {"_cp_time"},
+- { 0 }
+-};
++void percentages(int, int *, u_int64_t *, u_int64_t *, u_int64_t *);
+
+ kvm_t *kd;
+
+-unsigned long cp_time_offset;
+-
+-long cp_time[CPUSTATES];
+-long cp_old[CPUSTATES];
+-long cp_diff[CPUSTATES];
++u_int64_t cp_time[CPUSTATES];
++u_int64_t cp_old[CPUSTATES];
++u_int64_t cp_diff[CPUSTATES];
+ int cpu_states[CPUSTATES];
+
+ void
+@@ -61,9 +56,7 @@ initCpuInfo(struct SensorModul* sm)
+ printCPUSysInfo, sm);
+ registerMonitor("cpu/idle", "integer", printCPUIdle,
+ printCPUIdleInfo, sm);
+- kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "kvm_open");
+- kvm_nlist(kd, my_nlist);
+- cp_time_offset = my_nlist[0].n_value;
++ kd = kvm_open(NULL, NULL, NULL, KVM_NO_FILES, "kvm_open");
+
+ updateCpuInfo();
+ }
+@@ -77,7 +70,13 @@ exitCpuInfo(void)
+ int
+ updateCpuInfo(void)
+ {
+- kvm_read(kd, cp_time_offset, (char *)cp_time, sizeof(cp_time));
++ int mib[2];
++ size_t size;
++
++ mib[0] = CTL_KERN;
++ mib[1] = KERN_CP_TIME;
++ size = sizeof(cp_time[0]) * CPUSTATES;
++ sysctl(mib, 2, cp_time, &size, NULL, 0);
+ percentages(CPUSTATES, cpu_states, cp_time, cp_old, cp_diff);
+ return (0);
+ }
+@@ -152,20 +151,20 @@ printCPUIdleInfo(const char* cmd)
+ * useful on BSD mchines for calculating cpu state percentages.
+ */
+
+-long percentages(cnt, out, new, old, diffs)
++void percentages(cnt, out, new, old, diffs)
+
+ int cnt;
+ int *out;
+-register long *new;
+-register long *old;
+-long *diffs;
++u_int64_t *new;
++u_int64_t *old;
++u_int64_t *diffs;
+
+ {
+- register int i;
+- register long change;
+- register long total_change;
+- register long *dp;
+- long half_total;
++ int i;
++ u_int64_t change;
++ u_int64_t total_change;
++ u_int64_t *dp;
++ u_int64_t half_total;
+
+ /* initialization */
+ total_change = 0;
+@@ -174,12 +173,11 @@ long *diffs;
+ /* calculate changes for each state and the overall change */
+ for (i = 0; i < cnt; i++)
+ {
+- if ((change = *new - *old) < 0)
+- {
+- /* this only happens when the counter wraps */
+- change = (int)
+- ((unsigned long)*new-(unsigned long)*old);
+- }
++ /*
++ * Don't worry about wrapping - even at hz=1GHz, a
++ * u_int64_t will last at least 544 years.
++ */
++ change = *new - *old;
+ total_change += (*dp++ = change);
+ *old++ = *new++;
+ }
+@@ -191,16 +189,9 @@ long *diffs;
+ }
+
+ /* calculate percentages based on overall change, rounding up */
+- half_total = total_change / 2l;
+-
+- /* Do not divide by 0. Causes Floating point exception */
+- if(total_change) {
+- for (i = 0; i < cnt; i++)
+- {
+- *out++ = (int)((*diffs++ * 1000 + half_total) / total_change);
+- }
++ half_total = total_change / 2;
++ for (i = 0; i < cnt; i++)
++ {
++ *out++ = (int)((*diffs++ * 1000 + half_total) / total_change);
+ }
+-
+- /* return the total in case the caller wants to use it */
+- return(total_change);
+ }
diff --git a/x11/kdebase3/patches/patch-fi b/x11/kdebase3/patches/patch-fi
new file mode 100644
index 00000000000..191bc560fe2
--- /dev/null
+++ b/x11/kdebase3/patches/patch-fi
@@ -0,0 +1,175 @@
+$NetBSD: patch-fi,v 1.3 2006/10/08 07:49:27 markd Exp $
+
+--- ksysguard/ksysguardd/NetBSD/Memory.c.orig 2006-10-08 15:49:27.000000000 +1300
++++ ksysguard/ksysguardd/NetBSD/Memory.c
+@@ -45,8 +45,11 @@
+ static size_t Total = 0;
+ static size_t MFree = 0;
+ static size_t Used = 0;
+-static size_t Buffers = 0;
+-static size_t Cached = 0;
++static size_t Active = 0;
++static size_t Inactive = 0;
++static size_t Wired = 0;
++static size_t Execpages = 0;
++static size_t Filepages = 0;
+ static size_t STotal = 0;
+ static size_t SFree = 0;
+ static size_t SUsed = 0;
+@@ -55,19 +58,18 @@ static kvm_t *kd;
+ void
+ initMemory(struct SensorModul* sm)
+ {
+- char *nlistf = NULL;
+- char *memf = NULL;
+- char buf[_POSIX2_LINE_MAX];
+-
+- if ((kd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY, buf)) == NULL) {
+- log_error("kvm_openfiles()");
++ if ((kd = kvm_open(NULL, NULL, NULL, KVM_NO_FILES, "kvm_open")) == NULL) {
++ log_error("kvm_open()");
+ return;
+ }
+
+ registerMonitor("mem/physical/free", "integer", printMFree, printMFreeInfo, sm);
+ registerMonitor("mem/physical/used", "integer", printUsed, printUsedInfo, sm);
+- registerMonitor("mem/physical/buf", "integer", printBuffers, printBuffersInfo, sm);
+- registerMonitor("mem/physical/cached", "integer", printCached, printCachedInfo, sm);
++ registerMonitor("mem/physical/active", "integer", printActive, printActiveInfo, sm);
++ registerMonitor("mem/physical/inactive", "integer", printInactive, printInactiveInfo, sm);
++ registerMonitor("mem/physical/wired", "integer", printWired, printWiredInfo, sm);
++ registerMonitor("mem/physical/execpages", "integer", printExecpages, printExecpagesInfo, sm);
++ registerMonitor("mem/physical/filepages", "integer", printFilepages, printFilepagesInfo, sm);
+ registerMonitor("mem/swap/free", "integer", printSwapFree, printSwapFreeInfo, sm);
+ registerMonitor("mem/swap/used", "integer", printSwapUsed, printSwapUsedInfo, sm);
+ }
+@@ -83,7 +85,6 @@ updateMemory(void)
+ {
+
+ #define ARRLEN(X) (sizeof(X)/sizeof(X[0]))
+- long pagesize; /* using a long promotes the arithmetic */
+ size_t len;
+
+ {
+@@ -95,37 +96,26 @@ updateMemory(void)
+ }
+
+ {
+- struct uvmexp x;
+- static int mib[] = { CTL_VM, VM_UVMEXP };
++ struct uvmexp_sysctl x;
++ static int mib[] = { CTL_VM, VM_UVMEXP2 };
+
+ len = sizeof(x);
+ STotal = SUsed = SFree = -1;
+- pagesize = 1;
++ Active = Inactive = Wired = Execpages = Filepages = MFree = Used = -1;
+ if (-1 < sysctl(mib, ARRLEN(mib), &x, &len, NULL, 0)) {
+- pagesize = x.pagesize;
+- STotal = (pagesize*x.swpages) >> 10;
+- SUsed = (pagesize*x.swpginuse) >> 10;
++ STotal = (x.pagesize*x.swpages) >> 10;
++ SUsed = (x.pagesize*x.swpginuse) >> 10;
+ SFree = STotal - SUsed;
++ MFree = (x.free * x.pagesize) >> 10;
++ Active = (x.active * x.pagesize) >> 10;
++ Inactive = (x.inactive * x.pagesize) >> 10;
++ Wired = (x.wired * x.pagesize) >> 10;
++ Execpages = (x.execpages * x.pagesize) >> 10;
++ Filepages = (x.filepages * x.pagesize) >> 10;
++ Used = Total - MFree;
+ }
+ }
+
+- /* can't find NetBSD filesystem buffer info */
+- Buffers = -1;
+-
+- /* NetBSD doesn't know about vm.stats */
+- Cached = -1;
+-
+- {
+- static int mib[]={ CTL_VM, VM_METER };
+- struct vmtotal x;
+-
+- len = sizeof(x);
+- MFree = Used = -1;
+- if (sysctl(mib, ARRLEN(mib), &x, &len, NULL, 0) > -1) {
+- MFree = (x.t_free * pagesize) >> 10;
+- Used = (x.t_rm * pagesize) >> 10;
+- }
+- }
+ return 0;
+ }
+
+@@ -154,27 +144,63 @@ printUsedInfo(const char* cmd)
+ }
+
+ void
+-printBuffers(const char* cmd)
++printActive(const char* cmd)
++{
++ fprintf(CurrentClient, "%d\n", Active);
++}
++
++void
++printActiveInfo(const char* cmd)
++{
++ fprintf(CurrentClient, "Active Memory\t0\t%d\tKB\n", Total);
++}
++
++void
++printInactive(const char* cmd)
++{
++ fprintf(CurrentClient, "%d\n", Inactive);
++}
++
++void
++printInactiveInfo(const char* cmd)
++{
++ fprintf(CurrentClient, "Inactive Memory\t0\t%d\tKB\n", Total);
++}
++
++void
++printWired(const char* cmd)
++{
++ fprintf(CurrentClient, "%d\n", Wired);
++}
++
++void
++printWiredInfo(const char* cmd)
++{
++ fprintf(CurrentClient, "Wired Memory\t0\t%d\tKB\n", Total);
++}
++
++void
++printExecpages(const char* cmd)
+ {
+- fprintf(CurrentClient, "%d\n", Buffers);
++ fprintf(CurrentClient, "%d\n", Execpages);
+ }
+
+ void
+-printBuffersInfo(const char* cmd)
++printExecpagesInfo(const char* cmd)
+ {
+- fprintf(CurrentClient, "Buffer Memory\t0\t%d\tKB\n", Total);
++ fprintf(CurrentClient, "Exec Pages\t0\t%d\tKB\n", Total);
+ }
+
+ void
+-printCached(const char* cmd)
++printFilepages(const char* cmd)
+ {
+- fprintf(CurrentClient, "%d\n", Cached);
++ fprintf(CurrentClient, "%d\n", Filepages);
+ }
+
+ void
+-printCachedInfo(const char* cmd)
++printFilepagesInfo(const char* cmd)
+ {
+- fprintf(CurrentClient, "Cached Memory\t0\t%d\tKB\n", Total);
++ fprintf(CurrentClient, "File Pages\t0\t%d\tKB\n", Total);
+ }
+
+ void
diff --git a/x11/kdebase3/patches/patch-fj b/x11/kdebase3/patches/patch-fj
new file mode 100644
index 00000000000..e02bd4cbfcf
--- /dev/null
+++ b/x11/kdebase3/patches/patch-fj
@@ -0,0 +1,25 @@
+$NetBSD: patch-fj,v 1.3 2006/10/08 07:49:27 markd Exp $
+
+--- ksysguard/ksysguardd/NetBSD/Memory.h.orig 2005-10-11 04:04:31.000000000 +1300
++++ ksysguard/ksysguardd/NetBSD/Memory.h
+@@ -31,10 +31,16 @@ void printMFree(const char* cmd);
+ void printMFreeInfo(const char* cmd);
+ void printUsed(const char* cmd);
+ void printUsedInfo(const char* cmd);
+-void printBuffers(const char* cmd);
+-void printBuffersInfo(const char* cmd);
+-void printCached(const char* cmd);
+-void printCachedInfo(const char* cmd);
++void printActive(const char* cmd);
++void printActiveInfo(const char* cmd);
++void printInactive(const char* cmd);
++void printInactiveInfo(const char* cmd);
++void printWired(const char* cmd);
++void printWiredInfo(const char* cmd);
++void printExecpages(const char* cmd);
++void printExecpagesInfo(const char* cmd);
++void printFilepages(const char* cmd);
++void printFilepagesInfo(const char* cmd);
+ void printSwapUsed(const char* cmd);
+ void printSwapUsedInfo(const char* cmd);
+ void printSwapFree(const char* cmd);
diff --git a/x11/kdebase3/patches/patch-fk b/x11/kdebase3/patches/patch-fk
new file mode 100644
index 00000000000..70d0ea1f4a9
--- /dev/null
+++ b/x11/kdebase3/patches/patch-fk
@@ -0,0 +1,16 @@
+$NetBSD: patch-fk,v 1.3 2006/10/08 07:49:27 markd Exp $
+
+--- ksysguard/gui/ksgrd/SensorManager.cc.orig 2006-10-08 17:05:59.000000000 +1300
++++ ksysguard/gui/ksgrd/SensorManager.cc
+@@ -60,6 +60,11 @@ SensorManager::SensorManager()
+ mDict.insert( "used", new QString( i18n( "Used Memory" ) ) );
+ mDict.insert( "application", new QString( i18n( "Application Memory" ) ) );
+ mDict.insert( "free", new QString( i18n( "Free Memory" ) ) );
++ mDict.insert( "active", new QString( i18n( "Active Memory" ) ) );
++ mDict.insert( "inactive", new QString( i18n( "Inactive Memory" ) ) );
++ mDict.insert( "wired", new QString( i18n( "Wired Memory" ) ) );
++ mDict.insert( "execpages", new QString( i18n( "Exec Pages" ) ) );
++ mDict.insert( "filepages", new QString( i18n( "File Pages" ) ) );
+ mDict.insert( "pscount", new QString( i18n( "Process Count" ) ) );
+ mDict.insert( "ps", new QString( i18n( "Process Controller" ) ) );
+ mDict.insert( "disk", new QString( i18n( "Disk Throughput" ) ) );