[kst] Add patch to fix qreal issues on arm (bug #1180348)
Orion Poplawski
orion at fedoraproject.org
Wed Jan 14 23:53:15 UTC 2015
commit 2310fd6cf5391d514ab1ece2b82f528520a4fb86
Author: Orion Poplawski <orion at cora.nwra.com>
Date: Wed Jan 14 16:53:37 2015 -0700
Add patch to fix qreal issues on arm (bug #1180348)
kst-qreal.patch | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
kst.spec | 8 ++++++
2 files changed, 80 insertions(+), 0 deletions(-)
---
diff --git a/kst-qreal.patch b/kst-qreal.patch
new file mode 100644
index 0000000..d6a71e2
--- /dev/null
+++ b/kst-qreal.patch
@@ -0,0 +1,72 @@
+diff -up Kst-2.0.8/src/libkst/editablevector.cpp.qreal Kst-2.0.8/src/libkst/editablevector.cpp
+--- Kst-2.0.8/src/libkst/editablevector.cpp.qreal 2014-07-20 03:22:38.000000000 -0600
++++ Kst-2.0.8/src/libkst/editablevector.cpp 2015-01-12 10:46:16.884628350 -0700
+@@ -52,7 +52,7 @@ void EditableVector::setValue(const int
+ _scalars["sumsquared"]->setValue(_sum*_sum);
+ _scalars["max"]->setValue(qMax(_max,val));
+ _scalars["min"]->setValue(qMin(_min,_min));
+- double b=(float)(qMax((float)0.0f,(float)_minPos));
++ double b=qMax(double(0.0),_minPos);
+ _scalars["minpos"]->setValue(qMin(_min,b));
+ _scalars["last"]->setValue(_v[_size-1]);
+ _scalars["first"]->setValue(_v[0]);
+diff -up Kst-2.0.8/src/libkstmath/curve.cpp.qreal Kst-2.0.8/src/libkstmath/curve.cpp
+--- Kst-2.0.8/src/libkstmath/curve.cpp.qreal 2014-07-20 02:53:17.000000000 -0600
++++ Kst-2.0.8/src/libkstmath/curve.cpp 2015-01-14 16:18:19.898681604 -0700
+@@ -684,11 +684,11 @@ RelationPtr Curve::makeDuplicate() const
+ // and not just pulled out of the air by what looks ~good.
+ // They are currently "about right" for printing to US Letter.
+ double Curve::pointDim(QRectF w) const {
+- return qMax(qreal(1.01), PointSize * ((w.width() + w.height()) * (1.0 / 4000.0)));
++ return qMax(double(1.01), PointSize * ((w.width() + w.height()) * (1.0 / 4000.0)));
+ }
+
+ double Curve::lineDim(const QRectF &R, double linewidth) {
+- double lw = qMax(qreal(1.01), linewidth*(R.width()+R.height())*(1.0/2000.0));
++ qreal lw = qMax(qreal(1.01), qreal(linewidth)*(R.width()+R.height())*qreal(1.0/2000.0));
+ // if you ask for a thicker line, make sure it is at least 2 px wide
+ if (linewidth>1.9) {
+ lw = qMax(qreal(2.0),lw);
+diff -up Kst-2.0.8/src/libkst/vector.cpp.qreal Kst-2.0.8/src/libkst/vector.cpp
+--- Kst-2.0.8/src/libkst/vector.cpp.qreal 2014-07-20 03:22:38.000000000 -0600
++++ Kst-2.0.8/src/libkst/vector.cpp 2015-01-12 11:17:04.046417015 -0700
+@@ -595,11 +595,11 @@ void Vector::oldChange(QByteArray &data)
+ qds >> _v[i];
+ if(!i) {
+ _min=_max=_minPos=sum=_v[i];
+- _minPos=qMax(_minPos,qreal(0.0));
++ _minPos=qMax(_minPos,double(0.0));
+ } else {
+ _min=qMin(_v[i],_min);
+ _max=qMax(_v[i],_max);
+- _minPos=qMin(qMax(_v[i],qreal(0.0)),_minPos);
++ _minPos=qMin(qMax(_v[i],double(0.0)),_minPos);
+ sum+=_v[i];
+ }
+ }
+@@ -626,11 +626,11 @@ void Vector::change(QByteArray &data) {
+ qds >> _v[i];
+ if(!i) {
+ _min=_max=_minPos=sum=_v[i];
+- _minPos=qMax(_minPos,qreal(0.0));
++ _minPos=qMax(_minPos,double(0.0));
+ } else {
+ _min=qMin(_v[i],_min);
+ _max=qMax(_v[i],_max);
+- _minPos=qMin(qMax(_v[i],qreal(0.0)),_minPos);
++ _minPos=qMin(qMax(_v[i],double(0.0)),_minPos);
+ sum+=_v[i];
+ }
+ }
+diff -up Kst-2.0.8/src/plugins/dataobject/activitylevel/activitylevel.cpp.qreal Kst-2.0.8/src/plugins/dataobject/activitylevel/activitylevel.cpp
+--- Kst-2.0.8/src/plugins/dataobject/activitylevel/activitylevel.cpp.qreal 2014-07-20 02:53:17.000000000 -0600
++++ Kst-2.0.8/src/plugins/dataobject/activitylevel/activitylevel.cpp 2015-01-12 10:46:16.885628344 -0700
+@@ -323,7 +323,7 @@ bool ActivityLevelSource::algorithm() {
+ incomingValueNext = outputVectorDenoised->value()[i+1];
+ }
+ if ( (outgoingValue-outgoingValuePrev)*(outgoingValueNext-outgoingValue) < 0) {
+- dNbReversals = qMax(dNbReversals - 1.0, qreal(0.0)); // Avoid getting negative values, which can happen
++ dNbReversals = qMax(dNbReversals - 1.0, double(0.0)); // Avoid getting negative values, which can happen
+ }
+ if ( (incomingValue-incomingValuePrev)*(incomingValueNext-incomingValue) < 0) {
+ dNbReversals += 1.0;
diff --git a/kst.spec b/kst.spec
index 3fa0492..2825bae 100644
--- a/kst.spec
+++ b/kst.spec
@@ -10,6 +10,10 @@ Source0: http://downloads.sourceforge.net/%{name}/Kst-%{version}.tar.gz
# Fix calls to set_target_properties in KstMacros.cmake
# https://bugs.kde.org/show_bug.cgi?id=322286
Patch0: kst-properties.patch
+# Upstream patch to fix qreal for arm
+# https://bugs.kde.org/show_bug.cgi?id=342642
+# https://bugzilla.redhat.com/show_bug.cgi?id=1180348
+Patch1: kst-qreal.patch
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
@@ -95,6 +99,7 @@ A plugin allowing kst to open and read data in getdata (dirfile) format.
%prep
%setup -q -n Kst-%{version}
%patch0 -p1 -b .properties
+%patch1 -p1 -b .qreal
%build
# -Dkst_merge_files=1 is failing for now
@@ -189,6 +194,9 @@ fi
#%{_datadir}/services/kst/kstdata_dirfilesource.desktop
%changelog
+* Wed Jan 14 2015 Orion Poplawski <orion at cora.nwra.com> 2.0.8-1
+- Add patch to fix qreal issues on arm (bug #1180348)
+
* Wed Jan 7 2015 Orion Poplawski <orion at cora.nwra.com> 2.0.8-1
- Update to 2.0.8
More information about the scm-commits
mailing list