diff -urN /usr/ports/sysutils/libsysstat/distinfo sysutils/libsysstat/distinfo --- /usr/ports/sysutils/libsysstat/distinfo 1970-01-01 01:00:00.000000000 +0100 +++ sysutils/libsysstat/distinfo 2018-05-26 11:55:05.291823000 +0200 @@ -0,0 +1,3 @@ +TIMESTAMP = 1509028217 +SHA256 (lxqt/libsysstat-0.4.0.tar.xz) = 8fea723545aeb266f1a998d450aa4c985194b8b79d314817c7c2a78e9b4e996b +SIZE (lxqt/libsysstat-0.4.0.tar.xz) = 17716 diff -urN /usr/ports/sysutils/libsysstat/files/config.h.in sysutils/libsysstat/files/config.h.in --- /usr/ports/sysutils/libsysstat/files/config.h.in 1970-01-01 01:00:00.000000000 +0100 +++ sysutils/libsysstat/files/config.h.in 2018-05-13 14:11:50.154407000 +0200 @@ -0,0 +1,3 @@ +#cmakedefine HAVE_SYSCTL_H +#cmakedefine HAVE_IF_H +#cmakedefine HAVE_KVM_H diff -urN /usr/ports/sysutils/libsysstat/files/patch-CMakeLists.txt sysutils/libsysstat/files/patch-CMakeLists.txt --- /usr/ports/sysutils/libsysstat/files/patch-CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100 +++ sysutils/libsysstat/files/patch-CMakeLists.txt 2018-05-13 14:11:50.154482000 +0200 @@ -0,0 +1,32 @@ +--- CMakeLists.txt.orig 2016-12-10 23:50:29 UTC ++++ CMakeLists.txt +@@ -23,6 +23,16 @@ include(LXQtCreatePkgConfigFile) + include(LXQtCreatePortableHeaders) + include(LXQtCompilerSettings NO_POLICY_SCOPE) + ++include(CheckIncludeFiles) ++include(CheckLibraryExists) ++ ++check_include_files("sys/socket.h;net/if.h;net/if_mib.h;net/if_types.h" HAVE_IF_H) ++check_library_exists(kvm kvm_getswapinfo "kvm.h" HAVE_KVM_H) ++check_library_exists(c sysctlbyname "sys/sysctl.h" HAVE_SYSCTL_H) ++ ++configure_file(config.h.in config.h) ++add_definitions("-DHAVE_CONFIG_H=1") ++ + set(CMAKE_AUTOMOC ON) + set(CMAKE_INCLUDE_CURRENT_DIR ON) + +@@ -80,7 +90,11 @@ add_library(${SYSSTAT_LIBRARY_NAME} + ${SYSSTAT_QM_FILES} + ) + +-target_link_libraries(${SYSSTAT_LIBRARY_NAME} Qt5::Core) ++if(HAVE_SYSCTL_H AND HAVE_KVM_H) ++ target_link_libraries(${SYSSTAT_LIBRARY_NAME} c kvm Qt5::Core) ++else() ++ target_link_libraries(${SYSSTAT_LIBRARY_NAME} Qt5::Core) ++endif() + + set_target_properties(${SYSSTAT_LIBRARY_NAME} PROPERTIES + VERSION ${SYSSTAT_VERSION} diff -urN /usr/ports/sysutils/libsysstat/files/patch-cpustat__p.h sysutils/libsysstat/files/patch-cpustat__p.h --- /usr/ports/sysutils/libsysstat/files/patch-cpustat__p.h 1970-01-01 01:00:00.000000000 +0100 +++ sysutils/libsysstat/files/patch-cpustat__p.h 2018-05-13 14:11:50.154710000 +0200 @@ -0,0 +1,73 @@ +--- cpustat_p.h.orig 2016-12-10 23:50:29 UTC ++++ cpustat_p.h +@@ -27,6 +27,9 @@ + #ifndef LIBSYSSTAT__CPU_STAT__PRIVATE__INCLUDED + #define LIBSYSSTAT__CPU_STAT__PRIVATE__INCLUDED + ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif + + #include + #include +@@ -52,6 +55,15 @@ public: + CpuStat::Monitoring monitoring() const; + void setMonitoring(CpuStat::Monitoring value); + ++#ifdef HAVE_SYSCTL_H ++ ulong minFreq(const QString &source) const; ++ ulong maxFreq(const QString &source) const; ++ ++signals: ++ void update(float user, float nice, float system, float idle, float other); ++ void update(ulong frequency); ++ void update(float user, float nice, float system, float idle, float other, ulong frequency); ++#else + uint minFreq(const QString &source) const; + uint maxFreq(const QString &source) const; + +@@ -59,6 +71,7 @@ signals: + void update(float user, float nice, float system, float other); + void update(uint frequency); + void update(float user, float nice, float system, float other, float frequencyRate, uint frequency); ++#endif + + private slots: + void timeout(); +@@ -74,22 +87,35 @@ private: + { + Values(); + ++#ifdef HAVE_SYSCTL_H ++ ulong user; ++ ulong nice; ++ ulong system; ++ ulong idle; ++ ulong other; ++ ulong total; ++#else + qulonglong user; + qulonglong nice; + qulonglong system; + qulonglong idle; + qulonglong other; + qulonglong total; ++#endif + + void sum(); + + void clear(); + } Values; + Values mPrevious; +- ++ int mib[2]; + CpuStat::Monitoring mMonitoring; + ++#ifdef HAVE_SYSCTL_H ++ typedef QMap > Bounds; ++#else + typedef QMap > Bounds; ++#endif + Bounds mBounds; + + int mUserHz; diff -urN /usr/ports/sysutils/libsysstat/files/patch-cpustat.cpp sysutils/libsysstat/files/patch-cpustat.cpp --- /usr/ports/sysutils/libsysstat/files/patch-cpustat.cpp 1970-01-01 01:00:00.000000000 +0100 +++ sysutils/libsysstat/files/patch-cpustat.cpp 2018-06-23 00:26:51.961808000 +0200 @@ -0,0 +1,294 @@ +--- cpustat.cpp.orig 2017-09-23 12:46:10 UTC ++++ cpustat.cpp +@@ -23,15 +23,68 @@ + ** + ** END_COMMON_COPYRIGHT_HEADER */ + +- ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif + #include ++#ifdef HAVE_SYSCTL_H ++extern "C" ++{ ++ #include ++ #include ++ #include ++ #include /* CPUSTATES */ + ++ #include ++ #include ++} ++#endif + #include "cpustat.h" + #include "cpustat_p.h" + + + namespace SysStat { + ++#ifdef HAVE_SYSCTL_H ++char *GetFirstFragment(char *string, const char *delim) ++{ ++ char *token = NULL; ++ ++ token = strsep(&string, delim); ++ if (token != NULL) ++ { ++ /* We need only the first fragment, so no loop! */ ++ return token; ++ } ++ else ++ return NULL; ++} ++ ++int GetCpu(void) ++{ ++ static int mib[] = { CTL_HW, HW_NCPU }; ++ int buf; ++ size_t len = sizeof(int); ++ ++ if (sysctl(mib, 2, &buf, &len, NULL, 0) < 0) ++ return 0; ++ else ++ return buf; ++} ++ ++/* Frequence is in MHz */ ++ulong CurrentFreq(void) ++{ ++ ulong freq; ++ size_t len = sizeof(freq); ++ ++ if (sysctlbyname("dev.cpu.0.freq", &freq, &len, NULL, 0) < 0) ++ return 0; ++ else ++ return freq; ++} ++#endif ++ + CpuStatPrivate::CpuStatPrivate(CpuStat *parent) + : BaseStatPrivate(parent) + , mMonitoring(CpuStat::LoadAndFrequency) +@@ -39,7 +92,10 @@ CpuStatPrivate::CpuStatPrivate(CpuStat * + mSource = defaultSource(); + + connect(mTimer, SIGNAL(timeout()), SLOT(timeout())); +- ++#ifdef HAVE_SYSCTL_H ++ size_t flen=2; ++ sysctlnametomib("kern.cp_times",mib,&flen); ++#endif + mUserHz = sysconf(_SC_CLK_TCK); + + updateSources(); +@@ -47,6 +103,49 @@ CpuStatPrivate::CpuStatPrivate(CpuStat * + + void CpuStatPrivate::addSource(const QString &source) + { ++#ifdef HAVE_SYSCTL_H ++ char buf[1024]; ++ char *tokens, *t; ++ ulong min = 0, max = 0; ++ size_t len = sizeof(buf); ++ ++ /* The string returned by the dev.cpu.0.freq_levels sysctl ++ * is a space separated list of MHz/milliwatts. ++ */ ++ if (sysctlbyname("dev.cpu.0.freq_levels", buf, &len, NULL, 0) < 0) ++ return; ++ ++ t = strndup(buf, len); ++ if (t == NULL) ++ { ++ free(t); ++ return; ++ } ++ ++ while ((tokens = strsep(&t, " ")) != NULL) ++ { ++ char *freq; ++ ulong res; ++ ++ freq = GetFirstFragment(tokens, "/"); ++ if (freq != NULL) ++ { ++ res = strtoul(freq, &freq, 10); ++ if (res > max) ++ { ++ max = res; ++ } ++ else ++ { ++ if ((min == 0) || (res < min)) ++ min = res; ++ } ++ } ++ } ++ ++ free(t); ++ mBounds[source] = qMakePair(min, max); ++#else + bool ok; + + uint min = readAllFile(qPrintable(QString("/sys/devices/system/cpu/%1/cpufreq/scaling_min_freq").arg(source))).toUInt(&ok); +@@ -56,11 +155,26 @@ void CpuStatPrivate::addSource(const QSt + if (ok) + mBounds[source] = qMakePair(min, max); + } ++#endif + } + + void CpuStatPrivate::updateSources() + { + mSources.clear(); ++#ifdef HAVE_SYSCTL_H ++ int cpu; ++ ++ cpu = GetCpu(); ++ for (int i =0;i(mTimer->interval()) / 1000 * static_cast(mUserHz) * static_cast(cores) / 1.25; // -25% + mIntervalMax = static_cast(mTimer->interval()) / 1000 * static_cast(mUserHz) * static_cast(cores) * 1.25; // +25% + } + + void CpuStatPrivate::timeout() + { ++#ifdef HAVE_SYSCTL_H ++ if ( (mMonitoring == CpuStat::LoadOnly) ++ || (mMonitoring == CpuStat::LoadAndFrequency) ) ++ { ++ size_t cp_size = sizeof(long) * CPUSTATES * GetCpu(); ++ long *cp_times = (long *)malloc(cp_size); ++ Values current; ++ int cpuNumber = mSource.midRef(3).toInt(); ++ if (sysctl(mib,2, cp_times, &cp_size, NULL, 0) < 0) ++ free(cp_times); ++ ++ current.user = static_cast(cp_times[CP_USER+cpuNumber*CPUSTATES]); ++ current.nice = static_cast(cp_times[CP_NICE+cpuNumber*CPUSTATES]); ++ current.system = static_cast(cp_times[CP_SYS+cpuNumber*CPUSTATES]); ++ current.idle = static_cast(cp_times[CP_IDLE+cpuNumber*CPUSTATES]); ++ current.other = static_cast(cp_times[CP_INTR+cpuNumber*CPUSTATES]); ++ current.total = current.user + current.nice + current.system+current.idle+current.other; ++ ++ float sumDelta = static_cast(current.total - mPrevious.total); ++ ++ if ((mPrevious.total != 0) && ((sumDelta < mIntervalMin) || (sumDelta > mIntervalMax))) ++ { ++ if (mMonitoring == CpuStat::LoadAndFrequency) ++ emit update(0.0, 0.0, 0.0, 0.0, 0.0, 0); ++ else ++ emit update(0.0, 0.0, 0.0, 0.0, 0.0); ++ ++ mPrevious.clear(); ++ } ++ else ++ { ++ if (mMonitoring == CpuStat::LoadAndFrequency) ++ { ++ ulong freq = 0; ++ ++ freq = CurrentFreq(); ++ if (freq > 0) ++ { ++ emit update( ++ static_cast(current.user - mPrevious.user ) / sumDelta, ++ static_cast(current.nice - mPrevious.nice ) / sumDelta, ++ static_cast(current.system - mPrevious.system ) / sumDelta, ++ static_cast(current.idle - mPrevious.idle ) / sumDelta, ++ static_cast(current.other - mPrevious.other ) / sumDelta, ++ freq); ++ } ++ else ++ { ++ emit update( ++ static_cast(current.user - mPrevious.user ) / sumDelta, ++ static_cast(current.nice - mPrevious.nice ) / sumDelta, ++ static_cast(current.system - mPrevious.system ) / sumDelta, ++ static_cast(current.idle - mPrevious.idle ) / sumDelta, ++ static_cast(current.other - mPrevious.other ) / sumDelta); ++ } ++ } ++ else ++ { ++ ++ emit update( ++ static_cast(current.user - mPrevious.user ) / sumDelta, ++ static_cast(current.nice - mPrevious.nice ) / sumDelta, ++ static_cast(current.system - mPrevious.system ) / sumDelta, ++ static_cast(current.idle - mPrevious.idle ) / sumDelta, ++ static_cast(current.other - mPrevious.other ) / sumDelta); ++ } ++ ++ mPrevious = current; ++ } ++ ++ free(cp_times); ++ } ++ else ++ { ++ ulong freq = 0; ++ ++ freq = CurrentFreq(); ++ if (freq > 0) ++ emit update(freq); ++ } ++#else + if ( (mMonitoring == CpuStat::LoadOnly) + || (mMonitoring == CpuStat::LoadAndFrequency) ) + { +@@ -258,6 +457,7 @@ void CpuStatPrivate::timeout() + } + emit update(freq); + } ++#endif + } + + QString CpuStatPrivate::defaultSource() +@@ -301,10 +501,15 @@ CpuStat::CpuStat(QObject *parent) + { + impl = new CpuStatPrivate(this); + baseimpl = impl; +- ++#ifdef HAVE_SYSCTL_H ++ connect(impl, SIGNAL(update(float,float,float,float,float,ulong)), this, SIGNAL(update(float,float,float,float,float,ulong))); ++ connect(impl, SIGNAL(update(float,float,float,float,float)), this, SIGNAL(update(float,float,float,float,float))); ++ connect(impl, SIGNAL(update(ulong)), this, SIGNAL(update(ulong))); ++#else + connect(impl, SIGNAL(update(float,float,float,float,float,uint)), this, SIGNAL(update(float,float,float,float,float,uint))); + connect(impl, SIGNAL(update(float,float,float,float)), this, SIGNAL(update(float,float,float,float))); + connect(impl, SIGNAL(update(uint)), this, SIGNAL(update(uint))); ++#endif + } + + CpuStat::~CpuStat() diff -urN /usr/ports/sysutils/libsysstat/files/patch-cpustat.h sysutils/libsysstat/files/patch-cpustat.h --- /usr/ports/sysutils/libsysstat/files/patch-cpustat.h 1970-01-01 01:00:00.000000000 +0100 +++ sysutils/libsysstat/files/patch-cpustat.h 2018-05-13 14:11:50.154649000 +0200 @@ -0,0 +1,52 @@ +--- cpustat.h.orig 2016-12-10 23:50:29 UTC ++++ cpustat.h +@@ -27,6 +27,11 @@ + #ifndef LIBSYSSTAT__CPU_STAT__INCLUDED + #define LIBSYSSTAT__CPU_STAT__INCLUDED + ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ ++#include + + #include + +@@ -35,6 +40,12 @@ + + namespace SysStat { + ++#ifdef HAVE_SYSCTL_H ++ char *GetFirstFragment(char *string, const char *delim); ++ int GetCpu(void); ++ ulong CurrentFreq(void); ++#endif ++ + class CpuStatPrivate; + + class SYSSTATSHARED_EXPORT CpuStat : public BaseStat +@@ -52,13 +63,23 @@ public: + + void updateSources(); + ++#ifdef HAVE_SYSCTL_H + uint minFreq(const QString &source) const; + uint maxFreq(const QString &source) const; + + signals: +- void update(float user, float nice, float system, float other, float frequencyRate, uint frequency); ++ void update(float user, float nice, float system, float idle, float other, ulong frequency); ++ void update(float user, float nice, float system, float idle, float other); ++ void update(ulong frequency); ++#else ++ ulong minFreq(const QString &source) const; ++ ulong maxFreq(const QString &source) const; ++ ++signals: ++ void update(float user, float nice, float system, float frequencyRate, uint frequency); + void update(float user, float nice, float system, float other); + void update(uint frequency); ++#endif + + void monitoringChanged(Monitoring); + diff -urN /usr/ports/sysutils/libsysstat/files/patch-memstat.cpp sysutils/libsysstat/files/patch-memstat.cpp --- /usr/ports/sysutils/libsysstat/files/patch-memstat.cpp 1970-01-01 01:00:00.000000000 +0100 +++ sysutils/libsysstat/files/patch-memstat.cpp 2018-05-13 14:11:50.154783000 +0200 @@ -0,0 +1,134 @@ +--- memstat.cpp.orig 2016-12-10 23:50:29 UTC ++++ memstat.cpp +@@ -23,6 +23,24 @@ + ** + ** END_COMMON_COPYRIGHT_HEADER */ + ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ ++#include ++ ++#if defined(HAVE_KVM_H) && defined(HAVE_SYSCTL_H) ++extern "C" ++{ ++ #include ++ #include ++ #include ++ ++ #include ++ #include ++ #include ++} ++#endif + + #include "memstat.h" + #include "memstat_p.h" +@@ -30,6 +48,45 @@ + + namespace SysStat { + ++#ifdef HAVE_SYSCTL_H ++int SwapDevices() ++{ ++ int buf; ++ size_t len = sizeof(int); ++ ++ if (sysctlbyname("vm.nswapdev", &buf, &len, NULL, 0) < 0) ++ return 0; ++ else ++ return buf; ++} ++ ++qulonglong MemGetByBytes(QString property) ++{ ++ qulonglong buf=0; ++ size_t len = sizeof(qulonglong); ++ ++ std::string s = property.toStdString(); ++ const char *name = s.c_str(); ++ ++ if (sysctlbyname(name, &buf, &len, NULL, 0) < 0) ++ return 0; ++ else ++ return buf; ++} ++ ++qulonglong MemGetByPages(QString name) ++{ ++ qulonglong res = 0; ++ ++ ++ res = MemGetByBytes(name); ++ if (res > 0) ++ res = res * getpagesize(); ++ ++ return res; ++} ++#endif ++ + MemStatPrivate::MemStatPrivate(MemStat *parent) + : BaseStatPrivate(parent) + { +@@ -51,6 +108,40 @@ void MemStatPrivate::timeout() + qulonglong memBuffers = 0; + qulonglong memCached = 0; + qulonglong swapTotal = 0; ++ ++#ifdef HAVE_SYSCTL_H ++ memTotal = MemGetByBytes("hw.physmem"); ++ memFree = MemGetByPages("vm.stats.vm.v_free_count"); ++ memBuffers = MemGetByBytes("vfs.bufspace"); ++ memCached = MemGetByPages("vm.stats.vm.v_inactive_count"); ++#endif ++ ++#ifdef HAVE_KVM_H ++ qulonglong swapUsed = 0; ++ kvm_t *kd; ++ struct kvm_swap kswap[16]; /* size taken from pstat/pstat.c */ ++ ++ kd = kvm_open(NULL, _PATH_DEVNULL, NULL, O_RDONLY, "kvm_open"); ++ if (kd == NULL) ++ kvm_close(kd); ++ ++ if (kvm_getswapinfo(kd, kswap, (sizeof(kswap) / sizeof(kswap[0])), SWIF_DEV_PREFIX) > 0) ++ { ++ int swapd = SwapDevices(); ++ /* TODO: loop over swap devives */ ++ if (swapd >= 1) ++ { ++ swapTotal = static_cast(kswap[0].ksw_total * getpagesize()); ++ swapUsed = static_cast(kswap[0].ksw_used * getpagesize()); ++ } ++ ++ kvm_close(kd); ++ } ++ else ++ kvm_close(kd); ++#endif ++ ++#ifndef HAVE_SYSCTL_H + qulonglong swapFree = 0; + + foreach (QString row, readAllFile("/proc/meminfo").split(QChar('\n'), QString::SkipEmptyParts)) +@@ -72,6 +163,7 @@ void MemStatPrivate::timeout() + else if(tokens[0] == "SwapFree:") + swapFree = tokens[1].toULong(); + } ++#endif + + if (mSource == "memory") + { +@@ -89,7 +181,11 @@ void MemStatPrivate::timeout() + { + if (swapTotal) + { ++#ifndef HAVE_KVM_H + float swapUsed_d = static_cast(swapTotal - swapFree) / static_cast(swapTotal); ++#else ++ float swapUsed_d = static_cast(swapUsed) / static_cast(swapTotal); ++#endif + + emit swapUpdate(swapUsed_d); + } diff -urN /usr/ports/sysutils/libsysstat/files/patch-memstat.h sysutils/libsysstat/files/patch-memstat.h --- /usr/ports/sysutils/libsysstat/files/patch-memstat.h 1970-01-01 01:00:00.000000000 +0100 +++ sysutils/libsysstat/files/patch-memstat.h 2018-05-13 14:11:50.154841000 +0200 @@ -0,0 +1,25 @@ +--- memstat.h.orig 2016-12-10 23:50:29 UTC ++++ memstat.h +@@ -27,6 +27,9 @@ + #ifndef LIBSYSSTAT__MEM_STAT__INCLUDED + #define LIBSYSSTAT__MEM_STAT__INCLUDED + ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif + + #include + +@@ -35,6 +38,12 @@ + + namespace SysStat { + ++#if defined(HAVE_SYSCTL_H) && defined(HAVE_KVM_H) ++ int SwapDevices(); ++ qulonglong MemGetByBytes(const QString property); ++ qulonglong MemGetByPages(const QString property); ++#endif ++ + class MemStatPrivate; + + class SYSSTATSHARED_EXPORT MemStat : public BaseStat diff -urN /usr/ports/sysutils/libsysstat/files/patch-netstat.cpp sysutils/libsysstat/files/patch-netstat.cpp --- /usr/ports/sysutils/libsysstat/files/patch-netstat.cpp 1970-01-01 01:00:00.000000000 +0100 +++ sysutils/libsysstat/files/patch-netstat.cpp 2018-05-13 14:11:50.154915000 +0200 @@ -0,0 +1,125 @@ +--- netstat.cpp.orig 2016-12-10 23:50:29 UTC ++++ netstat.cpp +@@ -23,6 +23,23 @@ + ** + ** END_COMMON_COPYRIGHT_HEADER */ + ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ ++#include ++ ++#if defined(HAVE_SYSCTL_H) && defined(HAVE_IF_H) ++extern "C" ++{ ++ #include ++ #include ++ #include ++ #include /* PF_LINK */ ++ #include ++ #include ++} ++#endif + + #include "netstat.h" + #include "netstat_p.h" +@@ -37,7 +54,7 @@ NetStatPrivate::NetStatPrivate(NetStat * + + connect(mTimer, SIGNAL(timeout()), SLOT(timeout())); + +- ++#ifndef HAVE_SYSCTL_H + QStringList rows(readAllFile("/proc/net/dev").split(QChar('\n'), QString::SkipEmptyParts)); + + rows.erase(rows.begin(), rows.begin() + 2); +@@ -50,6 +67,30 @@ NetStatPrivate::NetStatPrivate(NetStat * + + mSources.append(tokens[0].trimmed()); + } ++#else ++ int count; ++ size_t len; ++ int cntifmib[] = { CTL_NET, PF_LINK, NETLINK_GENERIC, IFMIB_SYSTEM, IFMIB_IFCOUNT };// net.link.generic.system.ifcount; ++ len = sizeof(int); ++ if (sysctl(cntifmib, 5, &count, &len, NULL, 0) < 0) ++ perror("sysctl"); ++ ++ ++ struct ifmibdata ifmd; ++ size_t len1 = sizeof(ifmd); ++ for (int i=1; i<=count;i++) { ++ int name[] = { CTL_NET, PF_LINK, NETLINK_GENERIC, IFMIB_IFDATA, i, IFDATA_GENERAL }; ++ ++ if (sysctl(name, 6, &ifmd, &len1, NULL, 0) < 0) { ++ perror("sysctl"); ++ } ++ if ((ifmd.ifmd_data.ifi_type == IFT_ETHER) || (ifmd.ifmd_data.ifi_type == IFT_IEEE80211)) { ++ const char *iface = ifmd.ifmd_name; ++ mSources.append(QString::fromLatin1(iface)); ++ } ++ } ++ ++#endif + } + + NetStatPrivate::~NetStatPrivate() +@@ -58,6 +99,50 @@ NetStatPrivate::~NetStatPrivate() + + void NetStatPrivate::timeout() + { ++#if defined(HAVE_IF_H) && defined(HAVE_SYSCTL_H) ++ int count; ++ size_t len; ++ int name[] = { CTL_NET, PF_LINK, NETLINK_GENERIC, IFMIB_SYSTEM, IFMIB_IFCOUNT }; ++ struct ifmibdata ifmd; ++ ++ len = sizeof(int); ++ if (sysctl(name, 5, &count, &len, NULL, 0) < 0) ++ return; ++ ++ for (int i = 1; i <= count; i++) ++ { ++ len = sizeof(ifmd); ++ int name[] = { CTL_NET, PF_LINK, NETLINK_GENERIC, IFMIB_IFDATA, i, IFDATA_GENERAL }; ++ ++ if (sysctl(name, 6, &ifmd, &len, NULL, 0) < 0) ++ break; ++ ++ if ((ifmd.ifmd_data.ifi_type == IFT_ETHER) || (ifmd.ifmd_data.ifi_type == IFT_IEEE80211)) ++ { ++ const char *iface = ifmd.ifmd_name; ++ QString interfaceName = QString::fromLatin1(iface); ++ if ((ifmd.ifmd_data.ifi_link_state == LINK_STATE_UP) && (ifmd.ifmd_data.ifi_ipackets > 0)) ++ { ++ ++ ++ Values current; ++ current.received = ifmd.ifmd_data.ifi_ibytes; ++ current.transmitted = ifmd.ifmd_data.ifi_obytes; ++ ++ if (!mPrevious.contains(interfaceName)) ++ mPrevious.insert(interfaceName, Values()); ++ const Values &previous = mPrevious[interfaceName]; ++ ++ if (interfaceName == mSource) ++ emit update((( current.received - previous.received ) * 1000 ) / mTimer->interval(), (( current.transmitted - previous.transmitted ) * 1000 ) / mTimer->interval()); ++ ++ mPrevious[interfaceName] = current; ++ } else if(interfaceName == mSource) ++ emit(update(0,0)); ++ ++ } ++ } ++#else + QStringList rows(readAllFile("/proc/net/dev").split(QChar('\n'), QString::SkipEmptyParts)); + + +@@ -99,6 +184,7 @@ void NetStatPrivate::timeout() + + mPrevious[interfaceName] = current; + } ++#endif + } + + QString NetStatPrivate::defaultSource() diff -urN /usr/ports/sysutils/libsysstat/Makefile sysutils/libsysstat/Makefile --- /usr/ports/sysutils/libsysstat/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ sysutils/libsysstat/Makefile 2018-06-30 01:23:21.651080000 +0200 @@ -0,0 +1,21 @@ +# Created by: Olivier Duchateau +# $FreeBSD$ + +PORTNAME= libsysstat +PORTVERSION= 0.4.0 +CATEGORIES= sysutils +MASTER_SITES= LXQT/${PORTNAME} + +MAINTAINER= jesper@schmitz.computer +COMMENT= Library used to query system info and statistics + +LICENSE= LGPL21 + +USES= cmake:outsource lxqt pkgconfig tar:xz qt:5 +USE_QT= qmake_build buildtools_build core +USE_LXQT= buildtools + +post-extract: + @${CP} ${FILESDIR}/config.h.in ${WRKSRC}; + +.include diff -urN /usr/ports/sysutils/libsysstat/pkg-descr sysutils/libsysstat/pkg-descr --- /usr/ports/sysutils/libsysstat/pkg-descr 1970-01-01 01:00:00.000000000 +0100 +++ sysutils/libsysstat/pkg-descr 2018-05-13 14:11:50.154965000 +0200 @@ -0,0 +1,4 @@ +Qt-based library to query system information like CPU, memory usage and +network traffic. + +WWW: http://lxqt.org/ diff -urN /usr/ports/sysutils/libsysstat/pkg-plist sysutils/libsysstat/pkg-plist --- /usr/ports/sysutils/libsysstat/pkg-plist 1970-01-01 01:00:00.000000000 +0100 +++ sysutils/libsysstat/pkg-plist 2018-05-13 14:11:50.155027000 +0200 @@ -0,0 +1,20 @@ +include/sysstat-qt5/SysStat/BaseStat +include/sysstat-qt5/SysStat/CpuStat +include/sysstat-qt5/SysStat/Global +include/sysstat-qt5/SysStat/MemStat +include/sysstat-qt5/SysStat/NetStat +include/sysstat-qt5/SysStat/Version +include/sysstat-qt5/basestat.h +include/sysstat-qt5/cpustat.h +include/sysstat-qt5/memstat.h +include/sysstat-qt5/netstat.h +include/sysstat-qt5/sysstat_global.h +include/sysstat-qt5/version.h +lib/libsysstat-qt5.so +lib/libsysstat-qt5.so.0 +lib/libsysstat-qt5.so.%%VERSION%% +libdata/pkgconfig/sysstat-qt5.pc +share/cmake/sysstat-qt5/sysstat-qt5-config-version.cmake +share/cmake/sysstat-qt5/sysstat-qt5-config.cmake +share/cmake/sysstat-qt5/sysstat-qt5-targets-%%CMAKE_BUILD_TYPE%%.cmake +share/cmake/sysstat-qt5/sysstat-qt5-targets.cmake