Пример #1
0
def build(module_params):
    check_dependencies(False, ['version'], module_params)
    version = module_params['version']
    # fs.remove(origin_dir)
    # net.download_file(boost_url.format(version, str(version).replace('.', '_')), boost_archive)
    # archives.extract_7_zip(boost_archive, os.getcwd())
    # fs.rename(os.path.join('boost_*'), origin_dir, True)
    set_system_variable('BOOST_ROOT', origin_dir)
    set_system_variable('BOOST_HOME', origin_dir)

    bootstrap_exec = 'bootstrap'
    b2_exec = 'b2'
    logs_dir = os.path.join(os.getcwd(), s_config.log_folder)
    require_full_path(logs_dir)
    with open(os.path.join(logs_dir, 'build_boost.log'), 'a+') as log_file:
        TemporaryDir.enter(origin_dir)
        subprocess.call([bootstrap_exec], stdout=log_file, stderr=log_file, shell=True)
        # x86
        subprocess.call([b2_exec, '--libdir={}'.format(lib_directory), '--includedir={}'.format(headers_dir),
                         '--address-model=32', '--stagedir={}'.format(lib_directory_x86), '--build-type=complete',
                         '--link=static'], stdout=log_file, stderr=log_file, shell=True)

        subprocess.call([b2_exec, '--libdir={}'.format(lib_directory), '--includedir={}'.format(headers_dir),
                         '--address-model=64', '--stagedir={}'.format(lib_directory_x64), '--build-type=complete',
                         '--link=static'], stdout=log_file, stderr=log_file, shell=True)

        TemporaryDir.leave()
Пример #2
0
def make(directory, params=False, dependencies=False):
    print("Building project in " + directory)
    if not bool(params):
        params = {}
    if not bool(dependencies):
        dependencies = {}
    if bool(dependencies):
        install_distro_dependencies(dependencies)
    params_str = " ".join(["{0}={1}".format(key, val) for key, val in params.items()])

    make_loc = which('make')
    if make_loc is None:
        raise Exception("'MAKE' IS NOT INSTALLED ON SYSTEM")
        sys.exit(1)

    login_file_name = os.path.join(sys_config.log_folder, 'make.txt')
    fs.require_full_path(login_file_name)
    with open(login_file_name, 'a+') as log_file:
        TemporaryDir.enter(os.path.abspath(directory))
        process = subprocess.Popen(['make ', params_str], stderr=log_file, stdout=log_file, shell=True)
        process.communicate()
        if process.returncode != 0:
            raise Exception("'MAKE' finished with status-code " + str(process.returncode))
            sys.exit(1)
    TemporaryDir.leave()
Пример #3
0
def build(module_params):
    check_dependencies(False, ['version'], module_params)
    version = module_params['version']
    fs.remove(build_directory)
    net.download_file(
        boost_url.format(version,
                         str(version).replace('.', '_')), boost_archive)
    archives.extract_7_zip(boost_archive, origin_dir)
    fs.rename(os.path.join(origin_dir, 'boost_*'), build_directory, False)
    set_system_variable('BOOST_ROOT', build_directory)
    set_system_variable('BOOST_HOME', build_directory)

    TemporaryDir.enter(build_directory)
    bootstrap_exec = 'bootstrap'
    b2_exec = 'b2'
    logs_dir = os.path.join(os.getcwd(), s_config.log_folder)
    require_full_path(logs_dir)
    with open(os.path.join(logs_dir, 'build_boost.log'), 'a+') as log_file:
        subprocess.call([bootstrap_exec],
                        stdout=log_file,
                        stderr=log_file,
                        shell=True)
        subprocess.call([b2_exec],
                        stdout=log_file,
                        stderr=log_file,
                        shell=True)

    TemporaryDir.leave()

    fs.remove(boost_archive)
    fs.clear(
        build_directory,
        cleanup_extensions['obj_files'],
    )
Пример #4
0
def make_v8(architecture, logs_dir):
    with open(os.path.join(logs_dir, 'gen_solution.log'), 'a+') as log_file:
        if is_windows():
            v8_python_path = os.path.abspath(os.path.join(origin_dir, 'python276_bin{}python.exe'.format(os.path.sep)))
            print(v8_python_path)
            TemporaryDir.enter(v8_dir)
            subprocess.call([v8_python_path, 'build{}gyp_v8'.format(os.path.sep), '-Dtarget_arch=' + architecture,
                             '-Dcomponent=static_library'], stderr=log_file, stdout=log_file, shell=True)

            # TODO: modify MT MTd flags if necessary
            vcxproj_to_change = ('third_party/icu/icui18n.vcxproj',
                                 'third_party/icu/icuuc.vcxproj',
                                 'tools/gyp/mksnapshot.vcxproj',
                                 'tools/gyp/v8_base_0.vcxproj',
                                 'tools/gyp/v8_base_1.vcxproj',
                                 'tools/gyp/v8_base_2.vcxproj',
                                 'tools/gyp/v8_base_0.vcxproj',
                                 'tools/gyp/v8_libbase.vcxproj',
                                 'tools/gyp/v8_libplatform.vcxproj',
                                 'tools/gyp/v8_nosnapshot.vcxproj',
                                 'tools/gyp/v8_snapshot.vcxproj'
                                 )
            # for vcxproj_file in vcxproj_to_change:
            #     vcxproj_file = os.path.join(v8_dir, vcxproj_file)
            #     assembly.set_vcxproj_platform_toolset(vcxproj_file, config.visual_studio_toolset)
            #     assembly.set_vcxproj_runtime_library(vcxproj_file, config.visual_studio_runtime_library)

            # assembly.build_vcxproj(os.path.join(v8_dir, 'tools', 'gyp', 'v8.vcxproj'))
            TemporaryDir.leave()
            assembly.build_vcxproj(os.path.join(v8_dir, 'tools', 'gyp', 'v8.vcxproj'), lib_directory)
Пример #5
0
def make(directory, params=False, dependencies=False):
    print("Building project in " + directory)
    if not bool(params):
        params = {}
    if not bool(dependencies):
        dependencies = {}
    if bool(dependencies):
        install_distro_dependencies(dependencies)
    params_str = " ".join(
        ["{0}={1}".format(key, val) for key, val in params.items()])

    make_loc = which('make')
    if make_loc is None:
        raise Exception("'MAKE' IS NOT INSTALLED ON SYSTEM")
        sys.exit(1)

    login_file_name = os.path.join(sys_config.log_folder, 'make.txt')
    fs.require_full_path(login_file_name)
    with open(login_file_name, 'a+') as log_file:
        TemporaryDir.enter(os.path.abspath(directory))
        process = subprocess.Popen(['make ', params_str],
                                   stderr=log_file,
                                   stdout=log_file,
                                   shell=True)
        process.communicate()
        if process.returncode != 0:
            raise Exception("'MAKE' finished with status-code " +
                            str(process.returncode))
            sys.exit(1)
    TemporaryDir.leave()
Пример #6
0
    def write_results(self):
        TemporaryDir.enter(self.full_module_location)
        fnc = self.function_in_tasks_exist(
            s_config.module_integration_function)
        if bool(fnc):
            fnc(self.module_configs)

        TemporaryDir.leave()
Пример #7
0
    def write_results(self):
        LibraryModule.results = structs.default_dependency_struct.copy()
        TemporaryDir.enter(self.full_module_location)
        fnc = self.function_in_tasks_exist(s_config.module_integration_function)
        if bool(fnc):
            fnc(self.module_configs)

        TemporaryDir.leave()
        return LibraryModule.results
Пример #8
0
def make_install(directory):
    TemporaryDir.enter(directory)

    process = subprocess.Popen(['gksudo make install'], shell=True)
    process.communicate()
    if process.returncode != 0:
        raise Exception("'MAKE INSTALL' finished with status-code " + process.returncode)
        sys.exit(1)
    TemporaryDir.leave()
Пример #9
0
def fetch_v8(version, logs_dir):
    vcs.git_clone('https://chromium.googlesource.com/chromium/tools/depot_tools.git', origin_dir, True)
    TemporaryDir.enter(origin_dir)
    with open(os.path.join(logs_dir, 'fetch_v8.log'), 'a+') as log_file:
        print('Fetching v8')
        subprocess.call(['fetch', 'v8'], stderr=log_file, stdout=log_file, shell=True)
        print('Synchronizing')
        subprocess.call(['gclient', 'sync'], stderr=log_file, stdout=log_file, shell=True)
    TemporaryDir.leave()
    vcs.git_checkout(v8_dir, version)
Пример #10
0
def configure(directory, params):
    params_str = " ".join(["{0}={1}".format(key, val) for key, val in params.items()])
    TemporaryDir.enter(directory)
    if os.path.isfile('configure'):
        process = subprocess.Popen(['./configure ' + params_str], shell=True)
        process.communicate()
        if process.returncode != 0:
            raise Exception("'Configure' finished with status-code " + process.returncode)
            sys.exit(1)
    TemporaryDir.leave()
Пример #11
0
def make_install(directory):
    print("Installing project in " + directory)
    log_file = os.path.join(sys_config.log_folder, 'make_install.log')
    with open(log_file, 'a+') as log_file:
        TemporaryDir.enter(directory)
        process = sudo(['make', 'install'], stdout=log_file, stderr=log_file)
        if process.returncode != 0:
            raise Exception("'MAKE INSTALL' finished with status-code " + str(process.returncode))
            sys.exit(1)
        TemporaryDir.leave()
Пример #12
0
def make_install(directory):
    print("Installing project in " + directory)
    log_file = os.path.join(sys_config.log_folder, 'make_install.log')
    with open(log_file, 'a+') as log_file:
        TemporaryDir.enter(directory)
        process = sudo(['make', 'install'], stdout=log_file, stderr=log_file)
        if process.returncode != 0:
            raise Exception("'MAKE INSTALL' finished with status-code " +
                            str(process.returncode))
            sys.exit(1)
        TemporaryDir.leave()
Пример #13
0
 def prepare(self):
     TemporaryDir.enter(self.full_module_location)
     print("###### Processing module '{0}' ####".format(self.module_name))
     LibraryModule.current_working_module = self.module_name
     if self.module_need_rebuild():
         fnc = self.function_in_tasks_exist(s_config.module_prepare_function)
         if bool(fnc):
             fnc(self.module_configs)
             print("###### Library successfully processed #### ")
             LibraryModule.__set_cache('built', True)
     else:
         print("###### Library has been processed... Skipping #### ")
     TemporaryDir.leave()
Пример #14
0
 def prepare(self):
     TemporaryDir.enter(self.full_module_location)
     print("###### Processing module '{0}' ####".format(self.module_name))
     LibraryModule.current_working_module = self.module_name
     if self.module_need_rebuild():
         fnc = self.function_in_tasks_exist(
             s_config.module_prepare_function)
         if bool(fnc):
             fnc(self.module_configs)
             print("###### Library successfully processed #### ")
             LibraryModule.__set_cache('built', True)
     else:
         print("###### Library has been processed... Skipping #### ")
     TemporaryDir.leave()
Пример #15
0
def configure(directory, params={}, inline_params=[], log_file=False):
    print("Run configure script in " + directory)
    params_str = " ".join(["{0}={1}".format(key, val) for key, val in params.items()])
    params_str += " " + " ".join(inline_params)
    if type(log_file) is not str:
        log_file = "configure.log"
    log_file_name = os.path.join(sys_config.log_folder, log_file)
    with open(log_file_name, 'a+') as log_file:
        TemporaryDir.enter(directory)
        process = subprocess.Popen(['./configure ' + params_str], shell=True, stderr=log_file, stdout=log_file)
        process.communicate()
        TemporaryDir.leave()
        if process.returncode != 0:
            raise Exception("'Configure' finished with status-code " + process.returncode)
            sys.exit(1)
Пример #16
0
def fetch_v8(version, logs_dir):
    vcs.git_clone(
        'https://chromium.googlesource.com/chromium/tools/depot_tools.git',
        origin_dir, True)
    TemporaryDir.enter(origin_dir)
    with open(os.path.join(logs_dir, 'fetch_v8.log'), 'a+') as log_file:
        print('Fetching v8')
        subprocess.call(['fetch', 'v8'],
                        stderr=log_file,
                        stdout=log_file,
                        shell=True)
        print('Synchronizing')
        subprocess.call(['gclient', 'sync'],
                        stderr=log_file,
                        stdout=log_file,
                        shell=True)
    TemporaryDir.leave()
    vcs.git_checkout(v8_dir, version)
Пример #17
0
def configure(directory, params={}, inline_params=[], log_file=False):
    print("Run configure script in " + directory)
    params_str = " ".join(
        ["{0}={1}".format(key, val) for key, val in params.items()])
    params_str += " " + " ".join(inline_params)
    if type(log_file) is not str:
        log_file = "configure.log"
    log_file_name = os.path.join(sys_config.log_folder, log_file)
    with open(log_file_name, 'a+') as log_file:
        TemporaryDir.enter(directory)
        process = subprocess.Popen(['./configure ' + params_str],
                                   shell=True,
                                   stderr=log_file,
                                   stdout=log_file)
        process.communicate()
        TemporaryDir.leave()
        if process.returncode != 0:
            raise Exception("'Configure' finished with status-code " +
                            process.returncode)
            sys.exit(1)
Пример #18
0
    def find_files_by_masks(self, masks, abs_paths=False):
        result = []
        TemporaryDir.enter(self.project_dir)

        def make_abs_paths(paths):
            return [os.path.abspath(path) for path in paths]

        def find_files_by_mask(search_mask):
            files = glob.glob(search_mask)
            if abs_paths:
                files = make_abs_paths(files)
            return files

        if isinstance(masks, list):
            for mask in masks:
                result.extend(find_files_by_mask(mask))

        elif isinstance(masks, str):
            result.extend(find_files_by_mask(masks))

        TemporaryDir.leave()
        return result
Пример #19
0
    def find_files_by_masks(self, masks, abs_paths=False):
        result = []
        TemporaryDir.enter(self.project_dir)

        def make_abs_paths(paths):
            return [os.path.abspath(path) for path in paths]

        def find_files_by_mask(search_mask):
            files = glob.glob(search_mask)
            if abs_paths:
                files = make_abs_paths(files)
            return files

        if isinstance(masks, list):
            for mask in masks:
                result.extend(find_files_by_mask(mask))

        elif isinstance(masks, str):
            result.extend(find_files_by_mask(masks))

        TemporaryDir.leave()
        return result
Пример #20
0
def make_v8(architecture, logs_dir):
    with open(os.path.join(logs_dir, 'gen_solution.log'), 'a+') as log_file:
        if is_windows():
            v8_python_path = os.path.abspath(
                os.path.join(origin_dir,
                             'python276_bin{}python.exe'.format(os.path.sep)))
            print(v8_python_path)
            TemporaryDir.enter(v8_dir)
            subprocess.call([
                v8_python_path, 'build{}gyp_v8'.format(os.path.sep),
                '-Dtarget_arch=' + architecture, '-Dcomponent=static_library'
            ],
                            stderr=log_file,
                            stdout=log_file,
                            shell=True)

            # TODO: modify MT MTd flags if necessary
            vcxproj_to_change = ('third_party/icu/icui18n.vcxproj',
                                 'third_party/icu/icuuc.vcxproj',
                                 'tools/gyp/mksnapshot.vcxproj',
                                 'tools/gyp/v8_base_0.vcxproj',
                                 'tools/gyp/v8_base_1.vcxproj',
                                 'tools/gyp/v8_base_2.vcxproj',
                                 'tools/gyp/v8_base_0.vcxproj',
                                 'tools/gyp/v8_libbase.vcxproj',
                                 'tools/gyp/v8_libplatform.vcxproj',
                                 'tools/gyp/v8_nosnapshot.vcxproj',
                                 'tools/gyp/v8_snapshot.vcxproj')
            # for vcxproj_file in vcxproj_to_change:
            #     vcxproj_file = os.path.join(v8_dir, vcxproj_file)
            #     assembly.set_vcxproj_platform_toolset(vcxproj_file, config.visual_studio_toolset)
            #     assembly.set_vcxproj_runtime_library(vcxproj_file, config.visual_studio_runtime_library)

            # assembly.build_vcxproj(os.path.join(v8_dir, 'tools', 'gyp', 'v8.vcxproj'))
            TemporaryDir.leave()
            assembly.build_vcxproj(
                os.path.join(v8_dir, 'tools', 'gyp', 'v8.vcxproj'),
                lib_directory)
Пример #21
0
def build(module_params):
    check_dependencies(False, ['version'], module_params)
    version = module_params['version']
    fs.remove(build_directory)
    net.download_file(boost_url.format(version, str(version).replace('.', '_')), boost_archive)
    archives.extract_7_zip(boost_archive, origin_dir)
    fs.rename(os.path.join(origin_dir, 'boost_*'), build_directory, False)
    set_system_variable('BOOST_ROOT', build_directory)
    set_system_variable('BOOST_HOME', build_directory)

    TemporaryDir.enter(build_directory)
    bootstrap_exec = 'bootstrap'
    b2_exec = 'b2'
    logs_dir = os.path.join(os.getcwd(), s_config.log_folder)
    require_full_path(logs_dir)
    with open(os.path.join(logs_dir, 'build_boost.log'), 'a+') as log_file:
        subprocess.call([bootstrap_exec], stdout=log_file, stderr=log_file, shell=True)
        subprocess.call([b2_exec], stdout=log_file, stderr=log_file, shell=True)

    TemporaryDir.leave()

    fs.remove(boost_archive)
    fs.clear(build_directory, cleanup_extensions['obj_files'],)
Пример #22
0
 def remove_cache(self):
     TemporaryDir.enter(self._sourcesDir)
     if os.path.isfile('CMakeCache.txt'):
         os.remove('CMakeCache.txt')
     TemporaryDir.leave()
Пример #23
0
 def remove_cache(self):
     TemporaryDir.enter(self._sourcesDir)
     if os.path.isfile('CMakeCache.txt'):
         os.remove('CMakeCache.txt')
     TemporaryDir.leave()