diff options
author | will <will@FreeBSD.org> | 2003-11-09 07:40:29 +0000 |
---|---|---|
committer | will <will@FreeBSD.org> | 2003-11-09 07:40:29 +0000 |
commit | 270271ddc29f92edbffed23b371f2187ac9347d2 (patch) | |
tree | 41408e597afe221dcb6caced3d576666befd9d8f /deskutils/superkaramba/files | |
parent | aaade520292d056fb1098fc7456dfba2e416f43e (diff) | |
download | FreeBSD-ports-270271ddc29f92edbffed23b371f2187ac9347d2.zip FreeBSD-ports-270271ddc29f92edbffed23b371f2187ac9347d2.tar.gz |
Add superkaramba 0.33, a KDE tool that allows interactive eye-candy
on the desktop.
PR: 56493
Submitted by: Markus Brueffer <brueffer@phoenix-systems.de>
Diffstat (limited to 'deskutils/superkaramba/files')
-rw-r--r-- | deskutils/superkaramba/files/patch-configure | 11 | ||||
-rw-r--r-- | deskutils/superkaramba/files/patch-cpusensor.cpp | 53 | ||||
-rw-r--r-- | deskutils/superkaramba/files/patch-karamba.cpp | 29 | ||||
-rw-r--r-- | deskutils/superkaramba/files/patch-memsensor.cpp | 261 | ||||
-rw-r--r-- | deskutils/superkaramba/files/patch-memsensor.h | 42 | ||||
-rw-r--r-- | deskutils/superkaramba/files/patch-networksensor.cpp | 107 | ||||
-rw-r--r-- | deskutils/superkaramba/files/patch-networksensor.h | 27 | ||||
-rw-r--r-- | deskutils/superkaramba/files/patch-sensorsensor.cpp | 63 | ||||
-rw-r--r-- | deskutils/superkaramba/files/patch-sensorsensor.h | 12 | ||||
-rw-r--r-- | deskutils/superkaramba/files/patch-src::Makefile.in | 11 | ||||
-rw-r--r-- | deskutils/superkaramba/files/patch-uptimesensor.cpp | 74 |
11 files changed, 690 insertions, 0 deletions
diff --git a/deskutils/superkaramba/files/patch-configure b/deskutils/superkaramba/files/patch-configure new file mode 100644 index 0000000..af972e3 --- /dev/null +++ b/deskutils/superkaramba/files/patch-configure @@ -0,0 +1,11 @@ +--- configure.orig Mon Oct 20 05:45:57 2003 ++++ configure Mon Oct 20 05:49:00 2003 +@@ -31352,7 +31352,7 @@ + ac_save_libs="$LIBS" + LIBS="`xmms-config --libs`" + ac_CPPFLAGS_save="$CPPFLAGS" +- CPPFLAGS="$CPPFLAGS $all_includes `xmms-config --cflags`" ++ CPPFLAGS="$CPPFLAGS $all_includes `xmms-config --cflags` $LIBPTHREAD" + ac_LDFLAGS_save="$LDFLAGS" + LDFLAGS="$LDFLAGS $all_libraries" + cat >conftest.$ac_ext <<_ACEOF diff --git a/deskutils/superkaramba/files/patch-cpusensor.cpp b/deskutils/superkaramba/files/patch-cpusensor.cpp new file mode 100644 index 0000000..b52b696 --- /dev/null +++ b/deskutils/superkaramba/files/patch-cpusensor.cpp @@ -0,0 +1,53 @@ +--- src/cpusensor.cpp.orig Mon Apr 21 15:17:03 2003 ++++ src/cpusensor.cpp Wed Aug 27 16:27:57 2003 +@@ -8,6 +8,14 @@ + * (at your option) any later version. * + ***************************************************************************/ + ++#ifdef __FreeBSD__ ++#include <sys/time.h> ++#include <sys/dkstat.h> ++#include <sys/param.h> ++#include <sys/sysctl.h> ++#include <sys/resource.h> ++#endif ++ + #include "cpusensor.h" + + CPUSensor::CPUSensor( QString cpu, int interval ) : Sensor( interval ) +@@ -24,6 +32,19 @@ + + void CPUSensor::getTicks (long &u,long &s,long &n,long &i) + { ++#ifdef __FreeBSD__ ++ static long cp_time[CPUSTATES]; ++ ++ size_t size = sizeof(cp_time); ++ ++ /* get the cp_time array */ ++ if (sysctlbyname("kern.cp_time", &cp_time, &size, NULL, 0) != -1) { ++ u = cp_time[CP_USER]; ++ s = cp_time[CP_SYS] + cp_time[CP_INTR]; ++ n = cp_time[CP_NICE]; ++ i = cp_time[CP_IDLE]; ++ } ++#else + QFile file("/proc/stat"); + QString line; + if ( file.open(IO_ReadOnly | IO_Translate) ) +@@ -46,6 +67,7 @@ + i = rx.cap(4).toLong(); + file.close(); + } ++#endif + else + { + u = 0; +@@ -53,7 +75,6 @@ + n = 0; + i = 0; + } +- + } + + int CPUSensor::getCPULoad() diff --git a/deskutils/superkaramba/files/patch-karamba.cpp b/deskutils/superkaramba/files/patch-karamba.cpp new file mode 100644 index 0000000..9dfb420 --- /dev/null +++ b/deskutils/superkaramba/files/patch-karamba.cpp @@ -0,0 +1,29 @@ +--- src/karamba.cpp.orig 2003-11-07 01:15:20.000000000 -0500 ++++ src/karamba.cpp 2003-11-07 02:30:39.000000000 -0500 +@@ -2662,6 +2662,26 @@ + + } + ++ if( getBoolean("RIGHTBAR", line ) ) ++ { ++ int dw = QApplication::desktop()->width(); ++ move( dw - w, y ); ++ KWin::setStrut( winId(), 0, w, 0, 0 ); ++ toggleLocked->setChecked( true ); ++ slotToggleLocked(); ++ toggleLocked->setEnabled(false); ++ ++ } ++ if( getBoolean("LEFTBAR", line) ) ++ { ++ int dw = QApplication::desktop()->width(); ++ move( 0, y ); ++ KWin::setStrut( winId(), w, 0, 0, 0 ); ++ toggleLocked->setChecked( true ); ++ slotToggleLocked(); ++ toggleLocked->setEnabled(false); ++ ++ } + + bool found = false; + QString path = getString( "MASK", line, found ); diff --git a/deskutils/superkaramba/files/patch-memsensor.cpp b/deskutils/superkaramba/files/patch-memsensor.cpp new file mode 100644 index 0000000..bc030ef --- /dev/null +++ b/deskutils/superkaramba/files/patch-memsensor.cpp @@ -0,0 +1,261 @@ +--- src/memsensor.cpp.orig Mon Apr 21 15:17:03 2003 ++++ src/memsensor.cpp Fri Sep 5 12:07:36 2003 +@@ -12,63 +12,202 @@ + #include <qtextstream.h> + #include <qstring.h> + #include <qregexp.h> ++ ++#ifdef __FreeBSD__ ++#include <sys/time.h> ++#include <sys/param.h> ++#include <sys/sysctl.h> ++#include <sys/resource.h> ++#include <unistd.h> ++#include <kvm.h> ++#include <sys/file.h> ++#include <osreldate.h> ++ ++/* define pagetok in terms of pageshift */ ++#define pagetok(size) ((size) << pageshift) ++#endif ++ + MemSensor::MemSensor(int msec) : Sensor(msec) + { ++#ifdef __FreeBSD__ ++ /* get the page size with "getpagesize" and calculate pageshift from it */ ++ int pagesize = getpagesize(); ++ pageshift = 0; ++ while (pagesize > 1) ++ { ++ pageshift++; ++ pagesize >>= 1; ++ } ++ ++ /* we only need the amount of log(2)1024 for our conversion */ ++ pageshift -= 10; ++ ++# if __FreeBSD_version < 500018 ++ connect(&ksp, SIGNAL(receivedStdout(KProcess *, char *, int )), ++ this,SLOT(receivedStdout(KProcess *, char *, int ))); ++ connect(&ksp, SIGNAL(processExited(KProcess *)), ++ this,SLOT(processExited( KProcess * ))); ++ ++ swapTotal = swapUsed = 0; ++ ++ MaxSet = false; ++ + readValues(); ++# else ++ kd = kvm_open("/dev/null", "/dev/null", "/dev/null", O_RDONLY, "kvm_open"); ++# endif ++#else ++ readValues(); ++#endif + } ++ + MemSensor::~MemSensor() + {} + ++#ifdef __FreeBSD__ ++void MemSensor::receivedStdout(KProcess *, char *buffer, int len ) ++{ ++ buffer[len] = 0; ++ sensorResult += QString( QCString(buffer) ); ++} ++ ++void MemSensor::processExited(KProcess *) ++{ ++ QStringList stringList = QStringList::split('\n',sensorResult); ++ sensorResult = ""; ++ QStringList itemsList = QStringList::split(' ', stringList[1]); ++ ++ swapUsed = itemsList[2].toInt(); ++ swapTotal = itemsList[1].toInt(); ++} ++#endif + + int MemSensor::getMemTotal() + { ++#ifdef __FreeBSD__ ++ static int mem = 0; ++ size_t size = sizeof(mem); ++ ++ sysctlbyname("hw.physmem", &mem, &size, NULL, 0); ++ return (mem / 1024); ++#else + QRegExp rx( "MemTotal:\\s*(\\d+)" ); + rx.search( meminfo ); + return ( rx.cap(1).toInt() ); ++#endif + } + + int MemSensor::getMemFree() + { ++#ifdef __FreeBSD__ ++ static int mem = 0; ++ size_t size = sizeof(mem); ++ ++ sysctlbyname("vm.stats.vm.v_free_count", &mem, &size, NULL, 0); ++ return (pagetok(mem)); ++#else + QRegExp rx( "MemFree:\\s*(\\d+)" ); + rx.search( meminfo ); + return ( rx.cap(1).toInt() ); ++#endif + } + + + int MemSensor::getBuffers() + { ++#ifdef __FreeBSD__ ++ static int mem = 0; ++ size_t size = sizeof(mem); ++ ++ sysctlbyname("vfs.bufspace", &mem, &size, NULL, 0); ++ return (mem / 1024); ++#else + QRegExp rx( "Buffers:\\s*(\\d+)" ); + rx.search( meminfo ); + return ( rx.cap(1).toInt() ); ++#endif + } + + int MemSensor::getCached() + { ++#ifdef __FreeBSD__ ++ static int mem = 0; ++ size_t size = sizeof(mem); ++ ++ sysctlbyname("vm.stats.vm.v_cache_count", &mem, &size, NULL, 0); ++ return (pagetok(mem)); ++#else + QRegExp rx1( "Cached:\\s*(\\d+)" ); + QRegExp rx2( "SwapCached:\\s*(\\d+)" ); + rx1.search( meminfo ); + rx2.search( meminfo ); + return ( rx1.cap(1).toInt() + rx2.cap(1).toInt() ); ++#endif + } + + + int MemSensor::getSwapTotal() + { ++#ifdef __FreeBSD__ ++# if __FreeBSD_version < 500018 ++ return(swapTotal); ++# else ++ int n = -1; ++ int pagesize = getpagesize(); ++ int retavail = 0; ++ ++ if (kd != NULL) ++ n = kvm_getswapinfo(kd, &swapinfo, 1, 0); ++ ++ if (n < 0 || swapinfo.ksw_total == 0) ++ return(0); ++ ++ retavail = swapinfo.ksw_total * pagesize / 1024; ++ ++ return(retavail); ++# endif ++#else + QRegExp rx( "SwapTotal:\\s*(\\d+)" ); + rx.search( meminfo ); + return ( rx.cap(1).toInt() ); ++#endif + } + + int MemSensor::getSwapFree() + { ++#ifdef __FreeBSD__ ++# if __FreeBSD_version < 500018 ++ return(swapTotal - swapUsed); ++# else ++ int n = -1; ++ int pagesize = getpagesize(); ++ int retfree = 0; ++ ++ if (kd != NULL) ++ n = kvm_getswapinfo(kd, &swapinfo, 1, 0); ++ if (n < 0 || swapinfo.ksw_total == 0) ++ return(0); ++ ++ retfree = (swapinfo.ksw_total - swapinfo.ksw_used) * pagesize / 1024; ++ ++ return(retfree); ++# endif ++#else + QRegExp rx( "SwapFree:\\s*(\\d+)" ); + rx.search( meminfo ); + return ( rx.cap(1).toInt() ); ++#endif + } + +- + void MemSensor::readValues() + { ++#ifdef __FreeBSD__ ++# if __FreeBSD_version < 500018 ++ ksp.clearArguments(); ++ ksp << "swapinfo"; ++ ksp.start( KProcess::NotifyOnExit,KProcIO::Stdout); ++# endif ++#else + QFile file("/proc/meminfo"); + QString line; + if ( file.open(IO_ReadOnly | IO_Translate) ) +@@ -77,15 +216,21 @@ + meminfo = t.read(); + file.close(); + } ++#endif + } + + void MemSensor::update() + { ++#if (defined(__FreeBSD__) && __FreeBSD_version < 500018) + readValues(); ++#endif + QString format; + SensorParams *sp; + Meter *meter; + QObjectListIt it( *objList ); ++#if (defined(__FreeBSD__) && __FreeBSD_version < 500018) ++ bool set = false; ++#endif + + int totalMem = getMemTotal(); + int usedMem = totalMem - getMemFree(); +@@ -96,6 +241,12 @@ + while (it != 0) + { + sp = (SensorParams*)(*it); ++#if (defined(__FreeBSD__) && __FreeBSD_version < 500018) ++ if ( (!MaxSet) && (totalSwap > 0) ) { ++ setMaxValue(sp); ++ bool set = true; ++ } ++#endif + meter = sp->getMeter(); + format = sp->getParam("FORMAT"); + if (format.length() == 0 ) +@@ -118,6 +269,11 @@ + meter->setValue(format); + ++it; + } ++#if (defined(__FreeBSD__) && __FreeBSD_version < 500018) ++ if (set) ++ MaxSet = true; ++#endif ++ + } + + void MemSensor::setMaxValue( SensorParams *sp ) +@@ -133,7 +289,6 @@ + } + if( f=="%fm" || f== "%um" || f=="%fmb" || f=="%umb" ) + meter->setMax( getMemTotal() / 1024 ); +- + if( f=="%fs" || f== "%us" ) + meter->setMax( getSwapTotal() / 1024 ); + } diff --git a/deskutils/superkaramba/files/patch-memsensor.h b/deskutils/superkaramba/files/patch-memsensor.h new file mode 100644 index 0000000..9a5e8fb --- /dev/null +++ b/deskutils/superkaramba/files/patch-memsensor.h @@ -0,0 +1,42 @@ +--- src/memsensor.h.orig Mon Apr 21 15:17:03 2003 ++++ src/memsensor.h Fri Sep 5 12:08:46 2003 +@@ -12,6 +12,12 @@ + #include "sensor.h" + #include <qstring.h> + #include <qregexp.h> ++#ifdef __FreeBSD__ ++#include <kprocess.h> ++#include <kprocio.h> ++#include <kvm.h> ++#include <osreldate.h> ++#endif + + class MemSensor : public Sensor + { +@@ -36,6 +42,26 @@ + private: + QString meminfo; + void readValues(); ++#ifdef __FreeBSD__ ++ int pageshift; /* log base 2 of the pagesize */ ++ QString sensorResult; ++ int swapTotal; ++ int swapUsed; ++ ++# if __FreeBSD_version < 500018 ++ KShellProcess ksp; ++ bool MaxSet; ++ ++# else ++ kvm_t *kd; ++ kvm_swap swapinfo; ++# endif ++ ++private slots: ++ void receivedStdout(KProcess *, char *buffer, int); ++ void processExited(KProcess *); ++ ++#endif + }; + + #endif // MEMSENSOR_H diff --git a/deskutils/superkaramba/files/patch-networksensor.cpp b/deskutils/superkaramba/files/patch-networksensor.cpp new file mode 100644 index 0000000..413d1f9 --- /dev/null +++ b/deskutils/superkaramba/files/patch-networksensor.cpp @@ -0,0 +1,107 @@ +--- src/networksensor.cpp.orig Mon Apr 21 15:17:03 2003 ++++ src/networksensor.cpp Sat Nov 8 19:51:04 2003 +@@ -7,14 +7,67 @@ + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ ++#ifdef __FreeBSD__ ++#include <sys/param.h> ++#include <sys/sysctl.h> ++#include <sys/socket.h> ++#include <net/route.h> ++#endif ++ ++#include <stdio.h> + #include "networksensor.h" + + NetworkSensor::NetworkSensor( QString dev, int interval ):Sensor( interval ) + { + device = dev.lower(); ++ ++#ifdef __FreeBSD__ ++ /* Determine number of interfaces */ ++ u_int n = 0; ++ size_t nlen = 0; ++ nlen = sizeof(n); ++ sysctlbyname("net.link.generic.system.ifcount", &n, &nlen, NULL, 0); ++ ++ size_t if_miblen = 0; ++ if_miblen = sizeof(if_mib); ++ static int name[] = { CTL_NET, ++ PF_LINK, ++ NETLINK_GENERIC, ++ IFMIB_IFDATA, ++ 0, ++ IFDATA_GENERAL }; ++ ++ /* ++ If the device was defined by the theme, find the right devicenumber. ++ If not, use the device that holds the default route. ++ */ ++ ++ if_number = -1; ++ ++ for (int i = 1; i <= n; ++i) { ++ name[4] = i; ++ /* Get data for iface-number i */ ++ sysctl(name, 6, (void*)&if_mib, (size_t*)&if_miblen, (void*)NULL, (size_t)0); ++ ++ if ( device == "" ) { ++ /* Does the interface hold the default route? */ ++ if ( if_mib.ifmd_flags & RTF_GATEWAY ) { ++ if_number = i; ++ break; ++ } ++ } ++ else { ++ /* We found the right interface? */ ++ if (QString(if_mib.ifmd_name) == device) { ++ if_number = i; ++ break; ++ } ++ } ++ } ++#else + if( device == "" ) + device = "eth0"; +- ++#endif + getInOutBytes(receivedBytes,transmittedBytes); + netTimer.start(); + +@@ -24,6 +77,27 @@ + } + void NetworkSensor::getInOutBytes ( unsigned long &in,unsigned long &out) const + { ++#ifdef __FreeBSD__ ++ if (if_number != -1) { ++ size_t if_miblen = 0; ++ if_miblen = sizeof(if_mib); ++ static int name[] = { CTL_NET, ++ PF_LINK, ++ NETLINK_GENERIC, ++ IFMIB_IFDATA, ++ if_number, ++ IFDATA_GENERAL }; ++ ++ sysctl(name, 6, (void*)&if_mib, (size_t*)&if_miblen, (void*)NULL, (size_t)0); ++ ++ in = if_mib.ifmd_data.ifi_ibytes; ++ out = if_mib.ifmd_data.ifi_obytes; ++ } ++ else { ++ in = 0; ++ out = 0; ++ } ++#else + QFile file("/proc/net/dev"); + QString line; + if ( file.open(IO_ReadOnly | IO_Translate) ) +@@ -49,6 +123,7 @@ + } + file.close(); + } ++#endif + } + + void NetworkSensor::update() diff --git a/deskutils/superkaramba/files/patch-networksensor.h b/deskutils/superkaramba/files/patch-networksensor.h new file mode 100644 index 0000000..14fb452 --- /dev/null +++ b/deskutils/superkaramba/files/patch-networksensor.h @@ -0,0 +1,27 @@ +--- src/networksensor.h.orig Mon Apr 21 15:17:03 2003 ++++ src/networksensor.h Wed Aug 27 16:36:58 2003 +@@ -15,6 +15,12 @@ + #include <qdatetime.h> + #include <qfile.h> + #include <qregexp.h> ++#ifdef __FreeBSD__ ++#include <sys/types.h> ++#include <sys/socket.h> ++#include <net/if.h> ++#include <net/if_mib.h> ++#endif + + class NetworkSensor : public Sensor + { +@@ -30,7 +36,10 @@ + unsigned long transmittedBytes; + QTime netTimer; + QString device; +- ++#ifdef __FreeBSD__ ++ int if_number; ++ ifmibdata if_mib; ++#endif + void getInOutBytes (unsigned long &in,unsigned long &out) const; + + }; diff --git a/deskutils/superkaramba/files/patch-sensorsensor.cpp b/deskutils/superkaramba/files/patch-sensorsensor.cpp new file mode 100644 index 0000000..d0aef9f --- /dev/null +++ b/deskutils/superkaramba/files/patch-sensorsensor.cpp @@ -0,0 +1,63 @@ +--- src/sensorsensor.cpp.orig Mon Apr 21 15:17:03 2003 ++++ src/sensorsensor.cpp Fri Sep 5 15:07:50 2003 +@@ -12,6 +12,22 @@ + + SensorSensor::SensorSensor( int interval ) : Sensor( interval ) + { ++#ifdef __FreeBSD__ ++ sensorMapBSD["VCore 1"] = "VC0"; ++ sensorMapBSD["VCore 2"] = "VC1"; ++ sensorMapBSD["+3.3V"] = "V33"; ++ sensorMapBSD["+5V"] = "V50P"; ++ sensorMapBSD["+12V"] = "V12P"; ++ sensorMapBSD["-12V"] = "V12N"; ++ sensorMapBSD["-5V"] = "V50N"; ++ sensorMapBSD["fan1"] = "FAN0"; ++ sensorMapBSD["fan2"] = "FAN1"; ++ sensorMapBSD["fan3"] = "FAN2"; ++ sensorMapBSD["temp1"] = "TEMP0"; ++ sensorMapBSD["temp2"] = "TEMP1"; ++ sensorMapBSD["temp3"] = "TEMP2"; ++#endif ++ + connect(&ksp, SIGNAL(receivedStdout(KProcess *, char *, int )), + this,SLOT(receivedStdout(KProcess *, char *, int ))); + connect(&ksp, SIGNAL(processExited(KProcess *)), +@@ -36,8 +52,11 @@ + QStringList stringList = QStringList::split('\n',sensorResult); + sensorResult = ""; + QStringList::Iterator it = stringList.begin(); ++#ifdef __FreeBSD__ ++ QRegExp rx( "^(\\S+)\\s+:\\s+[\\+\\-]?(\\d+\\.?\\d*)"); ++#else + QRegExp rx( "^(\\S+):\\s+[\\+\\-]?(\\d+\\.?\\d*)"); +- ++#endif + while( it != stringList.end()) + { + rx.search( *it ); +@@ -69,7 +88,12 @@ + { + format = "%v"; + } ++ ++#ifdef __FreeBSD__ ++ format.replace( QRegExp("%v", false), sensorMap[sensorMapBSD[type]]); ++#else + format.replace( QRegExp("%v", false), sensorMap[type]); ++#endif + meter->setValue(format); + ++lit; + } +@@ -78,7 +102,11 @@ + void SensorSensor::update() + { + ksp.clearArguments(); ++#ifdef __FreeBSD__ ++ ksp << "mbmon -r -c 1"; ++#else + ksp << "sensors"; ++#endif + ksp.start( KProcess::NotifyOnExit,KProcIO::Stdout); + } + diff --git a/deskutils/superkaramba/files/patch-sensorsensor.h b/deskutils/superkaramba/files/patch-sensorsensor.h new file mode 100644 index 0000000..3423c38 --- /dev/null +++ b/deskutils/superkaramba/files/patch-sensorsensor.h @@ -0,0 +1,12 @@ +--- src/sensorsensor.h.orig Fri Sep 5 15:00:20 2003 ++++ src/sensorsensor.h Fri Sep 5 15:12:17 2003 +@@ -32,6 +32,9 @@ + KShellProcess ksp; + + QMap<QString,QString> sensorMap; ++#ifdef __FreeBSD__ ++ QMap<QString,QString> sensorMapBSD; ++#endif + QString sensorResult; + + private slots: diff --git a/deskutils/superkaramba/files/patch-src::Makefile.in b/deskutils/superkaramba/files/patch-src::Makefile.in new file mode 100644 index 0000000..a74264a --- /dev/null +++ b/deskutils/superkaramba/files/patch-src::Makefile.in @@ -0,0 +1,11 @@ +--- src/Makefile.in.orig Mon Oct 20 04:58:41 2003 ++++ src/Makefile.in Mon Oct 20 04:59:19 2003 +@@ -261,7 +261,7 @@ + # the application source, library search path, and link libraries + superkaramba_SOURCES = main.cpp karamba.cpp meter.h meter.cpp bar.h bar.cpp sensor.h sensor.cpp datesensor.h datesensor.cpp textlabel.h textlabel.cpp memsensor.h memsensor.cpp uptimesensor.h uptimesensor.cpp cpusensor.h cpusensor.cpp networksensor.h networksensor.cpp imagelabel.h imagelabel.cpp graph.h graph.cpp xmmssensor.h xmmssensor.cpp programsensor.h programsensor.cpp disksensor.h disksensor.cpp sensorparams.h sensorparams.cpp sensorsensor.h sensorsensor.cpp textfilesensor.h textfilesensor.cpp clickarea.h clickarea.cpp noatunsensor.h noatunsensor.cpp karambarootpixmap.h karambarootpixmap.cpp clickmap.h clickmap.cpp rsssensor.h rsssensor.cpp textfield.h textfield.cpp taskmanager.h taskmanager.cpp showdesktop.h showdesktop.cpp richtextlabel.h richtextlabel.cpp karambasessionmanaged.h karambasessionmanaged.cpp welcomeform.h welcomeform.cpp systemtray.h systemtray.cpp + superkaramba_LDFLAGS = -Wl,-export-dynamic $(KDE_RPATH) $(all_libraries) $(PYTHONLIB) +-superkaramba_LDADD = -lkio -lXpm $(LIB_KDEUI) $(XMMS_LIBS) $(LIBPYTHON) ++superkaramba_LDADD = -lkio -lXpm $(LIB_KDEUI) $(XMMS_LIBS) $(LIBPYTHON) -lkvm + + # this is where the desktop file will go + shelldesktopdir = $(kde_appsdir)/Utilities diff --git a/deskutils/superkaramba/files/patch-uptimesensor.cpp b/deskutils/superkaramba/files/patch-uptimesensor.cpp new file mode 100644 index 0000000..9fcccdd --- /dev/null +++ b/deskutils/superkaramba/files/patch-uptimesensor.cpp @@ -0,0 +1,74 @@ +--- src/uptimesensor.cpp.orig Wed Aug 27 01:32:14 2003 ++++ src/uptimesensor.cpp Wed Aug 27 02:34:41 2003 +@@ -7,6 +7,11 @@ + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ ++#ifdef __FreeBSD__ ++#include <sys/time.h> ++#include <sys/sysctl.h> ++#endif ++ + #include "uptimesensor.h" + + UptimeSensor::UptimeSensor( int interval ) : Sensor( interval ) +@@ -16,6 +21,42 @@ + + void UptimeSensor::update() + { ++#ifdef __FreeBSD__ ++ struct timeval boottime; ++ time_t now; /* the current time of day */ ++ ++ double avenrun[3]; ++ time_t uptime; ++ int days, hours, i, mins, secs; ++ int mib[2]; ++ size_t size; ++ char buf[256]; ++ ++ /* ++ * Get time of day. ++ */ ++ (void)time(&now); ++ ++ /* ++ * Determine how long system has been up. ++ * (Found by looking getting "boottime" from the kernel) ++ */ ++ mib[0] = CTL_KERN; ++ mib[1] = KERN_BOOTTIME; ++ size = sizeof(boottime); ++ if (sysctl(mib, 2, &boottime, &size, NULL, 0) != -1 && ++ boottime.tv_sec != 0) { ++ uptime = now - boottime.tv_sec; ++ if (uptime > 60) ++ uptime += 30; ++ days = uptime / 86400; ++ uptime %= 86400; ++ hours = uptime / 3600; ++ uptime %= 3600; ++ mins = uptime / 60; ++ secs = uptime % 60; ++ } ++#else + QFile file("/proc/uptime"); + QString line; + if ( file.open(IO_ReadOnly | IO_Translate) ) +@@ -35,7 +76,7 @@ + int mins = uptime / 60; + uptime -= mins * 60; + int secs = uptime; +- ++#endif + + QString format; + SensorParams *sp; +@@ -63,5 +104,7 @@ + meter->setValue(format); + ++it; + } ++#ifndef __FreeBSD__ + } ++#endif + } |