Blame PyQt5_configure.patch

0626210
diff -rupN PyQt5_gpl-5.9/configure.py PyQt5_gpl-5.9-new/configure.py
0626210
--- PyQt5_gpl-5.9/configure.py	2017-07-03 18:25:14.000000000 +0200
0626210
+++ PyQt5_gpl-5.9-new/configure.py	2017-07-12 23:10:17.071698512 +0200
0626210
@@ -473,19 +473,20 @@ class TargetConfiguration:
0626210
 
0626210
     def __init__(self):
0626210
         """ Initialise the configuration with default values. """
0626210
+        prefix = os.environ["PREFIX"]
0626210
 
0626210
         # Values based on the host Python configuration.
0626210
         py_config = HostPythonConfiguration()
0626210
         self.py_debug = py_config.debug
0626210
-        self.py_inc_dir = py_config.inc_dir
0626210
-        self.py_venv_inc_dir = py_config.venv_inc_dir
0626210
-        self.py_lib_dir = py_config.lib_dir
0626210
-        self.py_platform = py_config.platform
0626210
+        self.py_inc_dir = os.path.join(prefix, 'include/python2.7/')
0626210
+        self.py_venv_inc_dir = os.path.join(prefix, 'include/python2.7/')
0626210
+        self.py_lib_dir = os.path.join(prefix, 'lib')
0626210
+        self.py_platform = 'win32-g++'
0626210
         self.py_version = py_config.version
0626210
-        self.pyqt_bin_dir = py_config.bin_dir
0626210
-        self.pyqt_module_dir = py_config.module_dir
0626210
-        self.pyqt_stubs_dir = os.path.join(py_config.module_dir, 'PyQt5')
0626210
-        self.pyqt_sip_dir = os.path.join(py_config.data_dir, 'sip', 'PyQt5')
0626210
+        self.pyqt_bin_dir = os.path.join(prefix, 'bin')
0626210
+        self.pyqt_module_dir = os.path.join(prefix, 'lib/python2.7/site-packages')
0626210
+        self.pyqt_stubs_dir = os.path.join(prefix, 'lib/python2.7/site-packages', 'PyQt5')
0626210
+        self.pyqt_sip_dir = os.path.join(prefix, 'share', 'sip', 'PyQt5')
0626210
         self.pyuic_interpreter = py_config.pyuic_interpreter
0626210
 
0626210
         # Remaining values.
0626210
@@ -625,7 +626,7 @@ class TargetConfiguration:
0626210
         py_major = self.py_version >> 16
0626210
         py_minor = (self.py_version >> 8) & 0x0ff
0626210
 
0626210
-        if sys.platform == 'win32':
0626210
+        if True:
0626210
             debug_suffix = self.get_win32_debug_suffix()
0626210
 
0626210
             # See if we are using the limited API.
0626210
@@ -636,7 +637,7 @@ class TargetConfiguration:
0626210
             if limited:
0626210
                 pylib_lib = 'python%d%s' % (py_major, debug_suffix)
0626210
             else:
0626210
-                pylib_lib = 'python%d%d%s' % (py_major, py_minor, debug_suffix)
0626210
+                pylib_lib = 'python%d.%d%s' % (py_major, py_minor, debug_suffix)
0626210
 
0626210
             pylib_dir = self.py_lib_dir
0626210
 
0626210
@@ -1316,8 +1317,8 @@ def check_5_1_modules(target_config, dis
0626210
             'qsensor.h', 'new QSensor(QByteArray())')
0626210
     check_module(target_config, disabled_modules, verbose, 'QtSerialPort',
0626210
             'qserialport.h', 'new QSerialPort()')
0626210
-    check_module(target_config, disabled_modules, verbose, 'QtX11Extras',
0626210
-            'QX11Info', 'QX11Info::display()')
0626210
+    #check_module(target_config, disabled_modules, verbose, 'QtX11Extras',
0626210
+    #        'QX11Info', 'QX11Info::display()')
0626210
 
0626210
 
0626210
 def check_5_2_modules(target_config, disabled_modules, verbose):
0626210
@@ -1918,11 +1919,11 @@ def run_make(target_config, verbose, exe
0626210
 
0626210
     # Guess the name of make and set the default target and platform specific
0626210
     # name of the executable.
0626210
-    if target_config.py_platform == 'win32':
0626210
-        if target_config.qmake_spec == 'win32-g++':
0626210
-            make = 'mingw32-make'
0626210
-        else:
0626210
+    if target_config.py_platform.startswith('win32'):
0626210
+        if target_config.qmake_spec.startswith('win32-msvc'):
0626210
             make = 'nmake'
0626210
+        else:
0626210
+            make = 'make'
0626210
 
0626210
         if target_config.debug:
0626210
             makefile_target = 'debug'
0626210
@@ -2188,6 +2189,12 @@ def compile_test_program(target_config,
0626210
     configuration.
0626210
     """
0626210
 
0626210
+    host_config = TargetConfiguration()
0626210
+    host_config.qmake = "qmake-qt5"
0626210
+    host_config.qmake_spec = "linux-g++"
0626210
+    host_config.py_platform = "linux"
0626210
+    host_config.qmake_variables = ""
0626210
+
0626210
     metadata = MODULE_METADATA[mname]
0626210
 
0626210
     # The derived file names.
0626210
@@ -2206,7 +2213,7 @@ def compile_test_program(target_config,
0626210
 
0626210
     # Create the .pro file.
0626210
     pro_lines = []
0626210
-    pro_add_qt_dependencies(target_config, metadata, pro_lines, debug)
0626210
+    pro_add_qt_dependencies(host_config, metadata, pro_lines, debug)
0626210
     pro_lines.append('TARGET = %s' % name)
0626210
     pro_lines.append('SOURCES = %s' % name_source)
0626210
 
0626210
@@ -2214,10 +2221,10 @@ def compile_test_program(target_config,
0626210
     f.write('\n'.join(pro_lines))
0626210
     f.close()
0626210
 
0626210
-    if not run_qmake(target_config, verbose, name_pro, name_makefile, fatal=False):
0626210
+    if not run_qmake(host_config, verbose, name_pro, name_makefile, fatal=False):
0626210
         return None
0626210
 
0626210
-    return run_make(target_config, verbose, name, name_makefile)
0626210
+    return run_make(host_config, verbose, name, name_makefile)
0626210
 
0626210
 
0626210
 def run_test_program(mname, test, verbose):
0626210
@@ -2295,7 +2302,7 @@ def get_sip_flags(target_config):
0626210
         sip_flags.append('-D')
0626210
 
0626210
     # Handle the platform tag.
0626210
-    if target_config.py_platform == 'win32':
0626210
+    if target_config.py_platform.startswith('win32'):
0626210
         plattag = 'WS_WIN'
0626210
     elif target_config.py_platform == 'darwin':
0626210
         plattag = 'WS_MACX'