Changeset View
Changeset View
Standalone View
Standalone View
head/devel/py-qt5-core/files/patch-configure.py
This patch is necessary for us to split PyQt5 up into several different ports. | This patch is necessary for us to split PyQt5 up into several different ports. | ||||
It works by conditionally building and installing some tools (such as | It works by conditionally building and installing some tools (such as | ||||
pylupdate5 and pyrcc5), replacing the all-encompassing PyQt5.api file that | pylupdate5 and pyrcc5), replacing the all-encompassing PyQt5.api file that | ||||
depends on different modules with module-specific .api files. | depends on different modules with module-specific .api files. | ||||
Also fixes a bug where dbus support drops multiple -I flags produced | Also fixes a bug where dbus support drops multiple -I flags produced | ||||
by pkg-config --cflags dbus-1 . | by pkg-config --cflags dbus-1 . | ||||
--- configure.py.orig 2016-04-24 10:55:08.000000000 +0000 | --- configure.py.orig 2016-07-25 13:55:28.000000000 +0000 | ||||
+++ configure.py 2016-10-30 22:16:19.159104000 +0000 | +++ configure.py 2016-09-14 18:42:40.977955000 +0000 | ||||
@@ -1482,13 +1482,13 @@ | @@ -1460,8 +1460,9 @@ | ||||
generate_sip_module_code(target_config, verbose, no_timestamp, parts, | # Add the internal modules if they are required. | ||||
tracing, 'Qt', sip_flags) | if not target_config.no_tools: | ||||
- pyqt_modules.append('pylupdate') | |||||
- pyqt_modules.append('pyrcc') | |||||
+ if "QtXml" in target_config.pyqt_modules: | |||||
+ pyqt_modules.append('pylupdate') | |||||
+ pyqt_modules.append('pyrcc') | |||||
for mname in pyqt_modules: | |||||
metadata = MODULE_METADATA[mname] | |||||
@@ -1504,18 +1505,19 @@ | |||||
generate_sip_module_code(target_config, verbose, parts, tracing, 'Qt', | |||||
sip_flags, False) | |||||
- subdirs.append('Qt') | - subdirs.append('Qt') | ||||
wrappers = [] | |||||
if not target_config.no_tools: | if not target_config.no_tools: | ||||
- # Generate pylupdate5 and pyrcc5. | - # Generate the pylupdate5 and pyrcc5 wrappers. | ||||
- for tool in ('pylupdate', 'pyrcc'): | - for tool in ('pylupdate', 'pyrcc'): | ||||
- generate_application_makefile(target_config, verbose, tool) | - wrappers.append((tool, | ||||
- subdirs.append(tool) | - generate_tool_wrapper(target_config, tool + '5', | ||||
- 'PyQt5.%s_main' % tool))) | |||||
- | |||||
- # Generate the pyuic5 wrapper. | |||||
- wrappers.append(('pyuic', | |||||
+ if "QtXml" in target_config.pyqt_modules: | + if "QtXml" in target_config.pyqt_modules: | ||||
+ # Generate pylupdate5 and pyrcc5. | + # Generate the pylupdate5 and pyrcc5 wrappers. | ||||
+ for tool in ('pylupdate', 'pyrcc'): | + for tool in ('pylupdate', 'pyrcc'): | ||||
+ generate_application_makefile(target_config, verbose, tool) | + wrappers.append((tool, | ||||
+ subdirs.append(tool) | + generate_tool_wrapper(target_config, tool + '5', | ||||
+ 'PyQt5.%s_main' % tool))) | |||||
+ | |||||
+ if "QtCore" in target_config.pyqt_modules: | |||||
+ # Generate the pyuic5 wrapper. | |||||
+ wrappers.append(('pyuic', | |||||
generate_tool_wrapper(target_config, 'pyuic5', | |||||
'PyQt5.uic.pyuic'))) | |||||
# Generate the pyuic5 wrapper. | @@ -1533,23 +1535,6 @@ | ||||
pyuic_wrapper = generate_pyuic5_wrapper(target_config) | |||||
@@ -1507,22 +1507,6 @@ | |||||
source_path('examples', 'quick', 'tutorials', 'extending', | source_path('examples', 'quick', 'tutorials', 'extending', | ||||
'chapter6-plugins')) | 'chapter6-plugins')) | ||||
- # Generate the QScintilla API file. | - # Generate the QScintilla API file. | ||||
- if target_config.qsci_api: | - if target_config.qsci_api: | ||||
- inform("Generating the QScintilla API file...") | - inform("Generating the QScintilla API file...") | ||||
- f = open_for_writing('PyQt5.api') | - f = open_for_writing('PyQt5.api') | ||||
- | - | ||||
- for mname in target_config.pyqt_modules: | - for mname in target_config.pyqt_modules: | ||||
- if MODULE_METADATA[mname].public: | |||||
- api = open(mname + '.api') | - api = open(mname + '.api') | ||||
- | - | ||||
- for l in api: | - for l in api: | ||||
- f.write('PyQt5.' + l) | - f.write('PyQt5.' + l) | ||||
- | - | ||||
- api.close() | - api.close() | ||||
- os.remove(mname + '.api') | - os.remove(mname + '.api') | ||||
- | - | ||||
- f.close() | - f.close() | ||||
- | - | ||||
# Generate the Python dbus module. | # Generate the Python dbus module. | ||||
if target_config.pydbus_module_dir != '': | if target_config.pydbus_module_dir != '': | ||||
mname = 'dbus' | mname = 'dbus' | ||||
@@ -1548,21 +1532,24 @@ | @@ -1577,14 +1562,18 @@ | ||||
out_f.write('''TEMPLATE = subdirs | out_f.write('''TEMPLATE = subdirs | ||||
CONFIG += ordered nostrip | CONFIG += ordered nostrip | ||||
SUBDIRS = %s | SUBDIRS = %s | ||||
+''' % ' '.join(subdirs)) | +''' % (' '.join(subdirs))) | ||||
+ if "QtCore" in target_config.pyqt_modules: | + if "QtCore" in target_config.pyqt_modules: | ||||
+ out_f.write(''' | + out_f.write(''' | ||||
init_py.files = %s | init_py.files = %s | ||||
init_py.path = %s | init_py.path = %s | ||||
INSTALLS += init_py | INSTALLS += init_py | ||||
-''' % (' '.join(subdirs), source_path('__init__.py'), qmake_quote(target_config.pyqt_module_dir + '/PyQt5'))) | -''' % (' '.join(subdirs), source_path('__init__.py'), root_dir)) | ||||
+''' % (source_path('__init__.py'), qmake_quote(target_config.pyqt_module_dir + '/PyQt5'))) | +''' % (source_path('__init__.py'), root_dir)) | ||||
- # Install the uic module and the pyuic5 wrapper. | - # Install the uic module. | ||||
- out_f.write(''' | - out_f.write(''' | ||||
+ # Install the uic module and the pyuic5 wrapper. | + if not target_config.no_tools: | ||||
+ # Install the uic module. | |||||
+ out_f.write(''' | + out_f.write(''' | ||||
uic_package.files = %s | uic_package.files = %s | ||||
uic_package.path = %s | uic_package.path = %s | ||||
INSTALLS += uic_package | INSTALLS += uic_package | ||||
''' % (source_path('pyuic', 'uic'), qmake_quote(target_config.pyqt_module_dir + '/PyQt5'))) | @@ -1620,11 +1609,12 @@ | ||||
- if not target_config.no_tools: | |||||
- out_f.write(''' | |||||
+ if not target_config.no_tools: | |||||
+ out_f.write(''' | |||||
pyuic5.files = %s | |||||
pyuic5.path = %s | |||||
INSTALLS += pyuic5 | |||||
@@ -1579,11 +1566,12 @@ | |||||
# Install the QScintilla .api file. | # Install the QScintilla .api file. | ||||
if target_config.qsci_api: | if target_config.qsci_api: | ||||
+ api_list = ' '.join(['%s.api' % m for m in target_config.pyqt_modules]) | + api_list = ' '.join(['%s.api' % m for m in target_config.pyqt_modules]) | ||||
out_f.write(''' | out_f.write(''' | ||||
-qscintilla_api.files = PyQt5.api | -qscintilla_api.files = PyQt5.api | ||||
+qscintilla_api.files = %s | +qscintilla_api.files = %s | ||||
qscintilla_api.path = %s | qscintilla_api.path = %s | ||||
INSTALLS += qscintilla_api | INSTALLS += qscintilla_api | ||||
-''' % qmake_quote(target_config.qsci_api_dir + '/api/python')) | -''' % qmake_quote(target_config.qsci_api_dir + '/api/python')) | ||||
+''' % (api_list, qmake_quote(target_config.qsci_api_dir + '/api/python'))) | +''' % (api_list, qmake_quote(target_config.qsci_api_dir + '/api/python'))) | ||||
out_f.close() | out_f.close() | ||||
@@ -2140,7 +2128,9 @@ | |||||
else: | |||||
dlist = target_config.dbus_inc_dirs | |||||
- target_config.dbus_inc_dirs = [] | |||||
+ # Don't reset dbus_inc_dirs, because it will forget the flags | |||||
+ # found for dbus, above (which might require multiple -I flags). | |||||
+ # target_config.dbus_inc_dirs = [] | |||||
for d in dlist: | |||||
if os.access(os.path.join(d, 'dbus', 'dbus-python.h'), os.F_OK): |