File use-qthttp-addon.patch of Package gaia2

Index: gaia-2.4.5/src/wscript
===================================================================
--- gaia-2.4.5.orig/src/wscript
+++ gaia-2.4.5/src/wscript
@@ -19,6 +19,12 @@ def options(opt):
 def configure(conf):
     conf.env['WITH_STLFACADE'] = conf.options.with_stlfacade
     conf.env['WITH_TESTS'] = conf.options.with_tests
+    conf.env.LIB_SVM = ['svm']
+
+    conf.env.INCLUDES_QTHTTP = ['src/3rdparty/qthttp/include/QtHttp']
+    conf.env.STLIBPATH_QTHTTP = ['src/3rdparty/qthttp/lib' ]
+    conf.env.STLIB_QTHTTP = ['Qt5Http' ]
+
     conf.recurse('bindings')
 
 def install_tree(bld, dst, src):
@@ -44,8 +50,8 @@ def build_library(bld):
     gaialib = bld.stlib(
         source   = sources,
         target   = 'gaia2',
-        uselib   = 'QT5CORE QT5NETWORK QT5CONCURRENT',
-        use      = bld.env['USELIB'] + ['svm'],
+        uselib   = 'QT5CORE QT5NETWORK QT5CONCURRENT SVM',
+        use      = bld.env['USELIB'],
         install_path = '${PREFIX}/lib%s' % Utils.lib64(),
         includes = [ '.', 'metrics', '3rdparty' ]
     )
@@ -95,7 +101,7 @@ def build_tools(bld):
         source = 'tools/gaiamerge.cpp',
         target = 'tools/gaiamerge',
         includes = [ '.', 'metrics', '3rdparty' ] + qtincludes,
-        uselib   = 'QT5CORE QT5NETWORK QT5CONCURRENT',
+        uselib   = 'QT5CORE QT5NETWORK QT5CONCURRENT SVM',
         use = ['gaia2'] + bld.env['USELIB'])
 
     # info utility
@@ -103,7 +109,7 @@ def build_tools(bld):
         source = 'tools/gaiainfo.cpp',
         target = 'tools/gaiainfo',
         includes = [ '.', 'metrics', '3rdparty' ] + qtincludes,
-        uselib   = 'QT5CORE QT5NETWORK QT5CONCURRENT',
+        uselib   = 'QT5CORE QT5NETWORK QT5CONCURRENT SVM',
         use = ['gaia2'] + bld.env['USELIB'])
     
     # GaiaFusion
@@ -114,7 +120,7 @@ def build_tools(bld):
         source = 'tools/gaiafreeze.cpp',
         target = 'tools/gaiafreeze',
         includes = [ '.', 'metrics', '3rdparty' ] + qtincludes,
-        uselib   = 'QT5CORE QT5NETWORK QT5CONCURRENT',
+        uselib   = 'QT5CORE QT5NETWORK QT5CONCURRENT SVM',
         use = ['gaia2'] + bld.env['USELIB'])
         
     if is_dev_version(bld):
@@ -139,9 +145,9 @@ def build_tools(bld):
             tools/cyclops_server/yamlrpcserver.cpp
             ''',
             target = 'tools/cyclops',
-            includes = [ '.', 'metrics', '3rdparty' ] + qtincludes,
-
-            use = ['gaia2'] + bld.env['USELIB'] + ['Qt5Core', 'Qt5Network', 'Qt5Concurrent'])
+            includes = [ '.', 'metrics', '3rdparty', '3rdparty/qthttp/include/QtHttp'] + qtincludes,
+            uselib   = 'QT5CORE QT5NETWORK QT5CONCURRENT SVM QTHTTP',
+            use = ['gaia2'] + bld.env['USELIB'])
 
         # cyclops "master" server
         bld(
@@ -154,7 +160,8 @@ def build_tools(bld):
             tools/cyclops_server/yamlrpcserver.cpp
             ''',
             target = 'tools/cyclopsmaster',
-            includes = [ '.', 'metrics', '3rdparty', 'tools/cyclops_server/' ] + qtincludes,
+            includes = [ '.', 'metrics', '3rdparty', 'tools/cyclops_server/', '3rdparty/qthttp/include/QtHttp'] + qtincludes,
+            uselib   = 'QT5CORE QT5NETWORK QT5CONCURRENT SVM QTHTTP',
             use = ['gaia2'] + bld.env['USELIB'])
 
         # cyclops init scripts
Index: gaia-2.4.5/wscript
===================================================================
--- gaia-2.4.5.orig/wscript
+++ gaia-2.4.5/wscript
@@ -217,7 +217,7 @@ def configure(conf):
         Name: libgaia2
         Description: A library for doing similarity in semimetric spaces
         Version: %(version)s
-        Libs: -L${libdir} -L${qtlibdir} -lgaia2 -lQt5Core -lQt5Network -lQt5Concurrent -lyaml %(tbblib)s
+        Libs: -L${libdir} -L${qtlibdir} -lgaia2 -lQt5Core -lQt5Network -lQt5Concurrent -lyaml -lsvm %(tbblib)s
         Cflags: -I${includedir} ${qtincludes}
         ''' % opts
 
@@ -240,7 +240,7 @@ def configure(conf):
         Name: libgaia2
         Description: A library for doing similarity in semimetric spaces
         Version: %(version)s
-        Libs: -L${libdir} ${qtlibdir} -lgaia2 -lyaml %(tbblib)s
+        Libs: -L${libdir} ${qtlibdir} -lgaia2 -lyaml -lsvm %(tbblib)s
         Cflags: -I${includedir} ${qtincludes}
         ''' % opts
 
Index: gaia-2.4.5/src/3rdparty/wscript
===================================================================
--- gaia-2.4.5.orig/src/3rdparty/wscript
+++ gaia-2.4.5/src/3rdparty/wscript
@@ -5,7 +5,12 @@ import os, os.path
 from waflib import Utils
 
 def build(bld):
-    os.chdir(os.path.join(bld.top_dir, 'src/3rdparty/qthttp'))
-    os.system('qmake-qt5')
+    try:
+        os.makedirs(os.path.join(bld.out_dir, 'src/3rdparty/qthttp'))
+    except OSError:
+        pass
+    os.chdir(os.path.join(bld.out_dir, 'src/3rdparty/qthttp'))
+    os.system('syncqt.pl ../../../../src/3rdparty/qthttp -version 5.1.0')
+    os.system('qmake-qt5 ../../../../src/3rdparty/qthttp')
     os.system('make')
     os.chdir(bld.top_dir)