aboutsummaryrefslogtreecommitdiff
path: root/x11
diff options
context:
space:
mode:
authorMarkus Brueffer <markus@FreeBSD.org>2009-08-14 13:23:14 +0000
committerMarkus Brueffer <markus@FreeBSD.org>2009-08-14 13:23:14 +0000
commit37e5d1fbc26fca125e1e2035520ee5894c8e6217 (patch)
tree853ed005d409500212883e478f80091e9bb6158c /x11
parent350c9cd82ae62c74f3db5f46ac366b6e03e17f8f (diff)
downloadports-37e5d1fbc26fca125e1e2035520ee5894c8e6217.tar.gz
ports-37e5d1fbc26fca125e1e2035520ee5894c8e6217.zip
Notes
Diffstat (limited to 'x11')
-rw-r--r--x11/kde4-baseapps/Makefile2
-rw-r--r--x11/kde4-baseapps/files/patch-apps-konsole-src-ProcessInfo.cpp147
-rw-r--r--x11/kdebase4/Makefile2
-rw-r--r--x11/kdebase4/files/patch-apps-konsole-src-ProcessInfo.cpp147
4 files changed, 296 insertions, 2 deletions
diff --git a/x11/kde4-baseapps/Makefile b/x11/kde4-baseapps/Makefile
index 99dd3ec510bf..e14ba617f177 100644
--- a/x11/kde4-baseapps/Makefile
+++ b/x11/kde4-baseapps/Makefile
@@ -8,7 +8,7 @@
PORTNAME= kdebase
PORTVERSION= ${KDE4_VERSION}
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= x11 kde
MASTER_SITES= ${MASTER_SITE_KDE}
MASTER_SITE_SUBDIR= ${KDE4_BRANCH}/${PORTVERSION}/src
diff --git a/x11/kde4-baseapps/files/patch-apps-konsole-src-ProcessInfo.cpp b/x11/kde4-baseapps/files/patch-apps-konsole-src-ProcessInfo.cpp
new file mode 100644
index 000000000000..34dd2af1bd30
--- /dev/null
+++ b/x11/kde4-baseapps/files/patch-apps-konsole-src-ProcessInfo.cpp
@@ -0,0 +1,147 @@
+--- apps/konsole/src/ProcessInfo.cpp.orig 2009-04-15 12:25:25.000000000 +0200
++++ apps/konsole/src/ProcessInfo.cpp 2009-08-14 03:00:37.000000000 +0200
+@@ -27,6 +27,14 @@
+ #include <unistd.h>
+ #include <pwd.h>
+
++// FreeBSD
++#ifdef Q_OS_FREEBSD
++#include <sys/param.h>
++#include <sys/sysctl.h>
++#include <sys/user.h>
++#include <libutil.h>
++#endif
++
+ // Qt
+ #include <KDebug>
+ #include <QtCore/QDir>
+@@ -657,6 +665,120 @@
+ }
+ } ;
+
++#ifdef Q_OS_FREEBSD
++class FreeBSDProcessInfo : public UnixProcessInfo
++{
++public:
++ FreeBSDProcessInfo(int pid, bool readEnvironment)
++ : UnixProcessInfo(pid,readEnvironment)
++ {
++ }
++private:
++ virtual bool readProcInfo(int pid)
++ {
++ struct kinfo_proc *kip;
++ int name[4];
++ size_t len;
++
++ name[0] = CTL_KERN;
++ name[1] = KERN_PROC;
++ name[2] = KERN_PROC_PID;
++ name[3] = pid;
++
++ len = 0;
++ if (sysctl(name, 4, NULL, &len, NULL, 0) < 0)
++ return false;
++
++ kip = static_cast<struct kinfo_proc*>(malloc(len));
++ if (kip == NULL)
++ return false;
++
++ if (sysctl(name, 4, kip, &len, NULL, 0) < 0) {
++ free(kip);
++ return false;
++ }
++
++ if (len != sizeof(*kip) || (kip->ki_structsize != sizeof(*kip)) || (kip->ki_pid != pid)) {
++ free(kip);
++ return false;
++ }
++
++ setParentPid(kip->ki_ppid);
++ setForegroundPid(kip->ki_pgid);
++ setName(kip->ki_comm);
++ setPid(pid);
++
++ setUserId(kip->ki_uid);
++ readUserName();
++
++ free(kip);
++
++ return true;
++ }
++
++ virtual bool readArguments(int pid)
++ {
++ char args[ARG_MAX];
++ int name[4];
++ size_t len;
++
++ name[0] = CTL_KERN;
++ name[1] = KERN_PROC;
++ name[2] = KERN_PROC_ARGS;
++ name[3] = pid;
++
++ len = sizeof(args);
++ if (sysctl(name, 4, args, &len, NULL, 0) < 0);
++ return false;
++
++ for (char *cp = args; cp < args + len; cp += strlen(cp) + 1)
++ addArgument(QString(cp));
++
++ return true;
++ }
++
++ virtual bool readEnvironment(int /*pid*/)
++ {
++ // Not supported in FreeBSD
++ return true;
++ }
++
++ virtual bool readCurrentDir(int pid)
++ {
++ struct kinfo_file *kif;
++ int count;
++
++ kif = kinfo_getfile(pid, &count);
++ if (kif == NULL)
++ return false;
++
++ for (int i = 0; i < count; i++) {
++ if (kif[i].kf_fd == KF_FD_TYPE_CWD) {
++ QFileInfo info(QString(kif[i].kf_path));
++ free(kif);
++
++ const bool readable = info.isReadable();
++
++ if (readable) {
++ if(info.isSymLink())
++ setCurrentDir(info.symLinkTarget());
++ else
++ setCurrentDir(info.filePath());
++ return true;
++ } else {
++ if (!readable)
++ setError(PermissionsError);
++ else
++ setError(UnknownError);
++
++ return false;
++ }
++ }
++ }
++ }
++};
++#endif
++
+ SSHProcessInfo::SSHProcessInfo(const ProcessInfo& process)
+ : _process(process)
+ {
+@@ -802,6 +924,8 @@
+ return new LinuxProcessInfo(pid,enableEnvironmentRead);
+ #elif defined(Q_OS_SOLARIS)
+ return new SolarisProcessInfo(pid,enableEnvironmentRead);
++#elif defined(Q_OS_FREEBSD)
++ return new FreeBSDProcessInfo(pid,enableEnvironmentRead);
+ #else
+ return new NullProcessInfo(pid,enableEnvironmentRead);
+ #endif
diff --git a/x11/kdebase4/Makefile b/x11/kdebase4/Makefile
index 99dd3ec510bf..e14ba617f177 100644
--- a/x11/kdebase4/Makefile
+++ b/x11/kdebase4/Makefile
@@ -8,7 +8,7 @@
PORTNAME= kdebase
PORTVERSION= ${KDE4_VERSION}
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= x11 kde
MASTER_SITES= ${MASTER_SITE_KDE}
MASTER_SITE_SUBDIR= ${KDE4_BRANCH}/${PORTVERSION}/src
diff --git a/x11/kdebase4/files/patch-apps-konsole-src-ProcessInfo.cpp b/x11/kdebase4/files/patch-apps-konsole-src-ProcessInfo.cpp
new file mode 100644
index 000000000000..34dd2af1bd30
--- /dev/null
+++ b/x11/kdebase4/files/patch-apps-konsole-src-ProcessInfo.cpp
@@ -0,0 +1,147 @@
+--- apps/konsole/src/ProcessInfo.cpp.orig 2009-04-15 12:25:25.000000000 +0200
++++ apps/konsole/src/ProcessInfo.cpp 2009-08-14 03:00:37.000000000 +0200
+@@ -27,6 +27,14 @@
+ #include <unistd.h>
+ #include <pwd.h>
+
++// FreeBSD
++#ifdef Q_OS_FREEBSD
++#include <sys/param.h>
++#include <sys/sysctl.h>
++#include <sys/user.h>
++#include <libutil.h>
++#endif
++
+ // Qt
+ #include <KDebug>
+ #include <QtCore/QDir>
+@@ -657,6 +665,120 @@
+ }
+ } ;
+
++#ifdef Q_OS_FREEBSD
++class FreeBSDProcessInfo : public UnixProcessInfo
++{
++public:
++ FreeBSDProcessInfo(int pid, bool readEnvironment)
++ : UnixProcessInfo(pid,readEnvironment)
++ {
++ }
++private:
++ virtual bool readProcInfo(int pid)
++ {
++ struct kinfo_proc *kip;
++ int name[4];
++ size_t len;
++
++ name[0] = CTL_KERN;
++ name[1] = KERN_PROC;
++ name[2] = KERN_PROC_PID;
++ name[3] = pid;
++
++ len = 0;
++ if (sysctl(name, 4, NULL, &len, NULL, 0) < 0)
++ return false;
++
++ kip = static_cast<struct kinfo_proc*>(malloc(len));
++ if (kip == NULL)
++ return false;
++
++ if (sysctl(name, 4, kip, &len, NULL, 0) < 0) {
++ free(kip);
++ return false;
++ }
++
++ if (len != sizeof(*kip) || (kip->ki_structsize != sizeof(*kip)) || (kip->ki_pid != pid)) {
++ free(kip);
++ return false;
++ }
++
++ setParentPid(kip->ki_ppid);
++ setForegroundPid(kip->ki_pgid);
++ setName(kip->ki_comm);
++ setPid(pid);
++
++ setUserId(kip->ki_uid);
++ readUserName();
++
++ free(kip);
++
++ return true;
++ }
++
++ virtual bool readArguments(int pid)
++ {
++ char args[ARG_MAX];
++ int name[4];
++ size_t len;
++
++ name[0] = CTL_KERN;
++ name[1] = KERN_PROC;
++ name[2] = KERN_PROC_ARGS;
++ name[3] = pid;
++
++ len = sizeof(args);
++ if (sysctl(name, 4, args, &len, NULL, 0) < 0);
++ return false;
++
++ for (char *cp = args; cp < args + len; cp += strlen(cp) + 1)
++ addArgument(QString(cp));
++
++ return true;
++ }
++
++ virtual bool readEnvironment(int /*pid*/)
++ {
++ // Not supported in FreeBSD
++ return true;
++ }
++
++ virtual bool readCurrentDir(int pid)
++ {
++ struct kinfo_file *kif;
++ int count;
++
++ kif = kinfo_getfile(pid, &count);
++ if (kif == NULL)
++ return false;
++
++ for (int i = 0; i < count; i++) {
++ if (kif[i].kf_fd == KF_FD_TYPE_CWD) {
++ QFileInfo info(QString(kif[i].kf_path));
++ free(kif);
++
++ const bool readable = info.isReadable();
++
++ if (readable) {
++ if(info.isSymLink())
++ setCurrentDir(info.symLinkTarget());
++ else
++ setCurrentDir(info.filePath());
++ return true;
++ } else {
++ if (!readable)
++ setError(PermissionsError);
++ else
++ setError(UnknownError);
++
++ return false;
++ }
++ }
++ }
++ }
++};
++#endif
++
+ SSHProcessInfo::SSHProcessInfo(const ProcessInfo& process)
+ : _process(process)
+ {
+@@ -802,6 +924,8 @@
+ return new LinuxProcessInfo(pid,enableEnvironmentRead);
+ #elif defined(Q_OS_SOLARIS)
+ return new SolarisProcessInfo(pid,enableEnvironmentRead);
++#elif defined(Q_OS_FREEBSD)
++ return new FreeBSDProcessInfo(pid,enableEnvironmentRead);
+ #else
+ return new NullProcessInfo(pid,enableEnvironmentRead);
+ #endif