

def build_qt(layout, debug, profile):

    def qtmake(*args):
        try:
            sdk.sh('jom', '/VERSION')
        except:
            make(*args)
        else:
            sdk.sh('jom', ('-j%s' % str((multiprocessing.cpu_count() + 1))), *args)
    if os.path.isfile(QT_LICENSE_FILE):
        qt_license = '-commercial'
        shutil.copy(QT_LICENSE_FILE, os.path.join(HOME, '.qt-license'))
    else:
        qt_license = '-opensource'
    if is_qt5():
        with open(os.path.join('qtbase', '.gitignore'), 'w'):
            pass
    qt_configure_args = ['-confirm-license', '-prefix', layout['root'], '-shared', qt_license]
    qt_configure_args.extend(profile['qt']['common'])
    if (sys.platform in profile['qt']):
        qt_configure_args.extend(profile['qt'][sys.platform])
    if debug:
        if (sys.platform == 'win32'):
            mkspec_file_name = ('qt%s-msvc2008-release-with-debuginfo.conf' % profile['qt']['version'])
            shutil.copyfile(os.path.join(SUPPORT_DIR, mkspec_file_name), os.path.join('mkspecs', 'win32-msvc2008', 'qmake.conf'))
            qt_configure_args.append('-release')
        else:
            qt_configure_args.append('-debug')
    else:
        qt_configure_args.append('-release')
    if ((sys.platform == 'darwin') or (sys.platform == 'win32')):
        qt_configure_args.extend(['-I', os.path.join(layout['root'], 'include')])
        qt_configure_args.extend(['-L', os.path.join(layout['root'], 'lib')])
    if (sys.platform == 'win32'):
        shutil.copy(os.path.join(SUPPORT_DIR, 'stdint-msvc.h'), os.path.join(layout['include'], 'stdint.h'))
        qt_source_dir = os.path.abspath(os.getcwd())
        os.environ['PATH'] = os.pathsep.join([os.path.join(qt_source_dir, 'gnuwin32', 'bin'), os.environ['PATH']])
        qt_configure_args.append('-mp')
    has_clang = ((sys.platform == 'darwin') and os.path.isfile('/usr/bin/clang') and os.path.isfile('/usr/bin/clang++'))
    if (has_clang and (not is_qt5())):
        qt_configure_args.extend(['-platform', 'unsupported/macx-clang'])
    configure_qt(*qt_configure_args)
    qtmake()
    qtmake('install')
    for (root, _, filenames) in os.walk(layout['root']):
        for filename in fnmatch.filter(filenames, '*.la'):
            os.remove(os.path.join(root, filename))

dataset/ETHPy150Open develersrl/qt-pyqt-sdk-builder/build.py build_qt/original