示例#1
0
def main():
    bldinstallercommon.init_common_module(os.path.dirname(os.path.realpath(__file__)))
    base_path = os.path.join(os.environ['PKG_NODE_ROOT'], 'build')
    branch = os.environ['CLANG_BRANCH']
    src_path = os.path.join(base_path, 'llvm')
    clang_src_path = os.path.join(base_path, 'llvm', 'tools', 'clang')
    patch_src_path = os.path.join(base_path, 'tqtc-testconfig', 'projects', os.environ['PULSE_PROJECT'], 'stages', 'patches')
    build_path = os.path.join(base_path, 'build')
    install_path = os.path.join(base_path, 'libclang')
    bitness = 64 if '64' in os.environ['cfg'] else 32
    toolchain = os.environ['cfg'].split('-')[1].lower()
    environment = build_environment(toolchain, bitness)
    profile_data_url = profile_data(toolchain)
    profile_data_path = os.path.join(build_path, 'profile_data')
    generate_instrumented = os.environ.get('GENERATE_INSTRUMENTED_BINARIES') == '1'
    instrumented_tag = '-instrumented' if generate_instrumented else ''
    result_file_path = os.path.join(base_path, 'libclang-' + branch + '-' + os.environ['CLANG_PLATFORM'] + instrumented_tag + '.7z')
    remote_path = (os.environ['PACKAGE_STORAGE_SERVER_USER'] + '@' + os.environ['PACKAGE_STORAGE_SERVER'] + ':'
                   + os.environ['PACKAGE_STORAGE_SERVER_BASE_DIR'] + '/' + os.environ['CLANG_UPLOAD_SERVER_PATH'])

    get_clang(base_path, os.environ['LLVM_REVISION'], os.environ['CLANG_REVISION'])
    profile_data_path = get_profile_data(profile_data_path, profile_data_url, generate_instrumented)
    apply_patches(clang_src_path, sorted(glob.glob(os.path.join(patch_src_path, '*'))))
    build_clang(toolchain, src_path, build_path, install_path, profile_data_path, generate_instrumented, bitness, environment, build_type='Release')
    package_clang(install_path, result_file_path)
    upload_clang(result_file_path, remote_path)
def init_env(optionDict):
    # Define the base directory under which the rest of directories exist
    # Staging specific
    optionDict["REPO_STAGING_SERVER_TEST_REPO"] = (
        optionDict["STAGING_SRV_ONLINE_REPO_BASE_PATH"] + "/" + optionDict["LICENSE"] + "/staging"
    )
    optionDict["REPO_STAGING_SERVER_TEST_REPO_PENDING"] = (
        optionDict["STAGING_SRV_ONLINE_REPO_BASE_PATH"] + "/" + optionDict["LICENSE"] + "/staging_pending"
    )
    optionDict["REPO_STAGING_SERVER_HOME_TOOLS"] = optionDict["REPO_STAGING_SERVER_HOME"] + "/qtsdk/packaging-tools"
    # Production specific directories are set directly from environment

    onlineRepositoryBaseName = os.environ.get("ONLINE_REPOSITORY_BASE_NAME")
    optionDict["ONLINE_REPOSITORY_BASE_NAME"] = (
        onlineRepositoryBaseName if onlineRepositoryBaseName else "qtsdkrepository"
    )

    print("Staging server: {0}".format(optionDict["PKG_STAGING_SERVER"]))
    print("Staging server uname: {0}".format(optionDict["PKG_STAGING_SERVER_UNAME"]))
    print("Staging server base directory: {0}".format(optionDict["REPO_STAGING_SERVER_TEST_REPO"]))
    print("Staging server base directory pending: {0}".format(optionDict["REPO_STAGING_SERVER_TEST_REPO_PENDING"]))
    print("Staging server tools dir: {0}".format(optionDict["REPO_STAGING_SERVER_HOME_TOOLS"]))
    print("Production server: {0}".format(optionDict["PROD_ADDR"]))
    print("Production server uname: {0}".format(optionDict["PROD_USER"]))
    print("Production server base directory: {0}".format(optionDict["PROD_SRV_REPO_BASE_PATH"]))
    print("Production server base directory pending: {0}".format(optionDict["PROD_SRV_REPO_PENDING_AREA_DIR"]))
    print(
        "Production server base directory dist update work: {0}".format(
            optionDict["REPO_STAGING_SERVER_TEST_REPO_DIST_WORK"]
        )
    )
    print("Configurations file base dir: {0}".format(optionDict["CONFIGURATIONS_FILE_BASE_DIR"]))
    bldinstallercommon.init_common_module(SCRIPT_ROOT_DIR)
示例#3
0
def main():
    bldinstallercommon.init_common_module(os.path.dirname(os.path.realpath(__file__)))
    base_path = os.path.join(os.environ['PKG_NODE_ROOT'])
    branch = os.environ['CLANG_BRANCH']
    src_path = os.path.join(base_path, 'llvm')
    build_path = os.path.join(base_path, 'build')
    install_path = os.path.join(base_path, 'libclang')
    bitness = 64 if '64' in os.environ['cfg'] else 32
    toolchain = os.environ['cfg'].split('-')[1].lower()
    environment = build_environment(toolchain, bitness)
    profile_data_url = profile_data(toolchain)
    profile_data_path = os.path.join(build_path, 'profile_data')
    generate_instrumented = os.environ.get('GENERATE_INSTRUMENTED_BINARIES') == '1'
    instrumented_tag = '-instrumented' if generate_instrumented else ''
    result_file_path = os.path.join(base_path, 'libclang-' + branch + '-' + os.environ['CLANG_PLATFORM'] + instrumented_tag + '.7z')
    remote_path = (os.environ['PACKAGE_STORAGE_SERVER_USER'] + '@' + os.environ['PACKAGE_STORAGE_SERVER'] + ':'
                   + os.environ['PACKAGE_STORAGE_SERVER_BASE_DIR'] + '/' + os.environ['CLANG_UPLOAD_SERVER_PATH'])

    get_clang(base_path, os.environ['LLVM_REVISION'], os.environ['CLANG_REVISION'])
    profile_data_path = get_profile_data(profile_data_path, profile_data_url, generate_instrumented)
    patch_src_path = os.environ.get('CLANG_PATCHES')
    if patch_src_path:
        if not os.path.isabs(patch_src_path):
            patch_src_path = os.path.join(base_path, patch_src_path)
        if not os.path.exists(patch_src_path):
            raise IOError, 'CLANG_PATCHES is set, but directory ' + patch_src_path + ' does not exist, aborting.'
        print 'CLANG_PATCHES: Applying patches from ' + patch_src_path
        apply_patches(src_path, sorted(glob.glob(os.path.join(patch_src_path, '*'))))
    else
        print 'CLANG_PATCHES: Not set, skipping.'
    build_clang(toolchain, src_path, build_path, install_path, profile_data_path, generate_instrumented, bitness, environment, build_type='Release')
    package_clang(install_path, result_file_path)
    upload_clang(result_file_path, remote_path)
示例#4
0
def init_env(optionDict):
    # Define the base directory under which the rest of directories exist
    # Staging specific
    optionDict['REPO_STAGING_SERVER_TEST_REPO'] = optionDict[
        'STAGING_SRV_ONLINE_REPO_BASE_PATH'] + '/' + optionDict[
            'LICENSE'] + '/staging'
    optionDict['REPO_STAGING_SERVER_TEST_REPO_PENDING'] = optionDict[
        'STAGING_SRV_ONLINE_REPO_BASE_PATH'] + '/' + optionDict[
            'LICENSE'] + '/staging_pending'
    optionDict['REPO_STAGING_SERVER_HOME_TOOLS'] = optionDict[
        'REPO_STAGING_SERVER_HOME'] + '/qtsdk/packaging-tools'
    # Production specific directories are set directly from environment

    onlineRepositoryBaseName = os.environ.get('ONLINE_REPOSITORY_BASE_NAME')
    optionDict[
        'ONLINE_REPOSITORY_BASE_NAME'] = onlineRepositoryBaseName if onlineRepositoryBaseName else 'qtsdkrepository'

    print('Staging server base directory: {0}'.format(
        optionDict['REPO_STAGING_SERVER_TEST_REPO']))
    print('Staging server base directory pending: {0}'.format(
        optionDict['REPO_STAGING_SERVER_TEST_REPO_PENDING']))
    print('Staging server tools dir: {0}'.format(
        optionDict['REPO_STAGING_SERVER_HOME_TOOLS']))
    print('Production server base directory: {0}'.format(
        optionDict['PROD_SRV_REPO_BASE_PATH']))
    print('Production server base directory pending: {0}'.format(
        optionDict['PROD_SRV_REPO_PENDING_AREA_DIR']))
    print('Production server base directory dist update work: {0}'.format(
        optionDict['REPO_STAGING_SERVER_TEST_REPO_DIST_WORK']))
    print('Configurations file base dir: {0}'.format(
        optionDict['CONFIGURATIONS_FILE_BASE_DIR']))
    bldinstallercommon.init_common_module(SCRIPT_ROOT_DIR)
示例#5
0
def main():
    bldinstallercommon.init_common_module(SCRIPT_ROOT_DIR)
    options = parse_cmd_line()
    if options.build_icu:
        check_env()
        init_build_icu(options.icu_src, options.icu_version, True)
    else:
        print('You asked me to do nothing?')
示例#6
0
def main():
    bldinstallercommon.init_common_module(SCRIPT_ROOT_DIR)
    options = parse_cmd_line()
    if options.build_icu:
        check_env()
        init_build_icu(options.icu_src, options.icu_version, True)
    else:
        print('You asked me to do nothing?')
示例#7
0
def main():
    # Used Environment variables:
    #
    # PKG_NODE_ROOT
    # Absolute path of a working directory for this script.
    # It checks out LLVM and Clang in "$PKG_NODE_ROOT/llvm",
    # builds it in "$PKG_NODE_ROOT/build", and installs it to
    # "$PKG_NODE_ROOT/libclang"
    #
    # CLANG_BRANCH
    # "Branch" identifier for the resulting package name
    #
    # cfg
    # Configuration containing of platform and bitness information
    # like "linux-g++-Rhel7.2-x64", "mac-clang-10.11-x64",
    # "win-MinGW5.3.0-Windows10-x64", "win-MinGW5.3.0-Windows10-x86",
    # "win-msvc2015-Windows10-x64", "win-msvc2015-Windows10-x86"
    #
    # GENERATE_INSTRUMENTED_BINARIES
    # Set this to 1 if you want to build MinGW libraries with information
    # suitable for creating profile optimized builds
    #
    # PACKAGE_STORAGE_SERVER_USER
    # PACKAGE_STORAGE_SERVER
    # PACKAGE_STORAGE_SERVER_BASE_DIR
    # CLANG_UPLOAD_SERVER_PATH
    # Define a remote path where to upload the resulting package
    # "PACKAGE_STORAGE_SERVER_USER@PACKAGE_STORAGE_SERVER:PACKAGE_STORAGE_SERVER_BASE_DIR/CLANG_UPLOAD_SERVER_PATH"
    #
    # LLVM_REVISION
    # Git revision, branch or tag for LLVM/Clang check out

    bldinstallercommon.init_common_module(os.path.dirname(os.path.realpath(__file__)))
    base_path = os.path.join(os.environ['PKG_NODE_ROOT'])
    branch = os.environ['CLANG_BRANCH']
    src_path = os.path.join(base_path, 'llvm/llvm')
    build_path = os.path.join(base_path, 'build')
    install_path = os.path.join(base_path, 'libclang')
    bitness = 64 if '64' in os.environ['cfg'] else 32
    toolchain = os.environ['cfg'].split('-')[1].lower()
    environment = build_environment(toolchain, bitness)
    result_file_path = os.path.join(base_path, 'libclang-' + branch + '-' + os.environ['CLANG_PLATFORM'] + '.7z')
    remote_path = (get_pkg_value("PACKAGE_STORAGE_SERVER_USER") + '@' + get_pkg_value("PACKAGE_STORAGE_SERVER") + ':'
                   + os.environ['PACKAGE_STORAGE_SERVER_BASE_DIR'] + '/' + os.environ['CLANG_UPLOAD_SERVER_PATH'])

    get_clang(base_path, os.environ['LLVM_REVISION'])

    # TODO: put args in some struct to improve readability, add error checks
    build_clang(toolchain, src_path, build_path, install_path, bitness, environment, build_type='Release')

    check_clang(toolchain, build_path, environment)

    package_clang(install_path, result_file_path)
    upload_clang(result_file_path, remote_path)
示例#8
0
def main():
    # init
    bldinstallercommon.init_common_module(SCRIPT_ROOT_DIR)
    # init build, check that script is run in Windows
    init()
    # parse cmd line
    parse_cmd_line()
    # fetch src package
    fetch_src_package()
    # extract src package
    extract_src_package()
    # configure
    configure_qt()
    # add configure.exe to the zip
    archive_configure_exe()
示例#9
0
def main():
    # init
    bldinstallercommon.init_common_module(SCRIPT_ROOT_DIR)
    # init build, check that script is run in Windows
    init()
    # parse cmd line
    parse_cmd_line()
    # fetch src package
    fetch_src_package()
    # extract src package
    extract_src_package()
    # configure
    configure_qt()
    # add configure.exe to the zip
    archive_configure_exe()
示例#10
0
def main():
    bldinstallercommon.init_common_module(
        os.path.dirname(os.path.realpath(__file__)))
    base_path = os.path.join(os.environ['PKG_NODE_ROOT'], 'build')
    branch = os.environ['CLANG_BRANCH']
    src_path = os.path.join(base_path, 'llvm')
    clang_src_path = os.path.join(base_path, 'llvm', 'tools', 'clang')
    patch_src_path = os.path.join(base_path, 'tqtc-testconfig', 'projects',
                                  os.environ['PULSE_PROJECT'], 'stages',
                                  'patches')
    build_path = os.path.join(base_path, 'build')
    install_path = os.path.join(base_path, 'libclang')
    bitness = 64 if '64' in os.environ['cfg'] else 32
    toolchain = os.environ['cfg'].split('-')[1].lower()
    environment = build_environment(toolchain, bitness)
    profile_data_url = profile_data(toolchain)
    profile_data_path = os.path.join(build_path, 'profile_data')
    generate_instrumented = os.environ.get(
        'GENERATE_INSTRUMENTED_BINARIES') == '1'
    instrumented_tag = '-instrumented' if generate_instrumented else ''
    result_file_path = os.path.join(
        base_path, 'libclang-' + branch + '-' + os.environ['CLANG_PLATFORM'] +
        instrumented_tag + '.7z')
    remote_path = (os.environ['PACKAGE_STORAGE_SERVER_USER'] + '@' +
                   os.environ['PACKAGE_STORAGE_SERVER'] + ':' +
                   os.environ['PACKAGE_STORAGE_SERVER_BASE_DIR'] + '/' +
                   os.environ['CLANG_UPLOAD_SERVER_PATH'])

    get_clang(base_path, os.environ['LLVM_REVISION'],
              os.environ['CLANG_REVISION'])
    profile_data_path = get_profile_data(profile_data_path, profile_data_url,
                                         generate_instrumented)
    apply_patches(clang_src_path,
                  sorted(glob.glob(os.path.join(patch_src_path, '*'))))
    build_clang(toolchain,
                src_path,
                build_path,
                install_path,
                profile_data_path,
                generate_instrumented,
                bitness,
                environment,
                build_type='Release')
    package_clang(install_path, result_file_path)
    upload_clang(result_file_path, remote_path)
def init_env(optionDict):
    # Define the base directory under which the rest of directories exist
    # Staging specific
    optionDict['REPO_STAGING_SERVER_TEST_REPO']           = optionDict['STAGING_SRV_ONLINE_REPO_BASE_PATH'] + '/' + optionDict['LICENSE'] + '/staging'
    optionDict['REPO_STAGING_SERVER_TEST_REPO_PENDING']   = optionDict['STAGING_SRV_ONLINE_REPO_BASE_PATH'] + '/' + optionDict['LICENSE'] + '/staging_pending'
    optionDict['REPO_STAGING_SERVER_HOME_TOOLS']          = optionDict['REPO_STAGING_SERVER_HOME'] + '/qtsdk/packaging-tools'
    # Production specific directories are set directly from environment

    onlineRepositoryBaseName = os.environ.get('ONLINE_REPOSITORY_BASE_NAME')
    optionDict['ONLINE_REPOSITORY_BASE_NAME'] = onlineRepositoryBaseName if onlineRepositoryBaseName else 'qtsdkrepository'

    print('Staging server: {0}'.format(optionDict['PKG_STAGING_SERVER']))
    print('Staging server uname: {0}'.format(optionDict['PKG_STAGING_SERVER_UNAME']))
    print('Staging server base directory: {0}'.format(optionDict['REPO_STAGING_SERVER_TEST_REPO']))
    print('Staging server base directory pending: {0}'.format(optionDict['REPO_STAGING_SERVER_TEST_REPO_PENDING']))
    print('Staging server tools dir: {0}'.format(optionDict['REPO_STAGING_SERVER_HOME_TOOLS']))
    print('Production server: {0}'.format(optionDict['PROD_ADDR']))
    print('Production server uname: {0}'.format(optionDict['PROD_USER']))
    print('Production server base directory: {0}'.format(optionDict['PROD_SRV_REPO_BASE_PATH']))
    print('Production server base directory pending: {0}'.format(optionDict['PROD_SRV_REPO_PENDING_AREA_DIR']))
    print('Production server base directory dist update work: {0}'.format(optionDict['REPO_STAGING_SERVER_TEST_REPO_DIST_WORK']))
    print('Configurations file base dir: {0}'.format(optionDict['CONFIGURATIONS_FILE_BASE_DIR']))
    bldinstallercommon.init_common_module(SCRIPT_ROOT_DIR)
示例#12
0
def main():
    bldinstallercommon.init_common_module(os.path.dirname(os.path.realpath(__file__)))
    caller_arguments = parse_arguments()
    build_plugins(caller_arguments)
示例#13
0
    for item in split_components:
        if '*' in item:
            expanded_items = expand_wildcard(item, full_component_listing)
            return_list += expanded_items
        else:
            return_list.append(item)
    # return list should contain all single items and items with wild mark
    return return_list


###############################
# Main
###############################
if __name__ == "__main__":
    # init things
    bldinstallercommon.init_common_module(ROOT_DIR)
    PARSER = setup_argument_parser()
    # parse args
    CALLER_ARGUMENTS = PARSER.parse_args()
    # check if first time usage!
    # 1) target repository directory must be empty i.e. we initialize things for the first time
    # 2) copy the source repository as target repository 1:1 and nothing else
    if CALLER_ARGUMENTS.source_repo:
        source_repo = os.path.join(CALLER_ARGUMENTS.source_repo, 'online_repository')
        if not os.path.isdir(source_repo) or not os.path.isfile(os.path.join(source_repo, 'Updates.xml')):
            print('*** The given source directory does not seem to be proper repository? Abort!')
            print('Given source repository: {0}'.format(source_repo))
            raise RuntimeError()
        if os.path.isfile(os.path.join(CALLER_ARGUMENTS.target_repo, 'Updates.xml')):
            print('The given destination directory already contains a repository.')
            print('We just update the existing repository:')
示例#14
0
## packaging of this file.  Please review the following information to
## ensure the GNU General Public License version 3.0 requirements will be
## met: http://www.gnu.org/copyleft/gpl.html.
##
##
## $QT_END_LICENSE$
##
#############################################################################

from __future__ import print_function
import os
import shutil
import sys
import multiprocessing
import bldinstallercommon
bldinstallercommon.init_common_module(os.path.dirname(os.path.realpath(__file__)))

def handle_module_doc_build(optionDict):
    if not bldinstallercommon.is_linux_platform():
        raise RuntimeError('*** Only Linux platform supported currently to perform doc builds. Aborting')
    if not 'MODULE_NAME' in optionDict:
        print('*** MODULE_NAME environment variable not defined. Unable to generate doc for this package.')
        return
    if not 'MODULE_SRC_PACKAGE_URI' in optionDict:
        print('*** MODULE_SRC_PACKAGE_URI environment variable not defined. Unable to generate doc for this package.')
        return
    if not 'MODULE_DOC_BUILD_QT_PACKAGE_URI' in optionDict:
        print('*** MODULE_DOC_BUILD_QT_PACKAGE_URI environment variable not defined. Unable to generate doc for this package.')
        return
    module_src_package_uri = optionDict['MODULE_SRC_PACKAGE_URI']
    module_doc_build_qt_package_uri = optionDict['MODULE_DOC_BUILD_QT_PACKAGE_URI']
示例#15
0
                        required=False,
                        default=False)
    parser.add_argument('--incremental',
                        help="Build the ifw in incremental mode",
                        action='store_true',
                        required=False,
                        default=False)
    return parser


###############################
# Main
###############################
if __name__ == "__main__":
    # init things
    bldinstallercommon.init_common_module(ROOT_DIR)
    PARSER = setup_argument_parser()
    # parse args
    CARGS = PARSER.parse_args()
    qt_src = IfwOptions.default_qt_src_pkg if not CARGS.qt_archive_uri else CARGS.qt_archive_uri
    qt_configure_options = get_static_qt_configure_options(
        CARGS.openssl_dir
    ) if not CARGS.qt_configure_options else CARGS.qt_configure_options
    ifw_branch = IfwOptions.default_qt_installer_framework_branch_qt if not CARGS.ifw_branch else CARGS.ifw_branch

    qt_conf_args = CARGS.qt_configure_options
    ifw_qmake_args = CARGS.ifw_qmake_args
    if CARGS.debug:
        qt_conf_args = qt_conf_args.replace('-release', '-debug')
        ifw_qmake_args = ifw_qmake_args.replace('-config release',
                                                '-config debug')
示例#16
0
    if hasattr(caller_arguments, 'gitpath') and caller_arguments.gitpath:
        path_list.append(caller_arguments.gitpath)

    environment = {"PATH": os.pathsep.join(path_list)}
    if bldinstallercommon.is_linux_platform():
        environment["LD_LIBRARY_PATH"] = os.path.join(qt5_path, 'lib')
        environment["QMAKESPEC"] = "linux-g++"
    if bldinstallercommon.is_mac_platform():
        environment["DYLD_FRAMEWORK_PATH"] = os.path.join(qt5_path, 'lib')
    if not bldinstallercommon.is_win_platform():
        environment["MAKEFLAGS"] = "-j" + str(multiprocessing.cpu_count() + 1)
    return environment


if __name__ == "__main__":
    bldinstallercommon.init_common_module(os.path.dirname(os.path.realpath(__file__)))

    # install an argument parser
    parser = argparse.ArgumentParser(description="build Qt 5 based Qt Creator",
        formatter_class=argparse.RawTextHelpFormatter)
    add_common_commandline_arguments(parser)
    parser.add_argument('--qt5path', help="here it expects a compiled Qt5", required=True)
    if bldinstallercommon.is_mac_platform():
        parser.add_argument('--keychain_unlock_script', help="script for unlocking the keychain used for signing")
        parser.epilog += " --keychain_unlock_script $HOME/unlock-keychain.sh"
    if bldinstallercommon.is_win_platform():
        parser.add_argument('--python_path', help="path to python libraries for use by cdbextension")

    parser.epilog += " --qt5path qtcreator_qt5"
    callerArguments = parser.parse_args()
示例#17
0
                                       '.o', '.obj', '.moc', \
                                       '.qhp', \
                                       '.init-repository', '.gitignore']
IGNORE_PATCH_LIST                   = ['.png', '.jpg', '.gif', '.bmp', '.exe', '.dll', '.lib', '.qph']
INSTALL_PREFIX                      = ''
#Commandline options
OPTION_PARSER                       = 0
MAKE_INSTALL_CMD                    = ''
CONFIGURE_OPTIONS                   = '-confirm-license -debug-and-release -release -nomake tests -nomake examples -qt-zlib -qt-libjpeg -qt-libpng'
ANDROID_BUILD                       = False
QT_BUILD_OPTIONS                    = 0
DESKTOP_BUILD                       = True
QNX_BUILD                           = False

# init
bldinstallercommon.init_common_module(SCRIPT_ROOT_DIR)



###############################
# Class MultipleOption
###############################
class MultipleOption(Option):
    ACTIONS = Option.ACTIONS + ("extend",)
    STORE_ACTIONS = Option.STORE_ACTIONS + ("extend",)
    TYPED_ACTIONS = Option.TYPED_ACTIONS + ("extend",)
    ALWAYS_TYPED_ACTIONS = Option.ALWAYS_TYPED_ACTIONS + ("extend",)

    def take_action(self, action, dest, opt, value, values, parser):
        if action == "extend":
            values.ensure_value(dest, []).append(value)
示例#18
0
def main():
    bldinstallercommon.init_common_module(
        os.path.dirname(os.path.realpath(__file__)))
    caller_arguments = parse_arguments()
    build_plugins(caller_arguments)
示例#19
0
def main():
    # Used Environment variables:
    #
    # PKG_NODE_ROOT
    # Absolute path of a working directory for this script.
    # It checks out LLVM and Clang in "$PKG_NODE_ROOT/llvm",
    # builds it in "$PKG_NODE_ROOT/build", and installs it to
    # "$PKG_NODE_ROOT/libclang"
    #
    # CLANG_BRANCH
    # "Branch" identifier for the resulting package name
    #
    # cfg
    # Configuration containing of platform and bitness information
    # like "linux-g++-Rhel7.2-x64", "mac-clang-10.11-x64",
    # "win-MinGW5.3.0-Windows10-x64", "win-MinGW5.3.0-Windows10-x86",
    # "win-msvc2015-Windows10-x64", "win-msvc2015-Windows10-x86"
    #
    # GENERATE_INSTRUMENTED_BINARIES
    # Set this to 1 if you want to build MinGW libraries with information
    # suitable for creating profile optimized builds
    #
    # PACKAGE_STORAGE_SERVER_USER
    # PACKAGE_STORAGE_SERVER
    # PACKAGE_STORAGE_SERVER_BASE_DIR
    # CLANG_UPLOAD_SERVER_PATH
    # Define a remote path where to upload the resulting package
    # "PACKAGE_STORAGE_SERVER_USER@PACKAGE_STORAGE_SERVER:PACKAGE_STORAGE_SERVER_BASE_DIR/CLANG_UPLOAD_SERVER_PATH"
    #
    # LLVM_REVISION
    # Git revision, branch or tag for LLVM check out
    #
    # CLANG_REVISION
    # Git revision, branch or tag for Clang check out
    #
    # CLANG_TOOLS_EXTRA_REVISION
    # Git revision, branch or tag for clang-tools-extra check out
    #
    # CLAZY_REVISION
    # Git revision, branch or tag for Clazy check out
    #
    # CLANG_PATCHES
    # Absolute path (or relative to PKG_NODE_ROOT) where patches are that
    # should be applied to Clang. Files matching *.patch will be applied.

    bldinstallercommon.init_common_module(os.path.dirname(os.path.realpath(__file__)))
    base_path = os.path.join(os.environ['PKG_NODE_ROOT'])
    branch = os.environ['CLANG_BRANCH']
    clazy_revision = os.environ.get('CLAZY_REVISION')
    src_path = os.path.join(base_path, 'llvm')
    build_path = os.path.join(base_path, 'build')
    src_clazy_path = os.path.join(base_path, 'clazy')
    build_clazy_path = os.path.join(base_path, 'clazy_build')
    install_path = os.path.join(base_path, 'libclang')
    bitness = 64 if '64' in os.environ['cfg'] else 32
    toolchain = os.environ['cfg'].split('-')[1].lower()
    environment = build_environment(toolchain, bitness)
    clazy_tag = '-clazy' if clazy_revision else ''
    result_file_path = os.path.join(base_path, 'libclang-' + branch + '-' + os.environ['CLANG_PLATFORM'] + clazy_tag + '.7z')
    profile_data_path = os.path.join(build_path, 'profile_data')
    remote_path = (os.environ['PACKAGE_STORAGE_SERVER_USER'] + '@' + os.environ['PACKAGE_STORAGE_SERVER'] + ':'
                   + os.environ['PACKAGE_STORAGE_SERVER_BASE_DIR'] + '/' + os.environ['CLANG_UPLOAD_SERVER_PATH'])

    get_clang(base_path, os.environ['LLVM_REVISION'], os.environ['CLANG_REVISION'], os.environ['CLANG_TOOLS_EXTRA_REVISION'])
    if clazy_revision:
        get_clazy(base_path, clazy_revision)
    patch_src_path = os.environ.get('CLANG_PATCHES')
    if patch_src_path:
        if not os.path.isabs(patch_src_path):
            patch_src_path = os.path.join(base_path, patch_src_path)
        if not os.path.exists(patch_src_path):
            raise IOError, 'CLANG_PATCHES is set, but directory ' + patch_src_path + ' does not exist, aborting.'
        print 'CLANG_PATCHES: Applying patches from ' + patch_src_path
        apply_patches(src_path, sorted(glob.glob(os.path.join(patch_src_path, '*.patch'))))
    else:
        print 'CLANG_PATCHES: Not set, skipping.'

    qtcreator_path = os.path.abspath(os.path.join(patch_src_path, '..', '..', '..'))
    # TODO: put args in some struct to improve readability, add error checks
    build_clang(toolchain, src_path, build_path, install_path, profile_data_path, True, bitness, environment, build_type='Release')
    if is_mingw_toolchain(toolchain):
        shutil.rmtree(profile_data_path)
        os.makedirs(profile_data_path)
        mingw_training(base_path, qtcreator_path, bitness)
        build_clang(toolchain, src_path, build_path, install_path, profile_data_path, False, bitness, environment, build_type='Release')

    check_clang(toolchain, build_path, environment)

    package_clang(install_path, result_file_path)
    upload_clang(result_file_path, remote_path)
示例#20
0
文件: bld_module.py 项目: zrzhd/qtsdk
import multiprocessing
import os
import sys
import fnmatch
import shutil
import fileinput

# own imports
from threadedwork import Task, ThreadedWork
from bld_utils import runCommand, runBuildCommand, runInstallCommand, stripVars
import bldinstallercommon

SCRIPT_ROOT_DIR = os.path.dirname(os.path.realpath(__file__))
MODULE_SRC_DIR_NAME = 'module_src'
MODULE_SRC_DIR = os.path.join(SCRIPT_ROOT_DIR, MODULE_SRC_DIR_NAME)
bldinstallercommon.init_common_module(os.getcwd())


###############################
# function
###############################
def patch_archive(base_dir, search_strings, qt_install_prefix):
    erase_qmake_prl_build_dir(base_dir)
    patch_build_time_paths(base_dir, search_strings, qt_install_prefix)


###############################
# function
###############################
def get_qt_install_prefix(qt_path):
    cmd_args = [
示例#21
0
def main():
    # Used Environment variables:
    #
    # PKG_NODE_ROOT
    # Absolute path of a working directory for this script.
    # It checks out LLVM and Clang in "$PKG_NODE_ROOT/llvm",
    # builds it in "$PKG_NODE_ROOT/build", and installs it to
    # "$PKG_NODE_ROOT/libclang"
    #
    # CLANG_BRANCH
    # "Branch" identifier for the resulting package name
    #
    # cfg
    # Configuration containing of platform and bitness information
    # like "linux-g++-Rhel7.2-x64", "mac-clang-10.11-x64",
    # "win-MinGW5.3.0-Windows10-x64", "win-MinGW5.3.0-Windows10-x86",
    # "win-msvc2015-Windows10-x64", "win-msvc2015-Windows10-x86"
    #
    # PACKAGE_STORAGE_SERVER_USER
    # PACKAGE_STORAGE_SERVER
    # PACKAGE_STORAGE_SERVER_BASE_DIR
    # CLANG_UPLOAD_SERVER_PATH
    # Define a remote path where to upload the resulting package
    # "PACKAGE_STORAGE_SERVER_USER@PACKAGE_STORAGE_SERVER:PACKAGE_STORAGE_SERVER_BASE_DIR/CLANG_UPLOAD_SERVER_PATH"
    #
    # LLVM_REPOSITORY_URL
    # URL to the remote llvm-project repository.
    #
    # LLVM_REVISION
    # Git revision, branch or tag for LLVM/Clang check out
    #
    # CLAZY_REPOSITORY_URL
    # URL to the remote clazy repository
    #
    # CLAZY_REVISION
    # Git revision, branch or tag for clazy check out

    bldinstallercommon.init_common_module(
        os.path.dirname(os.path.realpath(__file__)))
    base_path = os.path.join(os.environ['PKG_NODE_ROOT'])
    branch = os.environ['CLANG_BRANCH']
    src_path = os.path.join(base_path, 'llvm/llvm')
    build_path = os.path.join(base_path, 'build')
    install_path = os.path.join(base_path, 'libclang')
    bitness = 64 if '64' in os.environ['cfg'] else 32
    toolchain = os.environ['cfg'].split('-')[1].lower()
    environment = build_environment(toolchain, bitness)
    profile_data_path = os.path.join(base_path, 'profile_data')
    remote_path = (os.environ['PACKAGE_STORAGE_SERVER_USER'] + '@' +
                   os.environ['PACKAGE_STORAGE_SERVER'] + ':' +
                   os.environ['PACKAGE_STORAGE_SERVER_BASE_DIR'] + '/' +
                   os.environ['CLANG_UPLOAD_SERVER_PATH'])

    ### Get, build and install LLVM/Clang
    get_clang(base_path, os.environ['LLVM_REPOSITORY_URL'],
              os.environ['LLVM_REVISION'])

    # TODO: put args in some struct to improve readability, add error checks
    build_clang(toolchain,
                src_path,
                build_path,
                install_path,
                profile_data_path,
                False,
                bitness,
                environment,
                build_type='Release')
    check_clang(toolchain, build_path, environment)

    if is_mingw_toolchain(toolchain):
        # We need to build libclang three times.
        # First time as a regular build, which would be used by a Qt Creator build to link to libclang/llvm.
        # Second time a PGO build, which would be trained with Qt Creator itself
        # Third time will use the training data collected and produce the optimized output

        if os.path.exists(profile_data_path):
            shutil.rmtree(profile_data_path)
        os.makedirs(profile_data_path)

        # Update the regular build, so that we can see the differences
        result_file_path = os.path.join(
            base_path, 'libclang-' + branch + '-' +
            os.environ['CLANG_PLATFORM'] + '-regular.7z')
        package_clang(install_path, result_file_path)
        upload_clang(result_file_path, remote_path)

        build_path_training = os.path.join(base_path, 'build-training')
        install_path_training = os.path.join(base_path, 'libclang-training')
        build_clang(toolchain,
                    src_path,
                    build_path_training,
                    install_path_training,
                    profile_data_path,
                    True,
                    bitness,
                    environment,
                    build_type='Release')
        mingw_training(base_path, os.path.join(base_path, 'qt-creator'),
                       environment, bitness)
        build_clang(toolchain,
                    src_path,
                    build_path_training,
                    install_path,
                    profile_data_path,
                    False,
                    bitness,
                    environment,
                    build_type='Release')

    ### Get, build and install clazy
    git_clone_and_checkout(base_path, os.environ['CLAZY_REPOSITORY_URL'],
                           'clazy', os.environ['CLAZY_REVISION'])
    build_clazy(toolchain, os.path.join(base_path, 'clazy'),
                os.path.join(base_path, 'clazy-build'), install_path, bitness,
                environment)

    ### Package and upload
    result_file_path = os.path.join(
        base_path,
        'libclang-' + branch + '-' + os.environ['CLANG_PLATFORM'] + '.7z')
    package_clang(install_path, result_file_path)
    upload_clang(result_file_path, remote_path)
示例#22
0
def main():
    # Used Environment variables:
    #
    # PKG_NODE_ROOT
    # Absolute path of a working directory for this script.
    # It checks out LLVM and Clang in "$PKG_NODE_ROOT/llvm",
    # builds it in "$PKG_NODE_ROOT/build", and installs it to
    # "$PKG_NODE_ROOT/libclang"
    #
    # CLANG_BRANCH
    # "Branch" identifier for the resulting package name
    #
    # cfg
    # Configuration containing of platform and bitness information
    # like "linux-g++-Rhel7.2-x64", "mac-clang-10.11-x64",
    # "win-MinGW5.3.0-Windows10-x64", "win-MinGW5.3.0-Windows10-x86",
    # "win-msvc2015-Windows10-x64", "win-msvc2015-Windows10-x86"
    #
    # GENERATE_INSTRUMENTED_BINARIES
    # Set this to 1 if you want to build MinGW libraries with information
    # suitable for creating profile optimized builds
    #
    # PACKAGE_STORAGE_SERVER_USER
    # PACKAGE_STORAGE_SERVER
    # PACKAGE_STORAGE_SERVER_BASE_DIR
    # CLANG_UPLOAD_SERVER_PATH
    # Define a remote path where to upload the resulting package
    # "PACKAGE_STORAGE_SERVER_USER@PACKAGE_STORAGE_SERVER:PACKAGE_STORAGE_SERVER_BASE_DIR/CLANG_UPLOAD_SERVER_PATH"
    #
    # LLVM_REVISION
    # Git revision, branch or tag for LLVM check out
    #
    # CLANG_REVISION
    # Git revision, branch or tag for Clang check out
    #
    # CLANG_TOOLS_EXTRA_REVISION
    # Git revision, branch or tag for clang-tools-extra check out
    #
    # CLAZY_REVISION
    # Git revision, branch or tag for Clazy check out
    #
    # CLANG_PATCHES
    # Absolute path (or relative to PKG_NODE_ROOT) where patches are that
    # should be applied to Clang. Files matching *.patch will be applied.

    bldinstallercommon.init_common_module(os.path.dirname(os.path.realpath(__file__)))
    base_path = os.path.join(os.environ['PKG_NODE_ROOT'])
    branch = os.environ['CLANG_BRANCH']
    clazy_revision = os.environ.get('CLAZY_REVISION')
    src_path = os.path.join(base_path, 'llvm')
    build_path = os.path.join(base_path, 'build')
    src_clazy_path = os.path.join(base_path, 'clazy')
    build_clazy_path = os.path.join(base_path, 'clazy_build')
    install_path = os.path.join(base_path, 'libclang')
    bitness = 64 if '64' in os.environ['cfg'] else 32
    toolchain = os.environ['cfg'].split('-')[1].lower()
    environment = build_environment(toolchain, bitness)
    clazy_tag = '-clazy' if clazy_revision else ''
    result_file_path = os.path.join(base_path, 'libclang-' + branch + '-' + os.environ['CLANG_PLATFORM'] + clazy_tag + '.7z')
    profile_data_path = os.path.join(build_path, 'profile_data')
    remote_path = (os.environ['PACKAGE_STORAGE_SERVER_USER'] + '@' + os.environ['PACKAGE_STORAGE_SERVER'] + ':'
                   + os.environ['PACKAGE_STORAGE_SERVER_BASE_DIR'] + '/' + os.environ['CLANG_UPLOAD_SERVER_PATH'])

    get_clang(base_path, os.environ['LLVM_REVISION'], os.environ['CLANG_REVISION'], os.environ['CLANG_TOOLS_EXTRA_REVISION'])
    if clazy_revision:
        get_clazy(base_path, clazy_revision)
    patch_src_path = os.environ.get('CLANG_PATCHES')
    if patch_src_path:
        if not os.path.isabs(patch_src_path):
            patch_src_path = os.path.join(base_path, patch_src_path)
        if not os.path.exists(patch_src_path):
            raise IOError, 'CLANG_PATCHES is set, but directory ' + patch_src_path + ' does not exist, aborting.'
        print 'CLANG_PATCHES: Applying patches from ' + patch_src_path
        apply_patches(src_path, sorted(glob.glob(os.path.join(patch_src_path, '*.patch'))))
    else:
        print 'CLANG_PATCHES: Not set, skipping.'

    # TODO: put args in some struct to improve readability, add error checks
    build_clang(toolchain, src_path, build_path, install_path, profile_data_path, True, bitness, environment, build_type='Release')
    if is_mingw_toolchain(toolchain):
        shutil.rmtree(profile_data_path)
        os.makedirs(profile_data_path)
        build_clang(toolchain, src_path, build_path, install_path, profile_data_path, False, bitness, environment, build_type='Release')

    check_clang(toolchain, build_path, environment)

    if is_msvc_toolchain(toolchain):
        build_static_libclang_msvc(toolchain, src_path, build_path, install_path, profile_data_path, bitness, environment, build_type='Release')
    else:
        build_static_libclang(toolchain, src_path, build_path, install_path, profile_data_path, bitness, environment, build_type='Release')

    package_clang(install_path, result_file_path)
    upload_clang(result_file_path, remote_path)
示例#23
0
def main():
    # Used Environment variables:
    #
    # PKG_NODE_ROOT
    # Absolute path of a working directory for this script.
    # It checks out LLVM and Clang in "$PKG_NODE_ROOT/llvm",
    # builds it in "$PKG_NODE_ROOT/build", and installs it to
    # "$PKG_NODE_ROOT/libclang"
    #
    # CLANG_BRANCH
    # "Branch" identifier for the resulting package name
    #
    # cfg
    # Configuration containing of platform and bitness information
    # like "linux-g++-Rhel7.2-x64", "mac-clang-10.11-x64",
    # "win-MinGW5.3.0-Windows10-x64", "win-MinGW5.3.0-Windows10-x86",
    # "win-msvc2015-Windows10-x64", "win-msvc2015-Windows10-x86"
    #
    # GENERATE_INSTRUMENTED_BINARIES
    # Set this to 1 if you want to build MinGW libraries with information
    # suitable for creating profile optimized builds
    #
    # PACKAGE_STORAGE_SERVER_USER
    # PACKAGE_STORAGE_SERVER
    # PACKAGE_STORAGE_SERVER_BASE_DIR
    # CLANG_UPLOAD_SERVER_PATH
    # Define a remote path where to upload the resulting package
    # "PACKAGE_STORAGE_SERVER_USER@PACKAGE_STORAGE_SERVER:PACKAGE_STORAGE_SERVER_BASE_DIR/CLANG_UPLOAD_SERVER_PATH"
    #
    # LLVM_REVISION
    # Git revision, branch or tag for LLVM check out
    #
    # CLANG_REVISION
    # Git revision, branch or tag for Clang check out
    #
    # CLANG_TOOLS_EXTRA_REVISION
    # Git revision, branch or tag for clang-tools-extra check out
    #
    # CLAZY_REVISION
    # Git revision, branch or tag for Clazy check out

    bldinstallercommon.init_common_module(os.path.dirname(os.path.realpath(__file__)))
    base_path = os.path.join(os.environ['PKG_NODE_ROOT'])
    branch = os.environ['CLANG_BRANCH']
    clazy_revision = os.environ.get('CLAZY_REVISION')
    src_path = os.path.join(base_path, 'llvm')
    build_path = os.path.join(base_path, 'build')
    src_clazy_path = os.path.join(base_path, 'clazy')
    build_clazy_path = os.path.join(base_path, 'clazy_build')
    install_path = os.path.join(base_path, 'libclang')
    bitness = 64 if '64' in os.environ['cfg'] else 32
    toolchain = os.environ['cfg'].split('-')[1].lower()
    environment = build_environment(toolchain, bitness)
    result_file_path = os.path.join(base_path, 'libclang-' + branch + '-' + os.environ['CLANG_PLATFORM'] + '.7z')
    profile_data_path = os.path.join(build_path, 'profile_data')
    remote_path = (os.environ['PACKAGE_STORAGE_SERVER_USER'] + '@' + os.environ['PACKAGE_STORAGE_SERVER'] + ':'
                   + os.environ['PACKAGE_STORAGE_SERVER_BASE_DIR'] + '/' + os.environ['CLANG_UPLOAD_SERVER_PATH'])

    get_clang(base_path, os.environ['LLVM_REVISION'], os.environ['CLANG_REVISION'], os.environ['CLANG_TOOLS_EXTRA_REVISION'])
    if clazy_revision:
        get_clazy(base_path, clazy_revision)

    # TODO: put args in some struct to improve readability, add error checks
    build_clang(toolchain, src_path, build_path, install_path, profile_data_path, True, bitness, environment, build_type='Release')
    if is_mingw_toolchain(toolchain):
        shutil.rmtree(profile_data_path)
        os.makedirs(profile_data_path)
        mingw_training(base_path, os.path.abspath('qt-creator'), bitness)
        build_clang(toolchain, src_path, build_path, install_path, profile_data_path, False, bitness, environment, build_type='Release')

    check_clang(toolchain, build_path, environment)

    package_clang(install_path, result_file_path)
    upload_clang(result_file_path, remote_path)
示例#24
0
import multiprocessing
import os
import sys
import fnmatch
import shutil
import fileinput

# own imports
from threadedwork import Task, ThreadedWork
from bld_utils import runCommand, runBuildCommand, runInstallCommand, stripVars
import bldinstallercommon

SCRIPT_ROOT_DIR             = os.path.dirname(os.path.realpath(__file__))
MODULE_SRC_DIR_NAME         = 'module_src'
MODULE_SRC_DIR              = os.path.join(SCRIPT_ROOT_DIR, MODULE_SRC_DIR_NAME)
bldinstallercommon.init_common_module(os.getcwd())

###############################
# function
###############################
def patch_archive(base_dir, search_strings, qt_install_prefix):
    erase_qmake_prl_build_dir(base_dir)
    patch_build_time_paths(base_dir, search_strings, qt_install_prefix)

###############################
# function
###############################
def get_qt_install_prefix(qt_path):
    cmd_args = [os.path.join(qt_path, 'bin', 'qmake'), '-query', 'QT_INSTALL_PREFIX']
    ret, qt_install_prefix = bldinstallercommon.do_execute_sub_process(cmd_args, qt_path, get_output=True)
    return qt_install_prefix.strip()