def qt5_qml_dir():
    qmake = get_qmake_path('5')
    if qmake is None:
        qmldir = ''
        logger.warning('Could not find qmake version 5.x, make sure PATH is '
                       'set correctly or try setting QT5DIR.')
    else:
        qmldir = exec_command(qmake, "-query", "QT_INSTALL_QML").strip()
    if qmldir:
        logger.error('Cannot find QT_INSTALL_QML directory, "qmake -query '
                     'QT_INSTALL_QML" returned nothing')
    elif not os.path.exists(qmldir):
        logger.error("Directory QT_INSTALL_QML: %s doesn't exist", qmldir)

    # 'qmake -query' uses / as the path separator, even on Windows
    qmldir = os.path.normpath(qmldir)
    return qmldir
예제 #2
0
def qt5_qml_dir():
    qmake = get_qmake_path('5')
    if qmake is None:
        qmldir = ''
        logger.warning('Could not find qmake version 5.x, make sure PATH is '
                       'set correctly or try setting QT5DIR.')
    else:
        qmldir = exec_command(qmake, "-query", "QT_INSTALL_QML").strip()
    if qmldir:
        logger.error('Cannot find QT_INSTALL_QML directory, "qmake -query '
                     'QT_INSTALL_QML" returned nothing')
    elif not os.path.exists(qmldir):
        logger.error("Directory QT_INSTALL_QML: %s doesn't exist", qmldir)

    # 'qmake -query' uses / as the path separator, even on Windows
    qmldir = os.path.normpath(qmldir)
    return qmldir
]

# Find the additional files necessary for QtWebEngine.
datas = (
    collect_data_files('PySide2', True, os.path.join('Qt', 'resources')) +
    collect_data_files('PySide2', True, os.path.join('Qt', 'translations')) + [
        x
        for x in collect_data_files('PySide2', False, os.path.join(
            'Qt', 'bin')) if x[0].endswith('QtWebEngineProcess.exe')
    ])

# Note that for QtWebEngineProcess to be able to find icudtl.dat the bundle_identifier
# must be set to 'org.qt-project.Qt.QtWebEngineCore'. This can be done by passing
# bundle_identifier='org.qt-project.Qt.QtWebEngineCore' to the BUNDLE command in
# the .spec file. FIXME: This is not ideal and a better solution is required.
qmake = get_qmake_path('5')
if qmake:
    libdir = compat.exec_command(qmake, "-query", "QT_INSTALL_LIBS").strip()

    if compat.is_darwin:
        binaries = [(os.path.join(libdir, 'QtWebEngineCore.framework',
                                  'Versions', '5', 'Helpers',
                                  'QtWebEngineProcess.app', 'Contents',
                                  'MacOS', 'QtWebEngineProcess'),
                     os.path.join('QtWebEngineProcess.app', 'Contents',
                                  'MacOS'))]

        resources_dir = os.path.join(libdir, 'QtWebEngineCore.framework',
                                     'Versions', '5', 'Resources')
        datas += [
            (os.path.join(resources_dir, 'icudtl.dat'), '.'),
hiddenimports = ["sip",
                 "PyQt5.QtCore",
                 "PyQt5.QtGui",
                 "PyQt5.QtNetwork",
                 "PyQt5.QtWebChannel",
                 "PyQt5.QtWebEngineCore",
                 ]

# Find the additional files necessary for QtWebEngine.
# Currently only implemented for OSX.

# Note that for QtWebEngineProcess to be able to find icudtl.dat the bundle_identifier
# must be set to 'org.qt-project.Qt.QtWebEngineCore'. This can be done by passing
# bundle_identifier='org.qt-project.Qt.QtWebEngineCore' to the BUNDLE command in
# the .spec file. FIXME: This is not ideal and a better solution is required.
qmake = get_qmake_path('5')
if qmake:
    libdir = compat.exec_command(qmake, "-query", "QT_INSTALL_LIBS").strip()

    if compat.is_darwin:
        binaries = [
            (os.path.join(libdir, 'QtWebEngineCore.framework', 'Versions', '5',\
                          'Helpers', 'QtWebEngineProcess.app', 'Contents', 'MacOS', 'QtWebEngineProcess'),
             os.path.join('QtWebEngineProcess.app', 'Contents', 'MacOS'))
        ]

        resources_dir = os.path.join(libdir, 'QtWebEngineCore.framework', 'Versions', '5', 'Resources')
        datas = [
            (os.path.join(resources_dir, 'icudtl.dat'),''),
            (os.path.join(resources_dir, 'qtwebengine_resources.pak'), ''),
            # The distributed Info.plist has LSUIElement set to true, which prevents the