diff options
author | markus <markus@FreeBSD.org> | 2009-08-21 23:07:14 +0800 |
---|---|---|
committer | markus <markus@FreeBSD.org> | 2009-08-21 23:07:14 +0800 |
commit | 209810428d2f57b7733ab762d37f451726a46bbf (patch) | |
tree | 4bc0ba23c1d99fcebe27625d83ad478074d89a58 /x11 | |
parent | 9b26db8e1d3525351693c5161bf3be9e51564bcc (diff) | |
download | freebsd-ports-gnome-209810428d2f57b7733ab762d37f451726a46bbf.tar.gz freebsd-ports-gnome-209810428d2f57b7733ab762d37f451726a46bbf.tar.zst freebsd-ports-gnome-209810428d2f57b7733ab762d37f451726a46bbf.zip |
- Implement/Add the sensor 'system/uptime' for/to ksysguardd. As intended
sideeffect, this fixes the plasma systemmonitor applets as most of them
were using this sensor internally for management of the sensor list due
to a limitation of ksysguardd. As this sensor didn't exist on FreeBSD,
they showed nada.
- Add a patch from upstream to fix the network part of the plasma
systemmonitor [1]
- Bump PORTREVISION
Obtained from: KDE SVN (rev. 1001470) [1]
7.x testing by: decept on #kde-freebsd (Freenode)
Diffstat (limited to 'x11')
12 files changed, 284 insertions, 0 deletions
diff --git a/x11/kde4-workspace/Makefile b/x11/kde4-workspace/Makefile index 337edf9ce630..3218cd5fcba2 100644 --- a/x11/kde4-workspace/Makefile +++ b/x11/kde4-workspace/Makefile @@ -8,6 +8,7 @@ PORTNAME= kdebase-workspace PORTVERSION= ${KDE4_VERSION} +PORTREVISION= 1 CATEGORIES= x11 kde MASTER_SITES= ${MASTER_SITE_KDE} MASTER_SITE_SUBDIR= ${KDE4_BRANCH}/${PORTVERSION}/src @@ -73,6 +74,7 @@ post-patch: ${PATCH_WRKSRC}/kcontrol/kfontinst/kio/KioFonts.cpp \ ${PATCH_WRKSRC}/kcontrol/kxkb/x11helper.cpp \ ${PATCH_WRKSRC}/kdm/kfrontend/genkdmconf.c + ${CP} ${FILESDIR}/uptime.* ${WRKSRC}/ksysguard/ksysguardd/FreeBSD/ pre-configure: ${REINPLACE_CMD} -e 's|<qhash.h>|<QHash>|'\ diff --git a/x11/kde4-workspace/files/patch-ksysguard-ksysguardd-FreeBSD-CMakeLists.txt b/x11/kde4-workspace/files/patch-ksysguard-ksysguardd-FreeBSD-CMakeLists.txt new file mode 100644 index 000000000000..7fda482f5530 --- /dev/null +++ b/x11/kde4-workspace/files/patch-ksysguard-ksysguardd-FreeBSD-CMakeLists.txt @@ -0,0 +1,12 @@ +--- ksysguard/ksysguardd/FreeBSD/CMakeLists.txt.orig 2009-08-20 20:01:27.000000000 +0200 ++++ ksysguard/ksysguardd/FreeBSD/CMakeLists.txt 2009-08-20 20:01:45.000000000 +0200 +@@ -8,7 +8,8 @@ + logfile.c + Memory.c + netdev.c +- ProcessList.c) ++ ProcessList.c ++ uptime.c) + + TARGET_LINK_LIBRARIES(libksysguardd kvm) + diff --git a/x11/kde4-workspace/files/patch-ksysguard-ksysguardd-modules.h b/x11/kde4-workspace/files/patch-ksysguard-ksysguardd-modules.h new file mode 100644 index 000000000000..ab5a13656157 --- /dev/null +++ b/x11/kde4-workspace/files/patch-ksysguard-ksysguardd-modules.h @@ -0,0 +1,18 @@ +--- ksysguard/ksysguardd/modules.h.orig 2009-08-20 20:02:06.000000000 +0200 ++++ ksysguard/ksysguardd/modules.h 2009-08-20 21:53:11.000000000 +0200 +@@ -59,6 +59,7 @@ + #include "Memory.h" + #include "netdev.h" + #include "ProcessList.h" ++#include "uptime.h" + #endif /* OSTYPE_FreeBSD */ + + #ifdef OSTYPE_Irix +@@ -144,6 +145,7 @@ + { "Memory", initMemory, exitMemory, updateMemory, NULLVVFUNC, 0, NULLTIME }, + { "NetDev", initNetDev, exitNetDev, updateNetDev, checkNetDev, 0, NULLTIME }, + { "ProcessList", initProcessList, exitProcessList, updateProcessList, NULLVVFUNC, 0, NULLTIME }, ++ { "Uptime", initUptime, exitUptime, NULLIVFUNC, NULLVVFUNC, 0, NULLTIME }, + #endif /* OSTYPE_FreeBSD */ + + #ifdef OSTYPE_Irix diff --git a/x11/kde4-workspace/files/patch-plasma-applets-system-monitor-net.cpp b/x11/kde4-workspace/files/patch-plasma-applets-system-monitor-net.cpp new file mode 100644 index 000000000000..4d448a436d35 --- /dev/null +++ b/x11/kde4-workspace/files/patch-plasma-applets-system-monitor-net.cpp @@ -0,0 +1,21 @@ +--- plasma/applets/system-monitor/net.cpp.orig 2009-08-21 01:22:09.000000000 +0200 ++++ plasma/applets/system-monitor/net.cpp 2009-08-21 01:28:00.000000000 +0200 +@@ -26,7 +26,7 @@ + + SM::Net::Net(QObject *parent, const QVariantList &args) + : SM::Applet(parent, args) +- , m_rx("network/interfaces/(\\w+)/transmitter/data") ++ , m_rx("^network/interfaces/(\\w+)/transmitter/data$") + { + setHasConfigurationInterface(true); + resize(234 + 20 + 23, 135 + 20 + 25); +@@ -58,7 +58,8 @@ + connect(engine(), SIGNAL(sourceRemoved(const QString&)), + this, SLOT(sourceRemoved(const QString&))); + if (!engine()->sources().isEmpty()) { +- sourcesAdded(); ++ foreach (const QString& source, engine()->sources()) ++ sourceAdded(source); + } + } + diff --git a/x11/kde4-workspace/files/uptime.c b/x11/kde4-workspace/files/uptime.c new file mode 100644 index 000000000000..4cc921066323 --- /dev/null +++ b/x11/kde4-workspace/files/uptime.c @@ -0,0 +1,58 @@ +/* + KSysGuard, the KDE System Guard + + Copyright (c) 2009 Markus Brueffer <markus@brueffer.de> + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +*/ + +#include <time.h> + +#include "Command.h" +#include "ksysguardd.h" +#include "uptime.h" + +void +initUptime(struct SensorModul* sm) +{ + registerMonitor("system/uptime", "float", printUptime, printUptimeInfo, sm); +} + +void +exitUptime(void) +{ + removeMonitor("system/uptime"); +} + +void +printUptime(const char* c) +{ + struct timespec tp; + float uptime = 0; + + if (clock_gettime(CLOCK_MONOTONIC, &tp) != -1) + uptime = tp.tv_sec + tp.tv_nsec/1000000000.0; + + output("%f\n", uptime); +} + +void +printUptimeInfo(const char* c) +{ + output("System uptime\t0\t0\ts\n"); +} + + diff --git a/x11/kde4-workspace/files/uptime.h b/x11/kde4-workspace/files/uptime.h new file mode 100644 index 000000000000..336e5db031f2 --- /dev/null +++ b/x11/kde4-workspace/files/uptime.h @@ -0,0 +1,31 @@ +/* + KSysGuard, the KDE System Guard + + Copyright (c) 2009 Markus Brueffer <markus@brueffer.de> + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +*/ + +#ifndef _uptime_h_ +#define _uptime_h_ + +void initUptime(struct SensorModul* sm); +void exitUptime(void); + +void printUptime(const char*); +void printUptimeInfo(const char*); + +#endif diff --git a/x11/kdebase4-workspace/Makefile b/x11/kdebase4-workspace/Makefile index 337edf9ce630..3218cd5fcba2 100644 --- a/x11/kdebase4-workspace/Makefile +++ b/x11/kdebase4-workspace/Makefile @@ -8,6 +8,7 @@ PORTNAME= kdebase-workspace PORTVERSION= ${KDE4_VERSION} +PORTREVISION= 1 CATEGORIES= x11 kde MASTER_SITES= ${MASTER_SITE_KDE} MASTER_SITE_SUBDIR= ${KDE4_BRANCH}/${PORTVERSION}/src @@ -73,6 +74,7 @@ post-patch: ${PATCH_WRKSRC}/kcontrol/kfontinst/kio/KioFonts.cpp \ ${PATCH_WRKSRC}/kcontrol/kxkb/x11helper.cpp \ ${PATCH_WRKSRC}/kdm/kfrontend/genkdmconf.c + ${CP} ${FILESDIR}/uptime.* ${WRKSRC}/ksysguard/ksysguardd/FreeBSD/ pre-configure: ${REINPLACE_CMD} -e 's|<qhash.h>|<QHash>|'\ diff --git a/x11/kdebase4-workspace/files/patch-ksysguard-ksysguardd-FreeBSD-CMakeLists.txt b/x11/kdebase4-workspace/files/patch-ksysguard-ksysguardd-FreeBSD-CMakeLists.txt new file mode 100644 index 000000000000..7fda482f5530 --- /dev/null +++ b/x11/kdebase4-workspace/files/patch-ksysguard-ksysguardd-FreeBSD-CMakeLists.txt @@ -0,0 +1,12 @@ +--- ksysguard/ksysguardd/FreeBSD/CMakeLists.txt.orig 2009-08-20 20:01:27.000000000 +0200 ++++ ksysguard/ksysguardd/FreeBSD/CMakeLists.txt 2009-08-20 20:01:45.000000000 +0200 +@@ -8,7 +8,8 @@ + logfile.c + Memory.c + netdev.c +- ProcessList.c) ++ ProcessList.c ++ uptime.c) + + TARGET_LINK_LIBRARIES(libksysguardd kvm) + diff --git a/x11/kdebase4-workspace/files/patch-ksysguard-ksysguardd-modules.h b/x11/kdebase4-workspace/files/patch-ksysguard-ksysguardd-modules.h new file mode 100644 index 000000000000..ab5a13656157 --- /dev/null +++ b/x11/kdebase4-workspace/files/patch-ksysguard-ksysguardd-modules.h @@ -0,0 +1,18 @@ +--- ksysguard/ksysguardd/modules.h.orig 2009-08-20 20:02:06.000000000 +0200 ++++ ksysguard/ksysguardd/modules.h 2009-08-20 21:53:11.000000000 +0200 +@@ -59,6 +59,7 @@ + #include "Memory.h" + #include "netdev.h" + #include "ProcessList.h" ++#include "uptime.h" + #endif /* OSTYPE_FreeBSD */ + + #ifdef OSTYPE_Irix +@@ -144,6 +145,7 @@ + { "Memory", initMemory, exitMemory, updateMemory, NULLVVFUNC, 0, NULLTIME }, + { "NetDev", initNetDev, exitNetDev, updateNetDev, checkNetDev, 0, NULLTIME }, + { "ProcessList", initProcessList, exitProcessList, updateProcessList, NULLVVFUNC, 0, NULLTIME }, ++ { "Uptime", initUptime, exitUptime, NULLIVFUNC, NULLVVFUNC, 0, NULLTIME }, + #endif /* OSTYPE_FreeBSD */ + + #ifdef OSTYPE_Irix diff --git a/x11/kdebase4-workspace/files/patch-plasma-applets-system-monitor-net.cpp b/x11/kdebase4-workspace/files/patch-plasma-applets-system-monitor-net.cpp new file mode 100644 index 000000000000..4d448a436d35 --- /dev/null +++ b/x11/kdebase4-workspace/files/patch-plasma-applets-system-monitor-net.cpp @@ -0,0 +1,21 @@ +--- plasma/applets/system-monitor/net.cpp.orig 2009-08-21 01:22:09.000000000 +0200 ++++ plasma/applets/system-monitor/net.cpp 2009-08-21 01:28:00.000000000 +0200 +@@ -26,7 +26,7 @@ + + SM::Net::Net(QObject *parent, const QVariantList &args) + : SM::Applet(parent, args) +- , m_rx("network/interfaces/(\\w+)/transmitter/data") ++ , m_rx("^network/interfaces/(\\w+)/transmitter/data$") + { + setHasConfigurationInterface(true); + resize(234 + 20 + 23, 135 + 20 + 25); +@@ -58,7 +58,8 @@ + connect(engine(), SIGNAL(sourceRemoved(const QString&)), + this, SLOT(sourceRemoved(const QString&))); + if (!engine()->sources().isEmpty()) { +- sourcesAdded(); ++ foreach (const QString& source, engine()->sources()) ++ sourceAdded(source); + } + } + diff --git a/x11/kdebase4-workspace/files/uptime.c b/x11/kdebase4-workspace/files/uptime.c new file mode 100644 index 000000000000..4cc921066323 --- /dev/null +++ b/x11/kdebase4-workspace/files/uptime.c @@ -0,0 +1,58 @@ +/* + KSysGuard, the KDE System Guard + + Copyright (c) 2009 Markus Brueffer <markus@brueffer.de> + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +*/ + +#include <time.h> + +#include "Command.h" +#include "ksysguardd.h" +#include "uptime.h" + +void +initUptime(struct SensorModul* sm) +{ + registerMonitor("system/uptime", "float", printUptime, printUptimeInfo, sm); +} + +void +exitUptime(void) +{ + removeMonitor("system/uptime"); +} + +void +printUptime(const char* c) +{ + struct timespec tp; + float uptime = 0; + + if (clock_gettime(CLOCK_MONOTONIC, &tp) != -1) + uptime = tp.tv_sec + tp.tv_nsec/1000000000.0; + + output("%f\n", uptime); +} + +void +printUptimeInfo(const char* c) +{ + output("System uptime\t0\t0\ts\n"); +} + + diff --git a/x11/kdebase4-workspace/files/uptime.h b/x11/kdebase4-workspace/files/uptime.h new file mode 100644 index 000000000000..336e5db031f2 --- /dev/null +++ b/x11/kdebase4-workspace/files/uptime.h @@ -0,0 +1,31 @@ +/* + KSysGuard, the KDE System Guard + + Copyright (c) 2009 Markus Brueffer <markus@brueffer.de> + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +*/ + +#ifndef _uptime_h_ +#define _uptime_h_ + +void initUptime(struct SensorModul* sm); +void exitUptime(void); + +void printUptime(const char*); +void printUptimeInfo(const char*); + +#endif |