diff options
author | markd <markd@pkgsrc.org> | 2011-01-10 11:55:18 +0000 |
---|---|---|
committer | markd <markd@pkgsrc.org> | 2011-01-10 11:55:18 +0000 |
commit | b8d0d1c374853952d62b4b741fe530244e4f8f0c (patch) | |
tree | 61947b847d2ee302fff8b833f4760e2594408991 /x11/kdebase-workspace4 | |
parent | 13dee1c3aeb36d05ebf7d965e9e2f14fce4b7200 (diff) | |
download | pkgsrc-b8d0d1c374853952d62b4b741fe530244e4f8f0c.tar.gz |
Fix build on DragonFly. PR#44350 fix from kde bug id 247614
Diffstat (limited to 'x11/kdebase-workspace4')
-rw-r--r-- | x11/kdebase-workspace4/distinfo | 5 | ||||
-rw-r--r-- | x11/kdebase-workspace4/patches/patch-cc | 16 | ||||
-rw-r--r-- | x11/kdebase-workspace4/patches/patch-cd | 102 | ||||
-rw-r--r-- | x11/kdebase-workspace4/patches/patch-ce | 272 |
4 files changed, 394 insertions, 1 deletions
diff --git a/x11/kdebase-workspace4/distinfo b/x11/kdebase-workspace4/distinfo index 71981bf96c5..87f84296bef 100644 --- a/x11/kdebase-workspace4/distinfo +++ b/x11/kdebase-workspace4/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.13 2010/12/06 11:43:42 markd Exp $ +$NetBSD: distinfo,v 1.14 2011/01/10 11:55:18 markd Exp $ SHA1 (Daemon.README) = eb1e6af52adc02ded77af17e8953134b7e60d23b RMD160 (Daemon.README) = 39edd92ed4314397080f32a8caff0ac3f716ecf4 @@ -25,3 +25,6 @@ SHA1 (patch-be) = e58dc4a0a7be7350251f26de34a8949e7508c983 SHA1 (patch-bo) = e682d488c61ca2540ed4b2112c9bffc45bbe5e8d SHA1 (patch-ca) = 61b886388aa5d0831581eacb7db79de0ae5eaf80 SHA1 (patch-cb) = 8bfcc8b7e91eafd6b444f4103d3860fb6434a535 +SHA1 (patch-cc) = f0c92eb5edc2690008d028652820cad77bf50b07 +SHA1 (patch-cd) = c9e7b32b39b8191f5f54a799bdfa7009136429f9 +SHA1 (patch-ce) = b02c04dae0005bec33a13ecf09254d35a0e4cd0b diff --git a/x11/kdebase-workspace4/patches/patch-cc b/x11/kdebase-workspace4/patches/patch-cc new file mode 100644 index 00000000000..f5970f6a621 --- /dev/null +++ b/x11/kdebase-workspace4/patches/patch-cc @@ -0,0 +1,16 @@ +$NetBSD: patch-cc,v 1.1 2011/01/10 11:55:18 markd Exp $ + +--- libs/ksysguard/processcore/processes_local_p.cpp.orig 2009-12-14 10:43:38.000000000 +0000 ++++ libs/ksysguard/processcore/processes_local_p.cpp +@@ -21,8 +21,10 @@ + + #if defined __linux__ + #include "processes_linux_p.cpp" +-#elif defined __FreeBSD__ || defined __FreeBSD_kernel__ || defined __DragonFly__ ++#elif defined __FreeBSD__ || defined __FreeBSD_kernel__ + #include "processes_freebsd_p.cpp" ++#elif defined __DragonFly__ ++#include "processes_dragonfly_p.cpp" + #elif defined __OpenBSD__ + #include "processes_openbsd_p.cpp" + #elif defined __NetBSD__ diff --git a/x11/kdebase-workspace4/patches/patch-cd b/x11/kdebase-workspace4/patches/patch-cd new file mode 100644 index 00000000000..81c72136f96 --- /dev/null +++ b/x11/kdebase-workspace4/patches/patch-cd @@ -0,0 +1,102 @@ +$NetBSD: patch-cd,v 1.1 2011/01/10 11:55:18 markd Exp $ + +--- libs/ksysguard/processcore/processes_freebsd_p.cpp.orig 2010-02-20 11:31:44.000000000 +0000 ++++ libs/ksysguard/processcore/processes_freebsd_p.cpp +@@ -29,10 +29,6 @@ + #include <sys/types.h> + #include <sys/user.h> + #include <sys/resource.h> +-#if defined(__DragonFly__) +-#include <sys/resourcevar.h> +-#include <err.h> +-#endif + #include <signal.h> + #include <unistd.h> + #include <stdlib.h> +@@ -77,53 +73,25 @@ void ProcessesLocal::Private::readProcSt + process->setGid(0); + process->setTracerpid(0); + +- +-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + process->setEuid(p->ki_uid); + process->setUid(p->ki_ruid); + process->setEgid(p->ki_svgid); + process->setGid(p->ki_rgid); + process->setName(QString(p->ki_comm ? p->ki_comm : "????")); +-#elif defined(__DragonFly__) && __DragonFly_version >= 190000 +- process->setUid(p->kp_uid); +- process->setGid(p->kp_pgid); +- process->setName(QString(p->kp_comm ? p->kp_comm : "????")); +-#else +- process->setUid(p->kp_eproc.e_ucred.cr_uid); +- process->setGid(p->kp_eproc.e_pgid); +-#endif + } + + void ProcessesLocal::Private::readProcStat(struct kinfo_proc *p, Process *ps) + { + int status; + struct rusage pru; +-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) ++ + ps->setUserTime(p->ki_rusage.ru_utime.tv_sec * 100 + p->ki_rusage.ru_utime.tv_usec / 10000); + ps->setSysTime(p->ki_rusage.ru_stime.tv_sec * 100 + p->ki_rusage.ru_stime.tv_usec / 10000); + ps->setNiceLevel(p->ki_nice); + ps->setVmSize(p->ki_size / 1024); + ps->setVmRSS(p->ki_rssize * getpagesize() / 1024); + status = p->ki_stat; +-#elif defined(__DragonFly__) +-#if __DragonFly_version >= 190000 +- if (!getrusage(p->kp_pid, &pru)) { +- errx(1, "failed to get rusage info"); +- } +- ps->setUserTime(pru.ru_utime.tv_usec / 1000); /*p_runtime / 1000*/ +- ps->setNiceLevel(p->kp_nice); +- ps->setVmSize(p->kp_vm_map_size); +- ps->setVmRSS(p->kp_vm_rssize * getpagesize()); +- status = p->kp_stat; +-#else +- ps->setUserTime(p->kp_proc.p_rtime.tv_sec*100+p->kp_proc.p_rtime.tv_usec/100); +- ps->setNiceLevel(p->kp_proc.p_nice); +- ps->setVmSize(p->kp_eproc.e_vm.vm_map.size); +- ps->setVmRSS(p->kp_eproc.e_vm.vm_rssize * getpagesize()); +- status = p->kp_proc.p_stat; +-#endif + ps->setSysTime(0); +-#endif + + // "idle","run","sleep","stop","zombie" + switch( status ) { +@@ -185,13 +153,7 @@ long ProcessesLocal::getParentPid(long p + struct kinfo_proc p; + if(d->readProc(pid, &p)) + { +-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + ppid = p.ki_ppid; +-#elif defined(__DragonFly__) && __DragonFly_version >= 190000 +- ppid = p.kp_ppid; +-#else +- ppid = p.kp_eproc.e_ppid; +-#endif + } + return ppid; + } +@@ -230,16 +192,9 @@ QSet<long> ProcessesLocal::getAllPids( ) + + for (num = 0; num < len / sizeof(struct kinfo_proc); num++) + { +-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + long pid = p[num].ki_pid; + long long ppid = p[num].ki_ppid; +-#elif defined(__DragonFly__) && __DragonFly_version >= 190000 +- long pid = p[num].kp_pid; +- long long ppid = p[num].kp_ppid; +-#else +- long pid = p[num].kp_proc.p_pid; +- long long ppid = p[num].kp_eproc.e_ppid; +-#endif ++ + //skip all process with parent id = 0 but init + if(ppid == 0 && pid != 1) + continue; diff --git a/x11/kdebase-workspace4/patches/patch-ce b/x11/kdebase-workspace4/patches/patch-ce new file mode 100644 index 00000000000..0821f915603 --- /dev/null +++ b/x11/kdebase-workspace4/patches/patch-ce @@ -0,0 +1,272 @@ +$NetBSD: patch-ce,v 1.1 2011/01/10 11:55:18 markd Exp $ + +--- libs/ksysguard/processcore/processes_dragonfly_p.cpp.orig 2011-01-10 11:40:21.000000000 +0000 ++++ libs/ksysguard/processcore/processes_dragonfly_p.cpp +@@ -0,0 +1,267 @@ ++/* This file is part of the KDE project ++ Copyright (C) 2007 Manolo Valdes <nolis71cu@gmail.com> ++ Copyright (C) 2010 Alex Hornung <ahornung@gmail.com> ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Library General Public ++ License as published by the Free Software Foundation; either ++ version 2 of the License, or (at your option) any later version. ++ ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Library General Public License for more details. ++ ++ You should have received a copy of the GNU Library General Public License ++ along with this library; see the file COPYING.LIB. If not, write to ++ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ Boston, MA 02110-1301, USA. ++*/ ++ ++#include "processes_local_p.h" ++#include "process.h" ++ ++#include <klocale.h> ++ ++#include <QSet> ++ ++#include <sys/param.h> ++#include <sys/sysctl.h> ++#include <sys/types.h> ++#include <sys/user.h> ++#include <sys/resource.h> ++#include <sys/resourcevar.h> ++#include <err.h> ++#include <signal.h> ++#include <unistd.h> ++#include <stdlib.h> ++#include <sched.h> ++ ++#define PP(pp, field) ((pp)->kp_ ## field) ++#define LP(pp, field) ((pp)->kp_lwp.kl_ ## field) ++#define VP(pp, field) ((pp)->kp_vm_ ## field) ++ ++namespace KSysGuard ++{ ++ ++ class ProcessesLocal::Private ++ { ++ public: ++ Private() {;} ++ ~Private() {;} ++ inline bool readProc(long pid, struct kinfo_proc *p); ++ inline void readProcStatus(struct kinfo_proc *p, Process *process); ++ inline void readProcStat(struct kinfo_proc *p, Process *process); ++ inline void readProcStatm(struct kinfo_proc *p, Process *process); ++ inline bool readProcCmdline(long pid, Process *process); ++ }; ++ ++bool ProcessesLocal::Private::readProc(long pid, struct kinfo_proc *p) ++{ ++ int mib[4]; ++ size_t len; ++ ++ mib[0] = CTL_KERN; ++ mib[1] = KERN_PROC; ++ mib[2] = KERN_PROC_PID; ++ mib[3] = pid; ++ ++ len = sizeof (struct kinfo_proc); ++ if (sysctl(mib, 4, p, &len, NULL, 0) == -1 || !len) ++ return false; ++ return true; ++} ++ ++void ProcessesLocal::Private::readProcStatus(struct kinfo_proc *p, Process *process) ++{ ++ process->setUid(0); ++ process->setGid(0); ++ process->setTracerpid(0); ++ ++ process->setEuid(PP(p, uid)); ++ process->setUid(PP(p, ruid)); ++ process->setEgid(PP(p, svgid)); ++ process->setGid(PP(p, rgid)); ++ process->setName(QString(PP(p, comm))); ++} ++ ++void ProcessesLocal::Private::readProcStat(struct kinfo_proc *p, Process *ps) ++{ ++ ps->setUserTime(LP(p, uticks) / 10000); ++ ps->setSysTime((LP(p, sticks) + LP(p, iticks)) / 10000); ++ ps->setNiceLevel(PP(p, nice)); ++ ps->setVmSize(VP(p, map_size) / 1024); /* convert to KiB */ ++ ps->setVmRSS(VP(p, prssize) * getpagesize() / 1024); /* convert to KiB */ ++ ++// "idle","run","sleep","stop","zombie" ++ switch( LP(p, stat) ) { ++ case LSRUN: ++ ps->setStatus(Process::Running); ++ break; ++ case LSSLEEP: ++ ps->setStatus(Process::Sleeping); ++ break; ++ case LSSTOP: ++ ps->setStatus(Process::Stopped); ++ break; ++ default: ++ ps->setStatus(Process::OtherStatus); ++ break; ++ } ++ if (PP(p, stat) == SZOMB) ++ ps->setStatus(Process::Zombie); ++} ++ ++void ProcessesLocal::Private::readProcStatm(struct kinfo_proc *p, Process *process) ++{ ++ process->setVmURSS(-1); ++} ++ ++bool ProcessesLocal::Private::readProcCmdline(long pid, Process *process) ++{ ++ int mib[4]; ++ size_t buflen = 256; ++ char buf[256]; ++ ++ mib[0] = CTL_KERN; ++ mib[1] = KERN_PROC; ++ mib[2] = KERN_PROC_ARGS; ++ mib[3] = pid; ++ ++ if (sysctl(mib, 4, buf, &buflen, NULL, 0) == -1 || (buflen == 0)) ++ return false; ++ QString command = QString(buf); ++ ++ //cmdline seperates parameters with the NULL character ++ command = command.replace('\0', ' '); ++ process->setCommand(command.trimmed()); ++ ++ return true; ++} ++ ++ProcessesLocal::ProcessesLocal() : d(new Private()) ++{ ++ ++} ++ ++long ProcessesLocal::getParentPid(long pid) { ++ long long ppid = 0; ++ struct kinfo_proc p; ++ if(d->readProc(pid, &p)) ++ ppid = PP(&p, ppid); ++ ++ return ppid; ++} ++ ++bool ProcessesLocal::updateProcessInfo( long pid, Process *process) ++{ ++ struct kinfo_proc p; ++ if(!d->readProc(pid, &p)) return false; ++ d->readProcStat(&p, process); ++ d->readProcStatus(&p, process); ++ d->readProcStatm(&p, process); ++ if(!d->readProcCmdline(pid, process)) return false; ++ ++ return true; ++} ++ ++QSet<long> ProcessesLocal::getAllPids( ) ++{ ++ QSet<long> pids; ++ int mib[3]; ++ size_t len; ++ size_t num; ++ struct kinfo_proc *p; ++ ++ mib[0] = CTL_KERN; ++ mib[1] = KERN_PROC; ++ mib[2] = KERN_PROC_ALL; ++ if (sysctl(mib, 3, NULL, &len, NULL, 0) == -1) ++ return pids; ++ if ((p = (kinfo_proc *) malloc(len)) == NULL) ++ return pids; ++ if (sysctl(mib, 3, p, &len, NULL, 0) == -1) { ++ free(p); ++ return pids; ++ } ++ ++ for (num = 0; num < len / sizeof(struct kinfo_proc); num++) ++ { ++ long pid = PP((&p[num]), pid); ++ long long ppid = PP((&p[num]), ppid); ++ ++ //skip all process with parent id = 0 but init ++ if(ppid == 0 && pid != 1) ++ continue; ++ pids.insert(pid); ++ } ++ free(p); ++ return pids; ++} ++ ++bool ProcessesLocal::sendSignal(long pid, int sig) { ++ if ( kill( (pid_t)pid, sig ) ) { ++ //Kill failed ++ return false; ++ } ++ return true; ++} ++ ++bool ProcessesLocal::setNiceness(long pid, int priority) { ++ if ( setpriority( PRIO_PROCESS, pid, priority ) ) { ++ //set niceness failed ++ return false; ++ } ++ return true; ++} ++ ++bool ProcessesLocal::setScheduler(long pid, int priorityClass, int priority) ++{ ++ if(priorityClass == KSysGuard::Process::Other || priorityClass == KSysGuard::Process::Batch) ++ priority = 0; ++ if(pid <= 0) return false; // check the parameters ++ struct sched_param params; ++ params.sched_priority = priority; ++ switch(priorityClass) { ++ case (KSysGuard::Process::Other): ++ return (sched_setscheduler( pid, SCHED_OTHER, ¶ms) == 0); ++ case (KSysGuard::Process::RoundRobin): ++ return (sched_setscheduler( pid, SCHED_RR, ¶ms) == 0); ++ case (KSysGuard::Process::Fifo): ++ return (sched_setscheduler( pid, SCHED_FIFO, ¶ms) == 0); ++#ifdef SCHED_BATCH ++ case (KSysGuard::Process::Batch): ++ return (sched_setscheduler( pid, SCHED_BATCH, ¶ms) == 0); ++#endif ++ default: ++ return false; ++ } ++} ++ ++bool ProcessesLocal::setIoNiceness(long pid, int priorityClass, int priority) { ++ return false; //Not yet supported ++} ++ ++bool ProcessesLocal::supportsIoNiceness() { ++ return false; ++} ++ ++long long ProcessesLocal::totalPhysicalMemory() { ++ ++ size_t Total; ++ size_t len; ++ ++ len = sizeof (Total); ++ if (sysctlbyname("hw.physmem", &Total, &len, NULL, 0) == -1) ++ return 0; ++ ++ Total *= getpagesize() / 1024; ++ return Total; ++} ++ ++ProcessesLocal::~ProcessesLocal() ++{ ++ delete d; ++} ++ ++} |