Blob Blame History Raw
diff -rupN PyQt5_gpl-5.11.2/configure.py PyQt5_gpl-5.11.2-new/configure.py
--- PyQt5_gpl-5.11.2/configure.py	2018-07-20 12:50:10.936605737 +0200
+++ PyQt5_gpl-5.11.2-new/configure.py	2018-07-20 12:50:10.938605751 +0200
@@ -499,19 +499,20 @@ class TargetConfiguration:
 
     def __init__(self):
         """ Initialise the configuration with default values. """
+        prefix = os.environ["PREFIX"]
 
         # Values based on the host Python configuration.
         py_config = HostPythonConfiguration()
         self.py_debug = py_config.debug
-        self.py_inc_dir = py_config.inc_dir
-        self.py_venv_inc_dir = py_config.venv_inc_dir
-        self.py_lib_dir = py_config.lib_dir
-        self.py_platform = py_config.platform
+        self.py_inc_dir = os.path.join(prefix, 'include/python2.7/')
+        self.py_venv_inc_dir = os.path.join(prefix, 'include/python2.7/')
+        self.py_lib_dir = os.path.join(prefix, 'lib')
+        self.py_platform = 'win32-g++'
         self.py_version = py_config.version
-        self.pyqt_bin_dir = py_config.bin_dir
-        self.pyqt_module_dir = py_config.module_dir
-        self.pyqt_stubs_dir = os.path.join(py_config.module_dir, 'PyQt5')
-        self.pyqt_sip_dir = os.path.join(py_config.data_dir, 'sip', 'PyQt5')
+        self.pyqt_bin_dir = os.path.join(prefix, 'bin')
+        self.pyqt_module_dir = os.path.join(prefix, 'lib/python2.7/site-packages')
+        self.pyqt_stubs_dir = os.path.join(prefix, 'lib/python2.7/site-packages', 'PyQt5')
+        self.pyqt_sip_dir = os.path.join(prefix, 'share', 'sip', 'PyQt5')
         self.pyuic_interpreter = py_config.pyuic_interpreter
 
         # Remaining values.
@@ -647,7 +648,7 @@ class TargetConfiguration:
         py_major = self.py_version >> 16
         py_minor = (self.py_version >> 8) & 0x0ff
 
-        if sys.platform == 'win32':
+        if True:
             debug_suffix = self.get_win32_debug_suffix()
 
             # See if we are using the limited API.
@@ -658,7 +659,7 @@ class TargetConfiguration:
             if limited:
                 pylib_lib = 'python%d%s' % (py_major, debug_suffix)
             else:
-                pylib_lib = 'python%d%d%s' % (py_major, py_minor, debug_suffix)
+                pylib_lib = 'python%d.%d%s' % (py_major, py_minor, debug_suffix)
 
             pylib_dir = self.py_lib_dir
 
@@ -1000,7 +1001,7 @@ class TargetConfiguration:
         # it where it is.
         if not self.static:
             pro_lines.extend(['win32 {',
-                    '    LIBS += ' + self.get_pylib_link_arguments(name=False),
+                    '    LIBS += ' + self.get_pylib_link_arguments(name=True),
                     '}'])
 
     @staticmethod
@@ -1394,8 +1395,8 @@ def check_5_1_modules(target_config, dis
             'qsensor.h', 'new QSensor(QByteArray())')
     check_module(target_config, disabled_modules, verbose, 'QtSerialPort',
             'qserialport.h', 'new QSerialPort()')
-    check_module(target_config, disabled_modules, verbose, 'QtX11Extras',
-            'QX11Info', 'QX11Info::display()')
+    #check_module(target_config, disabled_modules, verbose, 'QtX11Extras',
+    #        'QX11Info', 'QX11Info::display()')
 
 
 def check_5_2_modules(target_config, disabled_modules, verbose):
@@ -1624,7 +1625,7 @@ def generate_makefiles(target_config, ve
 
     root_dir = qmake_quote(target_config.pyqt_module_dir + '/PyQt5')
 
-    mod_ext = '.pyd' if sys.platform == 'win32' else '.so'
+    mod_ext = '.pyd'
 
     for mname in pyqt_modules:
         all_installs.append(root_dir + '/' + mname + mod_ext)
@@ -2064,11 +2065,11 @@ def run_make(target_config, verbose, exe
 
     # Guess the name of make and set the default target and platform specific
     # name of the executable.
-    if target_config.py_platform == 'win32':
-        if target_config.qmake_spec == 'win32-g++':
-            make = 'mingw32-make'
-        else:
+    if target_config.py_platform.startswith('win32'):
+        if target_config.qmake_spec.startswith('win32-msvc'):
             make = 'nmake'
+        else:
+            make = 'make'
 
         if target_config.debug:
             makefile_target = 'debug'
@@ -2332,6 +2333,15 @@ def compile_test_program(target_config,
     configuration.  uses_sip_h is set if the test program uses sip.h.
     """
 
+    host_config = TargetConfiguration()
+    host_config.qmake = "qmake-qt5"
+    host_config.qmake_spec = "linux-g++"
+    host_config.py_platform = "linux"
+    host_config.qmake_variables = ""
+    host_config.sip = "/usr/bin/sip"
+    host_config.sip_inc_dir = "/usr/include/python2.7/"
+    host_config.py_inc_dir = "/usr/include/python2.7/"
+
     metadata = MODULE_METADATA[mname]
 
     # The derived file names.
@@ -2350,11 +2360,11 @@ def compile_test_program(target_config,
 
     # Create the .pro file.
     pro_lines = []
-    pro_add_qt_dependencies(target_config, metadata, pro_lines, debug)
+    pro_add_qt_dependencies(host_config, metadata, pro_lines, debug)
     pro_lines.append('TARGET = %s' % name)
 
     if uses_sip_h:
-        target_config.add_sip_h_directives(pro_lines)
+        host_config.add_sip_h_directives(pro_lines)
 
     pro_lines.append('SOURCES = %s' % qmake_quote(name_source))
 
@@ -2362,10 +2372,10 @@ def compile_test_program(target_config,
     f.write('\n'.join(pro_lines))
     f.close()
 
-    if not run_qmake(target_config, verbose, name_pro, name_makefile, fatal=False):
+    if not run_qmake(host_config, verbose, name_pro, name_makefile, fatal=False):
         return None
 
-    return run_make(target_config, verbose, name, name_makefile)
+    return run_make(host_config, verbose, name, name_makefile)
 
 
 def run_test_program(mname, test, verbose):
@@ -2443,7 +2453,7 @@ def get_sip_flags(target_config):
         sip_flags.append('-D')
 
     # Handle the platform tag.
-    if target_config.py_platform == 'win32':
+    if target_config.py_platform.startswith('win32'):
         plattag = 'WS_WIN'
     elif target_config.py_platform == 'darwin':
         plattag = 'WS_MACX'