[qgis] 01/02: Add upstream patch to support building QGIS server with Qt5.

Sebastiaan Couwenberg sebastic at moszumanska.debian.org
Fri Mar 25 17:54:38 UTC 2016


This is an automated email from the git hooks/post-receive script.

sebastic pushed a commit to branch qt5
in repository qgis.

commit 14dcdb11411761c79a019b2ca02e3c89b68aea1b
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Wed Mar 16 01:16:28 2016 +0100

    Add upstream patch to support building QGIS server with Qt5.
    
    Re-enable server.
---
 debian/changelog                                   |   1 +
 debian/libqgis-dev.install                         |   2 +-
 debian/libqgis-server2.14.0.install                |   2 +-
 ...-usage-of-QFtp-and-remove-from-Qt5-builds.patch | 241 +++++++++++++++++++++
 debian/patches/series                              |   1 +
 debian/qgis-server.install                         |   8 +-
 debian/rules                                       |   2 +-
 7 files changed, 250 insertions(+), 7 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 5b4afee..97183d6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,7 @@ qgis (2.14.0+dfsg0-4~exp1) UNRELEASED; urgency=medium
   * Add patch to fix QSpatiaLite provider build failure with Qt5.
   * Add upstream patch to make pyuic4-wrapper PyQt5 aware.
   * Add patch to not require Python 3 for Qt5.
+  * Add upstream patch to support building QGIS server with Qt5.
 
  -- Bas Couwenberg <sebastic at debian.org>  Fri, 08 May 2015 23:40:06 +0200
 
diff --git a/debian/libqgis-dev.install b/debian/libqgis-dev.install
index eca003a..82783f5 100644
--- a/debian/libqgis-dev.install
+++ b/debian/libqgis-dev.install
@@ -4,7 +4,7 @@ usr/lib/libqgis_core.so
 usr/lib/libqgis_gui.so
 usr/lib/libqgis_analysis.so
 usr/lib/libqgis_networkanalysis.so
-#usr/lib/libqgis_server.so
+usr/lib/libqgis_server.so
 usr/lib/libqgisgrass7.so
 usr/lib/libqgispython.so
 usr/share/qgis/FindQGIS.cmake
diff --git a/debian/libqgis-server2.14.0.install b/debian/libqgis-server2.14.0.install
index 9b686b9..662fc2d 100644
--- a/debian/libqgis-server2.14.0.install
+++ b/debian/libqgis-server2.14.0.install
@@ -1 +1 @@
-#usr/lib/libqgis_server.so.*
+usr/lib/libqgis_server.so.*
diff --git a/debian/patches/qt5-server-deprecate-usage-of-QFtp-and-remove-from-Qt5-builds.patch b/debian/patches/qt5-server-deprecate-usage-of-QFtp-and-remove-from-Qt5-builds.patch
new file mode 100644
index 0000000..424c526
--- /dev/null
+++ b/debian/patches/qt5-server-deprecate-usage-of-QFtp-and-remove-from-Qt5-builds.patch
@@ -0,0 +1,241 @@
+From 39047221ce43f419ea7fd93e302c6579b32786a5 Mon Sep 17 00:00:00 2001
+Origin: https://github.com/qgis/QGIS/commit/39047221ce43f419ea7fd93e302c6579b32786a5
+From: Matthias Kuhn <matthias at opengis.ch>
+Date: Mon, 14 Mar 2016 09:28:58 +0100
+Subject: [qt5 server] deprecate usage of QFtp and remove from Qt5 builds
+
+--- a/src/server/CMakeLists.txt
++++ b/src/server/CMakeLists.txt
+@@ -31,7 +31,6 @@ SET ( qgis_mapserv_SRCS
+   qgswcsserver.cpp
+   qgsmapserviceexception.cpp
+   qgsmslayercache.cpp
+-  qgsftptransaction.cpp
+   qgsmslayerbuilder.cpp
+   qgshostedvdsbuilder.cpp
+   qgsinterpolationlayerbuilder.cpp
+@@ -50,14 +49,19 @@ SET ( qgis_mapserv_SRCS
+   qgssldconfigparser.cpp
+   qgsconfigparserutils.cpp
+   qgsserver.cpp
++)
++IF("${Qt5Network_VERSION}" VERSION_LESS "5.0.0")
++  SET (qgis_mapserv_SRCS ${qgis_mapserv_SRCS}
++    qgsftptransaction.cpp
+   )
++ENDIF("${Qt5Network_VERSION}" VERSION_LESS "5.0.0")
++
+ 
+ # SET (qgis_mapserv_UIS
+ # none used
+ # )
+ 
+ SET (qgis_mapserv_MOC_HDRS
+-  qgsftptransaction.h
+   qgscapabilitiescache.h
+   qgsconfigcache.h
+   qgsmslayercache.h
+@@ -65,6 +69,12 @@ SET (qgis_mapserv_MOC_HDRS
+   qgsserverstreamingdevice.h
+ )
+ 
++IF("${Qt5Network_VERSION}" VERSION_LESS "5.0.0")
++  SET (qgis_mapserv_MOC_HDRS ${qgis_mapserv_MOC_HDRS}
++    qgsftptransaction.h
++  )
++ENDIF("${Qt5Network_VERSION}" VERSION_LESS "5.0.0")
++
+ SET (qgis_mapserv_RCCS
+   # not used
+   #qgis_mapserv.qrc
+--- a/src/server/qgsftptransaction.h
++++ b/src/server/qgsftptransaction.h
+@@ -17,19 +17,22 @@
+ 
+ #include <QFtp>
+ 
+-/** A class for synchronous ftp access (using QFtp in background)*/
++/** A class for synchronous ftp access (using QFtp in background)
++ *
++ * @deprecated because of QFtp removal in Qt5.
++ */
+ class QgsFtpTransaction: public QObject
+ {
+     Q_OBJECT
+   public:
+-    QgsFtpTransaction();
++    Q_DECL_DEPRECATED QgsFtpTransaction();
+     ~QgsFtpTransaction();
+ 
+     /** Transfers the file with the given Url and stores it into ba
+        @param ftpUrl url of the file to access
+        @param pointer to buffer to store file contents
+        @return 0 in case of success*/
+-    int get( const QString& ftpUrl, QByteArray& ba );
++    Q_DECL_DEPRECATED int get( const QString& ftpUrl, QByteArray& ba );
+ 
+   public slots:
+     void setFinishedFlag( bool error );
+--- a/src/server/qgshttprequesthandler.cpp
++++ b/src/server/qgshttprequesthandler.cpp
+@@ -17,9 +17,12 @@
+  *                                                                         *
+  ***************************************************************************/
+ 
++#include "qgis.h"
+ #include "qgshttprequesthandler.h"
++#if QT_VERSION < 0x050000
+ #include "qgsftptransaction.h"
+ #include "qgshttptransaction.h"
++#endif
+ #include "qgsmessagelog.h"
+ #include "qgsmapserviceexception.h"
+ #include <QBuffer>
+@@ -37,7 +40,7 @@ QgsHttpRequestHandler::QgsHttpRequestHan
+     : QgsRequestHandler()
+ {
+   mException = nullptr;
+-  mHeadersSent = FALSE;
++  mHeadersSent = false;
+   mCaptureOutput = captureOutput;
+ }
+ 
+@@ -165,7 +168,7 @@ void QgsHttpRequestHandler::sendHeaders(
+   }
+   addToResponseHeader( "\n" );
+   mHeaders.clear();
+-  mHeadersSent = TRUE;
++  mHeadersSent = true;
+ }
+ 
+ void QgsHttpRequestHandler::sendBody()
+@@ -574,6 +577,7 @@ void QgsHttpRequestHandler::requestStrin
+     }
+     else if ( key.compare( "SLD", Qt::CaseInsensitive ) == 0 )
+     {
++#if QT_VERSION < 0x050000
+       QByteArray fileContents;
+       if ( value.startsWith( "http", Qt::CaseInsensitive ) )
+       {
+@@ -585,18 +589,24 @@ void QgsHttpRequestHandler::requestStrin
+       }
+       else if ( value.startsWith( "ftp", Qt::CaseInsensitive ) )
+       {
++        Q_NOWARN_DEPRECATED_PUSH;
+         QgsFtpTransaction ftp;
+         if ( !ftp.get( value, fileContents ) )
+         {
+           continue;
+         }
+         value = QUrl::fromPercentEncoding( fileContents );
++        Q_NOWARN_DEPRECATED_POP;
+       }
+       else
+       {
+         continue; //only http and ftp supported at the moment
+       }
+       value = QUrl::fromPercentEncoding( fileContents );
++#else
++      QgsMessageLog::logMessage( "http and ftp methods not supported with Qt5." );
++      continue;
++#endif
+ 
+     }
+     parameters.insert( key.toUpper(), value );
+--- a/src/server/qgsremotedatasourcebuilder.cpp
++++ b/src/server/qgsremotedatasourcebuilder.cpp
+@@ -15,9 +15,12 @@
+  *                                                                         *
+  ***************************************************************************/
+ 
++#include "qgis.h"
+ #include "qgsremotedatasourcebuilder.h"
++#if QT_VERSION < 0x050000
+ #include "qgsftptransaction.h"
+ #include "qgshttptransaction.h"
++#endif
+ #include "qgslogger.h"
+ #include "qgsrasterlayer.h"
+ #include "qgsvectorlayer.h"
+@@ -161,6 +164,7 @@ QgsVectorLayer* QgsRemoteDataSourceBuild
+ 
+ int QgsRemoteDataSourceBuilder::loadData( const QString& url, QByteArray& data ) const
+ {
++#if QT_VERSION < 0x050000
+   if ( url.startsWith( "http", Qt::CaseInsensitive ) )
+   {
+     QgsHttpTransaction http( url );
+@@ -172,11 +176,18 @@ int QgsRemoteDataSourceBuilder::loadData
+   }
+   else if ( url.startsWith( "ftp", Qt::CaseInsensitive ) )
+   {
++    Q_NOWARN_DEPRECATED_PUSH;
+     QgsFtpTransaction ftp;
+     if ( ftp.get( url, data ) != 0 )
+     {
+       return 1;
+     }
++    Q_NOWARN_DEPRECATED_POP;
+   }
++#else
++  Q_UNUSED( url )
++  Q_UNUSED( data )
++  QgsDebugMsg( "http and ftp remote datasources not supported with Qt5" );
++#endif
+   return 0;
+ }
+--- a/src/server/qgsremoteowsbuilder.cpp
++++ b/src/server/qgsremoteowsbuilder.cpp
+@@ -17,7 +17,9 @@
+ 
+ #include "qgsdatasourceuri.h"
+ #include "qgsremoteowsbuilder.h"
++#if QT_VERSION < 0x050000
+ #include "qgshttptransaction.h"
++#endif
+ #include "qgslogger.h"
+ #include "qgsmslayercache.h"
+ #include "qgsrasterlayer.h"
+@@ -239,6 +241,8 @@ QgsRasterLayer* QgsRemoteOWSBuilder::wcs
+ {
+   Q_UNUSED( layerName );
+   Q_UNUSED( allowCaching );
++
++#if QT_VERSION < 0x050000
+   QgsDebugMsg( "Entering" );
+ 
+   //write server url and coverage name to a temporary file
+@@ -339,7 +343,6 @@ QgsRasterLayer* QgsRemoteOWSBuilder::wcs
+   wcsRequest += "&BBOX=" + bbox;
+ 
+   QgsDebugMsg( "WCS request is: " + wcsRequest );
+-
+   //make request and store byte array into temporary file
+   QgsHttpTransaction httpTransaction( wcsRequest );
+   QByteArray result;
+@@ -355,6 +358,14 @@ QgsRasterLayer* QgsRemoteOWSBuilder::wcs
+   QgsRasterLayer* rl = new QgsRasterLayer( fileName, layerNameFromUri( fileName ) );
+   layersToRemove.push_back( rl ); //make sure the layer gets deleted after each request
+   return rl;
++#else
++  Q_UNUSED( url )
++  Q_UNUSED( filesToRemove )
++  Q_UNUSED( layersToRemove )
++  QgsDebugMsg( "remote http not supported with Qt5" );
++  return nullptr;
++#endif
++
+ }
+ 
+ QgsVectorLayer* QgsRemoteOWSBuilder::sosLayer( const QDomElement& remoteOWSElem, const QString& url, const QString& layerName, QList<QgsMapLayer*>& layersToRemove, bool allowCaching ) const
+--- a/src/server/qgsserverprojectparser.cpp
++++ b/src/server/qgsserverprojectparser.cpp
+@@ -1398,7 +1398,7 @@ QList<QDomElement> QgsServerProjectParse
+   QDomElement wmsRestrictedComposersElem = propertiesElem.firstChildElement( "WMSRestrictedComposers" );
+   if ( wmsRestrictedComposersElem.isNull() )
+   {
+-    for ( unsigned int i = 0; i < composerNodeList.length(); ++i )
++    for ( int i = 0; i < composerNodeList.size(); ++i )
+     {
+       composerElemList.push_back( composerNodeList.at( i ).toElement() );
+     }
diff --git a/debian/patches/series b/debian/patches/series
index 25b1e92..16b09fa 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -9,3 +9,4 @@ qt5-globe-plugin.patch
 qt5-qspatialite.patch
 make-pyuic4-wrapper-PyQt5-aware.patch
 qt5-bindings.patch
+qt5-server-deprecate-usage-of-QFtp-and-remove-from-Qt5-builds.patch
diff --git a/debian/qgis-server.install b/debian/qgis-server.install
index 6341f43..153d784 100644
--- a/debian/qgis-server.install
+++ b/debian/qgis-server.install
@@ -1,4 +1,4 @@
-#usr/lib/cgi-bin/qgis_mapserv.fcgi
-#usr/lib/cgi-bin/admin.sld
-#usr/lib/cgi-bin/wms_metadata.xml
-#usr/lib/cgi-bin/schemaExtension.xsd
+usr/lib/cgi-bin/qgis_mapserv.fcgi
+usr/lib/cgi-bin/admin.sld
+usr/lib/cgi-bin/wms_metadata.xml
+usr/lib/cgi-bin/schemaExtension.xsd
diff --git a/debian/rules b/debian/rules
index 5de50ea..28250bd 100755
--- a/debian/rules
+++ b/debian/rules
@@ -61,7 +61,7 @@ CMAKE_OPTS := \
 	-DENABLE_QT5=TRUE \
 	-DENABLE_PYTHON3=FALSE \
 	-DWITH_QSPATIALITE=TRUE \
-	-DWITH_SERVER=FALSE \
+	-DWITH_SERVER=TRUE \
 	-DWITH_SERVER_PLUGINS=TRUE \
 	-DSERVER_SKIP_ECW=TRUE \
 	-DQGIS_CGIBIN_SUBDIR=/usr/lib/cgi-bin \

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/qgis.git



More information about the Pkg-grass-devel mailing list