From e8c8a273e842557ae458e7a11f1c1e9188870deea74da990c1ac99bf349e5a08 Mon Sep 17 00:00:00 2001 From: Luca Beltrame Date: Fri, 4 Mar 2016 15:34:16 +0000 Subject: [PATCH] Accepting request 366030 from home:dimstar:Factory Fix build with glibc 2.23, as currently in Staging:B. Build tested against current oS:F as well as Staging:B, works in both cases OBS-URL: https://build.opensuse.org/request/show/366030 OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/libksysguard5?expand=0&rev=76 --- libksysguard5-glibc-2.23.patch | 168 +++++++++++++++++++++++++++++++++ libksysguard5.changes | 5 + libksysguard5.spec | 3 + 3 files changed, 176 insertions(+) create mode 100644 libksysguard5-glibc-2.23.patch diff --git a/libksysguard5-glibc-2.23.patch b/libksysguard5-glibc-2.23.patch new file mode 100644 index 0000000..1214fac --- /dev/null +++ b/libksysguard5-glibc-2.23.patch @@ -0,0 +1,168 @@ +From b0578798eb3f5bdad0a25ea9b4a52c53ebcfc020 Mon Sep 17 00:00:00 2001 +From: David Rosca +Date: Tue, 23 Feb 2016 17:32:35 +0100 +Subject: [PATCH] signalplotter: Use std namespaced isnan and isinf + +Differential Revision: https://phabricator.kde.org/D1010 +--- + signalplotter/ksignalplotter.cpp | 34 ++++++++++++++++------------------ + tests/signalplottertest.cpp | 14 +++++++------- + 2 files changed, 23 insertions(+), 25 deletions(-) + +diff --git a/signalplotter/ksignalplotter.cpp b/signalplotter/ksignalplotter.cpp +index 6847f16..3737227 100644 +--- a/signalplotter/ksignalplotter.cpp ++++ b/signalplotter/ksignalplotter.cpp +@@ -32,8 +32,6 @@ + #include "ksignalplotter_p.h" + #include "processcore/processcore_debug.h" + +-#include //For floor, ceil, log10 etc for calculating ranges +- + #include + #include + #include +@@ -49,7 +47,7 @@ + + #include + #include +-#include ++#include + #include + + #ifdef SVG_SUPPORT +@@ -485,20 +483,20 @@ void KSignalPlotterPrivate::recalculateMaxMinValueForSample(const QList&s + qreal value=0; + for(int i = sampleBuf.count()-1; i>= 0; i--) { + qreal newValue = sampleBuf[i]; +- if( !isinf(newValue) && !isnan(newValue) ) ++ if( !std::isinf(newValue) && !std::isnan(newValue) ) + value += newValue; + } +- if(isnan(mMinValue) || mMinValue > value) mMinValue = value; +- if(isnan(mMaxValue) || mMaxValue < value) mMaxValue = value; ++ if(std::isnan(mMinValue) || mMinValue > value) mMinValue = value; ++ if(std::isnan(mMaxValue) || mMaxValue < value) mMaxValue = value; + if(value > 0.7*mMaxValue) + mRescaleTime = time; + } else { + qreal value; + for(int i = sampleBuf.count()-1; i>= 0; i--) { + value = sampleBuf[i]; +- if( !isinf(value) && !isnan(value) ) { +- if(isnan(mMinValue) || mMinValue > value) mMinValue = value; +- if(isnan(mMaxValue) || mMaxValue < value) mMaxValue = value; ++ if( !std::isinf(value) && !std::isnan(value) ) { ++ if(std::isnan(mMinValue) || mMinValue > value) mMinValue = value; ++ if(std::isnan(mMaxValue) || mMaxValue < value) mMaxValue = value; + if(value > 0.7*mMaxValue) + mRescaleTime = time; + } +@@ -789,9 +787,9 @@ void KSignalPlotterPrivate::calculateNiceRange() + qreal max = mUserMaxValue; + qreal min = mUserMinValue; + if( mUseAutoRange ) { +- if(!isnan(mMaxValue) && mMaxValue * 0.99 > max) //Allow max value to go very slightly over the given max, for rounding reasons ++ if(!std::isnan(mMaxValue) && mMaxValue * 0.99 > max) //Allow max value to go very slightly over the given max, for rounding reasons + max = mMaxValue; +- if(!isnan(mMinValue) && mMinValue * 0.99 < min) { ++ if(!std::isnan(mMinValue) && mMinValue * 0.99 < min) { + min = mMinValue; + } + } +@@ -920,23 +918,23 @@ void KSignalPlotterPrivate::drawBeam(QPainter *p, const QRect &boundingBox, int + bool firstLine = true; + for (int j = 0; j < count; ++j) { + qreal point0 = datapoints[j]; +- if( isnan(point0) ) ++ if( std::isnan(point0) ) + continue; //Just do not draw points with nans. skip them + + qreal point1 = prev_datapoints[j]; + qreal point2 = prev_prev_datapoints[j]; + +- if(isnan(point1)) ++ if(std::isnan(point1)) + point1 = point0; +- else if(mSmoothGraph && !isinf(point1)) { ++ else if(mSmoothGraph && !std::isinf(point1)) { + // Apply a weighted average just to smooth the graph out a bit + // Do not try to smooth infinities or nans + point0 = (2*point0 + point1)/3; +- if(!isnan(point2) && !isinf(point2)) ++ if(!std::isnan(point2) && !std::isinf(point2)) + point1 = (2*point1 + point2)/3; + // We don't bother to average out y2. This will introduce slight inaccuracies in the gradients, but they aren't really noticeable. + } +- if(isnan(point2)) ++ if(std::isnan(point2)) + point2 = point1; + + if (mStackBeams) { +@@ -1046,12 +1044,12 @@ qreal KSignalPlotter::lastValue( int i) const + } + QString KSignalPlotter::lastValueAsString( int i, int precision) const + { +- if(d->mBeamData.isEmpty() || d->mBeamData.first().size() <= i || isnan(d->mBeamData.first().at(i))) return QString(); ++ if(d->mBeamData.isEmpty() || d->mBeamData.first().size() <= i || std::isnan(d->mBeamData.first().at(i))) return QString(); + return valueAsString(d->mBeamData.first().at(i), precision); //retrieve the newest value for this beam + } + QString KSignalPlotter::valueAsString( qreal value, int precision) const + { +- if(isnan(value)) ++ if(std::isnan(value)) + return QString(); + value = value / d->mScaleDownBy; // scale the value. E.g. from Bytes to KiB + return d->scaledValueAsString(value, precision); +diff --git a/tests/signalplottertest.cpp b/tests/signalplottertest.cpp +index fa058d5..8b3b394 100644 +--- a/tests/signalplottertest.cpp ++++ b/tests/signalplottertest.cpp +@@ -56,8 +56,8 @@ void TestSignalPlotter::testAddRemoveBeamsWithData() + s->addBeam(Qt::blue); + s->addBeam(Qt::red); + +- QVERIFY( isnan(s->lastValue(0)) ); //unset, so should default to NaN +- QVERIFY( isnan(s->lastValue(1)) ); //unset, so should default to NaN ++ QVERIFY( std::isnan(s->lastValue(0)) ); //unset, so should default to NaN ++ QVERIFY( std::isnan(s->lastValue(1)) ); //unset, so should default to NaN + QCOMPARE(s->numBeams(), 2); + QVERIFY(s->beamColor(0) == Qt::blue); + QVERIFY(s->beamColor(1) == Qt::red); +@@ -92,7 +92,7 @@ void TestSignalPlotter::testAddRemoveBeamsWithData() + QVERIFY(s->beamColor(0) == Qt::blue); + QVERIFY(s->beamColor(1) == Qt::red); + QCOMPARE(s->lastValue(0), 1.0); +- QVERIFY( isnan(s->lastValue(1)) ); //unset, so should default to NaN ++ QVERIFY( std::isnan(s->lastValue(1)) ); //unset, so should default to NaN + } + + void TestSignalPlotter::testReorderBeams() +@@ -153,8 +153,8 @@ void TestSignalPlotter::testReorderBeamsWithData() + s->addBeam(Qt::blue); + s->addBeam(Qt::red); + QCOMPARE(s->numBeams(), 2); +- QVERIFY(isnan(s->lastValue(0))); //unset, so should default to NaN +- QVERIFY(isnan(s->lastValue(1))); //unset, so should default to NaN ++ QVERIFY(std::isnan(s->lastValue(0))); //unset, so should default to NaN ++ QVERIFY(std::isnan(s->lastValue(1))); //unset, so should default to NaN + //Add some data + QList data; + data << 1.0 << 2.0; +@@ -189,13 +189,13 @@ void TestSignalPlotter::testReorderBeamsWithData() + QCOMPARE(s->numBeams(), 3); + QCOMPARE(s->lastValue(0), 2.0); + QCOMPARE(s->lastValue(1), 1.0); +- QVERIFY(isnan(s->lastValue(2))); //unset, so should default to NaN ++ QVERIFY(std::isnan(s->lastValue(2))); //unset, so should default to NaN + + newOrder.clear(); + newOrder << 2 << 0 << 1; + s->reorderBeams(newOrder); + QCOMPARE(s->numBeams(), 3); +- QVERIFY(isnan(s->lastValue(0))); //unset, so should default to NaN ++ QVERIFY(std::isnan(s->lastValue(0))); //unset, so should default to NaN + QCOMPARE(s->lastValue(1), 2.0); + QCOMPARE(s->lastValue(2), 1.0); + } + diff --git a/libksysguard5.changes b/libksysguard5.changes index 56e3d6c..cb35b69 100644 --- a/libksysguard5.changes +++ b/libksysguard5.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Mar 4 15:06:46 UTC 2016 - dimstar@opensuse.org + +- Add libksysguard5-glibc-2.23.patch: Fix build with glibc 2.23. + ------------------------------------------------------------------- Tue Mar 1 17:33:15 UTC 2016 - hrvoje.senjan@gmail.com diff --git a/libksysguard5.spec b/libksysguard5.spec index 8b7dacc..9d3a5e9 100644 --- a/libksysguard5.spec +++ b/libksysguard5.spec @@ -27,6 +27,8 @@ Url: http://www.kde.org Source: libksysguard-%{version}.tar.xz Source1: baselibs.conf Source99: %{name}-rpmlintrc +# PATCH-FIX-UPSTREAM libksysguard5-glibc-2.23.patch dimstar@opensuse.org -- Fix build with glibc 2.23 +Patch0: libksysguard5-glibc-2.23.patch BuildRequires: extra-cmake-modules >= 1.2.0 BuildRequires: kf5-filesystem BuildRequires: xz @@ -87,6 +89,7 @@ for actions that require elevated privileges. %lang_package %prep %setup -q -n libksysguard-%{version} +%patch0 -p1 %build %cmake_kf5 -d build -- -DCMAKE_INSTALL_LOCALEDIR=share/locale/kf5