From 92ecb199a1227b77a72c5735c8f226faa57d5c40 Mon Sep 17 00:00:00 2001 From: Eric Hameleers Date: Wed, 16 Mar 2016 13:06:23 +0100 Subject: Fix build against glibc-2.23 Some packages would fail to compile (only on 32-bit though) with: "error: 'isnan' was not declared in this scope". Affected sources: - libksysguard - kholidays - kmplot - kstars --- kde/patch/kholidays.patch | 4 + kde/patch/kholidays/kholidays_isnan.patch | 30 ++++ kde/patch/kmplot.patch | 3 + kde/patch/kmplot/kmplot_isnan.patch | 42 ++++++ kde/patch/kstars.patch | 3 + kde/patch/kstars/kstars_isnan.patch | 46 +++++++ kde/patch/libksysguard.patch | 4 + kde/patch/libksysguard/libksysguard_isnan.patch | 176 ++++++++++++++++++++++++ 8 files changed, 308 insertions(+) create mode 100644 kde/patch/kholidays.patch create mode 100644 kde/patch/kholidays/kholidays_isnan.patch create mode 100644 kde/patch/kmplot.patch create mode 100644 kde/patch/kmplot/kmplot_isnan.patch create mode 100644 kde/patch/kstars.patch create mode 100644 kde/patch/kstars/kstars_isnan.patch create mode 100644 kde/patch/libksysguard.patch create mode 100644 kde/patch/libksysguard/libksysguard_isnan.patch (limited to 'kde') diff --git a/kde/patch/kholidays.patch b/kde/patch/kholidays.patch new file mode 100644 index 0000000..aff0216 --- /dev/null +++ b/kde/patch/kholidays.patch @@ -0,0 +1,4 @@ +# Fix for "error: isnan was not declared in this scope" +# Fixed post Plasma 5.5.5. +cat $CWD/patch/kholidays/kholidays_isnan.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } + diff --git a/kde/patch/kholidays/kholidays_isnan.patch b/kde/patch/kholidays/kholidays_isnan.patch new file mode 100644 index 0000000..55e79aa --- /dev/null +++ b/kde/patch/kholidays/kholidays_isnan.patch @@ -0,0 +1,30 @@ +From: Milian Wolff +Date: Mon, 07 Mar 2016 09:58:37 +0000 +Subject: Fix compile with clang: isnan is in the std namespace when including cmath. +X-Git-Url: http://quickgit.kde.org/?p=kholidays.git&a=commitdiff&h=488aa158f7a0a99604a13a897a11388c02f8d39e +--- +Fix compile with clang: isnan is in the std namespace when including cmath. +--- + + +--- a/src/sunriseset.cpp ++++ b/src/sunriseset.cpp +@@ -180,7 +180,7 @@ + double hourAngle = calcHourAngleSunrise(latitude, solarDec); + double delta = longitude + radToDeg(hourAngle); + QTime timeUTC(0, 0); +- if (isnan(delta)) ++ if (std::isnan(delta)) + return timeUTC; + timeUTC = timeUTC.addSecs((720 - (4.0 * delta) - eqTime) * 60); + return QTime(timeUTC.hour(), +@@ -199,7 +199,7 @@ + double hourAngle = -calcHourAngleSunrise(latitude, solarDec); + double delta = longitude + radToDeg(hourAngle); + QTime timeUTC(0, 0); +- if (isnan(delta)) ++ if (std::isnan(delta)) + return timeUTC; + timeUTC = timeUTC.addSecs((720 - (4.0 * delta) - eqTime) * 60); + return QTime(timeUTC.hour(), + diff --git a/kde/patch/kmplot.patch b/kde/patch/kmplot.patch new file mode 100644 index 0000000..ff86a33 --- /dev/null +++ b/kde/patch/kmplot.patch @@ -0,0 +1,3 @@ +# Fix for "error: isnan was not declared in this scope" +cat $CWD/patch/kmplot/kmplot_isnan.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } + diff --git a/kde/patch/kmplot/kmplot_isnan.patch b/kde/patch/kmplot/kmplot_isnan.patch new file mode 100644 index 0000000..691ff89 --- /dev/null +++ b/kde/patch/kmplot/kmplot_isnan.patch @@ -0,0 +1,42 @@ +--- kmplot-15.12.3/kmplot/view.cpp.0 2016-03-11 21:19:48.011194225 +0000 ++++ kmplot-15.12.3/kmplot/view.cpp 2016-03-11 21:20:37.341056493 +0000 +@@ -476,7 +476,7 @@ + double x = pixel.x(); + double y = pixel.y(); + +- if ( isnan(x) ) ++ if ( std::isnan(x) ) + { + xclipflg = true; + x = pixelIfNaN.x(); +@@ -496,14 +496,14 @@ + } + else + { +- if ( isinf(x) == -1 ) ++ if ( std::isinf(x) == -1 ) + x = 0; + +- else if ( isinf(x) == 1 ) ++ else if ( std::isinf(x) == 1 ) + x = m_clipRect.right(); + } + +- if ( isnan(y) ) ++ if ( std::isnan(y) ) + { + yclipflg = true; + y = pixelIfNaN.y(); +@@ -523,10 +523,10 @@ + } + else + { +- if ( isinf(y) == -1 ) ++ if ( std::isinf(y) == -1 ) + y = 0; + +- else if ( isinf(y) == 1 ) ++ else if ( std::isinf(y) == 1 ) + y = m_clipRect.bottom(); + } + diff --git a/kde/patch/kstars.patch b/kde/patch/kstars.patch new file mode 100644 index 0000000..8b97c20 --- /dev/null +++ b/kde/patch/kstars.patch @@ -0,0 +1,3 @@ +# Fix for "error: isnan was not declared in this scope" +cat $CWD/patch/kstars/kstars_isnan.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } + diff --git a/kde/patch/kstars/kstars_isnan.patch b/kde/patch/kstars/kstars_isnan.patch new file mode 100644 index 0000000..1c4aef3 --- /dev/null +++ b/kde/patch/kstars/kstars_isnan.patch @@ -0,0 +1,46 @@ +From: Christian Dersch +Date: Wed, 03 Feb 2016 10:19:55 +0000 +Subject: Fix compilation with gcc 6.x (namespace std has to be used explicitly in some cases, e.g. when ambiguous) +X-Git-Url: http://quickgit.kde.org/?p=kstars.git&a=commitdiff&h=7d34e52f4dd6e15b871596b3c64d4c7cdba599b4 +--- +Fix compilation with gcc 6.x (namespace std has to be used explicitly in some cases, e.g. when ambiguous) +REVIEW:126976 +--- + + +--- a/kstars/fitsviewer/fitsdata.cpp ++++ b/kstars/fitsviewer/fitsdata.cpp +@@ -548,7 +548,7 @@ + int diff_x=s1->x - s2->x; + int diff_y=s1->y - s2->y; + +- dis = abs( sqrt( diff_x*diff_x + diff_y*diff_y)); ++ dis = std::abs( sqrt( diff_x*diff_x + diff_y*diff_y)); + dis -= s1->width/2; + dis -= s2->width/2; + + +--- a/kstars/tools/horizonmanager.cpp ++++ b/kstars/tools/horizonmanager.cpp +@@ -192,7 +192,7 @@ + az = dms::fromString(regionItem->child(i, 1)->data(Qt::DisplayRole).toString(), true); + alt = dms::fromString(regionItem->child(i, 2)->data(Qt::DisplayRole).toString(), true); + +- if (isnan(az.Degrees()) || isnan(alt.Degrees())) ++ if (std::isnan(az.Degrees()) || std::isnan(alt.Degrees())) + return false; + + p.setAz(az); +@@ -534,9 +534,9 @@ + dms azAngle = dms::fromString(parent->child(item->row(),1)->data(Qt::DisplayRole).toString(), true); + dms altAngle = dms::fromString(parent->child(item->row(),2)->data(Qt::DisplayRole).toString(), true); + +- if (isnan(azAngle.Degrees())) ++ if (std::isnan(azAngle.Degrees())) + azOK = false; +- if (isnan(altAngle.Degrees())) ++ if (std::isnan(altAngle.Degrees())) + altOK = false; + + if ( (item->column() == 1 && azOK == false) || (item->column() == 2 && altOK == false) ) + diff --git a/kde/patch/libksysguard.patch b/kde/patch/libksysguard.patch new file mode 100644 index 0000000..989ef6b --- /dev/null +++ b/kde/patch/libksysguard.patch @@ -0,0 +1,4 @@ +# Fix for "error: isnan was not declared in this scope" +# Fixed post Plasma 5.5.5. +cat $CWD/patch/libksysguard/libksysguard_isnan.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } + diff --git a/kde/patch/libksysguard/libksysguard_isnan.patch b/kde/patch/libksysguard/libksysguard_isnan.patch new file mode 100644 index 0000000..c6ce1e9 --- /dev/null +++ b/kde/patch/libksysguard/libksysguard_isnan.patch @@ -0,0 +1,176 @@ +From: David Rosca +Date: Tue, 23 Feb 2016 16:32:35 +0000 +Subject: signalplotter: Use std namespaced isnan and isinf +X-Git-Tag: v5.5.95 +X-Git-Url: http://quickgit.kde.org/?p=libksysguard.git&a=commitdiff&h=b0578798eb3f5bdad0a25ea9b4a52c53ebcfc020 +--- +signalplotter: Use std namespaced isnan and isinf + +Test Plan: Fixes build for me. + +Reviewers: #plasma, ivan + +Reviewed By: ivan + +Subscribers: ivan, plasma-devel + +Projects: #plasma + +Differential Revision: https://phabricator.kde.org/D1010 +--- + + +--- 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 @@ + 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 @@ + 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 @@ + 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 @@ + } + 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); + +--- a/tests/signalplottertest.cpp ++++ b/tests/signalplottertest.cpp +@@ -56,8 +56,8 @@ + 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 @@ + 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 @@ + 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 @@ + 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); + } + -- cgit v1.2.3