[qgis] Restore ARM build (Sandro Mani)

Volker Fröhlich volter at fedoraproject.org
Tue Jul 29 06:04:39 UTC 2014


commit c2afe39d97442a1a3c7973b9ecdbff3ccb4a4e7f
Author: Volker Fröhlich <volker27 at gmx.at>
Date:   Tue Jul 29 08:04:08 2014 +0200

    Restore ARM build (Sandro Mani)

 qgis-2.4.0-qreal.patch |   96 ++++++++++++++++++++++++++++++++++++++++++++++++
 qgis.spec              |   27 ++++++++++++-
 2 files changed, 121 insertions(+), 2 deletions(-)
---
diff --git a/qgis-2.4.0-qreal.patch b/qgis-2.4.0-qreal.patch
new file mode 100644
index 0000000..bbef41a
--- /dev/null
+++ b/qgis-2.4.0-qreal.patch
@@ -0,0 +1,96 @@
+diff -rupN qgis-2.4.0/python/core/composer/qgsatlascomposition.sip qgis-2.4.0-new/python/core/composer/qgsatlascomposition.sip
+--- qgis-2.4.0/python/core/composer/qgsatlascomposition.sip	2014-06-27 14:00:08.000000000 +0200
++++ qgis-2.4.0-new/python/core/composer/qgsatlascomposition.sip	2014-07-27 00:10:44.629582944 +0200
+@@ -155,7 +155,7 @@ public:
+      * @see setPredefinedScales
+      * @see QgsComposerMap::atlasScalingMode
+     */
+-    const QVector<double>& predefinedScales() const;
++    const QVector<qreal>& predefinedScales() const;
+ 
+     /**Sets the list of predefined scales for the atlas. This is used
+      * for maps which are set to the predefined atlas scaling mode.
+@@ -163,7 +163,7 @@ public:
+      * @see predefinedScales
+      * @see QgsComposerMap::atlasScalingMode
+      */
+-    void setPredefinedScales( const QVector<double>& scales );
++    void setPredefinedScales( const QVector<qreal>& scales );
+ 
+     /** Begins the rendering. Returns true if successful, false if no matching atlas
+       features found.*/
+diff -rupN qgis-2.4.0/src/app/composer/qgscomposer.cpp qgis-2.4.0-new/src/app/composer/qgscomposer.cpp
+--- qgis-2.4.0/src/app/composer/qgscomposer.cpp	2014-06-27 14:00:08.000000000 +0200
++++ qgis-2.4.0-new/src/app/composer/qgscomposer.cpp	2014-07-27 00:10:29.977583595 +0200
+@@ -3594,7 +3594,7 @@ void QgsComposer::loadAtlasPredefinedSca
+     return;
+   }
+   QgsAtlasComposition& atlasMap = mComposition->atlasComposition();
+-  QVector<double> pScales;
++  QVector<qreal> pScales;
+   // first look at project's scales
+   QStringList scales( QgsProject::instance()->readListEntry( "Scales", "/ScalesList" ) );
+   bool hasProjectScales( QgsProject::instance()->readBoolEntry( "Scales", "/useProjectScales" ) );
+diff -rupN qgis-2.4.0/src/core/composer/qgsatlascomposition.cpp qgis-2.4.0-new/src/core/composer/qgsatlascomposition.cpp
+--- qgis-2.4.0/src/core/composer/qgsatlascomposition.cpp	2014-06-27 14:00:08.000000000 +0200
++++ qgis-2.4.0-new/src/core/composer/qgsatlascomposition.cpp	2014-07-27 00:10:32.027583504 +0200
+@@ -491,7 +491,7 @@ void QgsAtlasComposition::prepareMap( Qg
+       // choose one of the predefined scales
+       double newWidth = mOrigExtent.width();
+       double newHeight = mOrigExtent.height();
+-      const QVector<double>& scales = mPredefinedScales;
++      const QVector<qreal>& scales = mPredefinedScales;
+       for ( int i = 0; i < scales.size(); i++ )
+       {
+         double ratio = scales[i] / originalScale;
+@@ -747,7 +747,7 @@ bool QgsAtlasComposition::evalFeatureFil
+   return true;
+ }
+ 
+-void QgsAtlasComposition::setPredefinedScales( const QVector<double>& scales )
++void QgsAtlasComposition::setPredefinedScales( const QVector<qreal>& scales )
+ {
+   mPredefinedScales = scales;
+   // make sure the list is sorted
+diff -rupN qgis-2.4.0/src/core/composer/qgsatlascomposition.h qgis-2.4.0-new/src/core/composer/qgsatlascomposition.h
+--- qgis-2.4.0/src/core/composer/qgsatlascomposition.h	2014-06-27 14:00:08.000000000 +0200
++++ qgis-2.4.0-new/src/core/composer/qgsatlascomposition.h	2014-07-27 00:10:33.057583458 +0200
+@@ -183,7 +183,7 @@ class CORE_EXPORT QgsAtlasComposition :
+      * @see setPredefinedScales
+      * @see QgsComposerMap::atlasScalingMode
+     */
+-    const QVector<double>& predefinedScales() const { return mPredefinedScales; }
++    const QVector<qreal>& predefinedScales() const { return mPredefinedScales; }
+ 
+     /**Sets the list of predefined scales for the atlas. This is used
+      * for maps which are set to the predefined atlas scaling mode.
+@@ -191,7 +191,7 @@ class CORE_EXPORT QgsAtlasComposition :
+      * @see predefinedScales
+      * @see QgsComposerMap::atlasScalingMode
+      */
+-    void setPredefinedScales( const QVector<double>& scales );
++    void setPredefinedScales( const QVector<qreal>& scales );
+ 
+     /** Begins the rendering. Returns true if successful, false if no matching atlas
+       features found.*/
+@@ -320,7 +320,7 @@ class CORE_EXPORT QgsAtlasComposition :
+     void computeExtent( QgsComposerMap *map );
+ 
+     //list of predefined scales
+-    QVector<double> mPredefinedScales;
++    QVector<qreal> mPredefinedScales;
+ };
+ 
+ #endif
+diff -rupN qgis-2.4.0/src/gui/qgscomposerview.cpp qgis-2.4.0-new/src/gui/qgscomposerview.cpp
+--- qgis-2.4.0/src/gui/qgscomposerview.cpp	2014-06-27 14:00:08.000000000 +0200
++++ qgis-2.4.0-new/src/gui/qgscomposerview.cpp	2014-07-26 21:40:14.809984197 +0200
+@@ -869,7 +869,7 @@ void QgsComposerView::mouseReleaseEvent(
+       else
+       {
+         QgsComposerAttributeTable* newTable = new QgsComposerAttributeTable( composition() );
+-        newTable->setSceneRect( QRectF( mRubberBandItem->transform().dx(), mRubberBandItem->transform().dy(), mRubberBandItem->rect().width(), qMax( mRubberBandItem->rect().height(), 15.0 ) ) );
++        newTable->setSceneRect( QRectF( mRubberBandItem->transform().dx(), mRubberBandItem->transform().dy(), mRubberBandItem->rect().width(), qMax( mRubberBandItem->rect().height(), qreal(15.0) ) ) );
+         QList<const QgsComposerMap*> mapItemList = composition()->composerMapItems();
+         if ( mapItemList.size() > 0 )
+         {
diff --git a/qgis.spec b/qgis.spec
index 0508df8..de1fe92 100644
--- a/qgis.spec
+++ b/qgis.spec
@@ -17,7 +17,7 @@
 
 Name:           qgis
 Version:        2.4.0
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        A user friendly Open Source Geographic Information System
 Group:          Applications/Engineering
 
@@ -43,6 +43,25 @@ Patch0:         %{name}-2.4.0-grass.patch
 # Drop -o option from SIP, as versions older than 4.10 don't have it
 Patch1:         %{name}-2.4.0-sip.patch
 
+# Restore ARM build
+# Thanks to Sandro Mani for supplying this patch:
+#>This patch should not cause any problems for other arches, since qreal is double for those, hence no change.
+#>
+#>The patch is not upstream yet. The part with the
+#>
+#>qMax( mRubberBandItem->rect().height(), qreal(15.0) )
+#>
+#>is clean and ok and can be upstreamed. The rest is all because sip errors out in core/composer/qgsatlascomposition.sip on
+#>
+#>const QVector<double>& predefinedScales()
+#>
+#>with the error
+#> 
+#>unsupported function return type - provide %MethodCode and a C++ signature.
+#>
+#>I'm not really sure why this is the case though, since double exists on ARM, it is just qreal which is not typedefed for double but for float. 
+Patch2:         %{name}-2.4.0-qreal.patch
+
 # Some plug-ins need Pyspatialite (bundled)
 # The license is not totally clear, see:
 # http://code.google.com/p/pyspatialite/issues/detail?id=3
@@ -177,6 +196,7 @@ Please refer to %{name}-mapserver-README.fedora for details!
 %setup -q
 %patch0 -p1 -b .grass~
 %patch1 -p1 -b .sip~
+%patch2 -p1 -b .qreal~
 
 # Solved for releases after 2.4.0
 chmod -x src/gui/qgscolorbutton.cpp src/core/composer/qgscomposershape.h \
@@ -393,8 +413,11 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
 
 
 %changelog
+* Mon Jul 28 2014 Volker Fröhlich <volker27 at gmx.at> - 2.4.0-3
+- Restore ARM build (Thanks to Sandro Mani for the patch!)
+
 * Fri Jul 25 2014 Peter Robinson <pbrobinson at fedoraproject.org> 2.4.0-2
- rebuild (libspatialite)
+- rebuild (libspatialite)
 
 * Sat Jun 28 2014 Volker Fröhlich <volker27 at gmx.at> - 2.4.0-1
 - New upstream release, drop obsolete patches, update remaining


More information about the scm-commits mailing list