def patch(conf): patches_path = util.getpath(config.DIR_PATCH) if conf['platform'] in config.patches.keys(): for patch in config.patches[conf['platform']]: util.cd(patch[0]) util.exec('git', 'apply', os.path.join(patches_path, patch[1]))
def pull(conf): webrtc_path = util.getpath(config.PATH_WEBRTC) util.cd(webrtc_path) if not util.exists(webrtc_path, '.gclient'): util.exec('fetch', '--nohooks', 'webrtc') util.cd(webrtc_path, 'src') util.exec('git', 'reset', '--hard') util.exec('git', 'fetch', 'origin') util.exec('git', 'checkout', "{}{}".format(config.WEBRTC_BRANCH_PREFIX, conf["branch"])) util.exec('gclient', 'sync', '-D')
def build(conf, mode): webrtc_src_path = util.getpath(config.PATH_WEBRTC, 'src') util.cd(webrtc_src_path) if sys.platform == 'linux': util.exec('bash', 'build/install-build-deps.sh', '--no-prompt') if conf['os'] == 'linux': util.exec('python', 'build/linux/sysroot_scripts/install-sysroot.py', '--arch={}'.format(conf['cpu'])) args = _generate_args(conf, mode) out_path = _generate_out(conf, mode) args_file = os.path.join(webrtc_src_path, out_path, 'args.gn') os.makedirs(util.getpath(webrtc_src_path, out_path), exist_ok=True) with open(args_file, 'w') as file: file.write('\n'.join(args)) util.exec('gn', 'gen', out_path) util.exec('ninja', '-C', out_path)
def test_exec(): out, err = util.exec('ls') assert len(out) > 0 assert err == ''
def setup(conf): util.cd(config.DIR_BUILD) if os.path.exists(util.getpath(config.PATH_DEPOT_TOOLS)): util.cd(config.PATH_DEPOT_TOOLS) util.exec('git', 'checkout', '-f', 'master') util.exec('git', 'pull') else: util.exec( 'git', 'clone', 'https://chromium.googlesource.com/chromium/tools/depot_tools.git', util.getpath(config.PATH_DEPOT_TOOLS)) os.environ['PATH'] = util.getpath( config.PATH_DEPOT_TOOLS) + os.path.pathsep + os.environ['PATH'] if sys.platform == 'win32': os.environ['DEPOT_TOOLS_WIN_TOOLCHAIN'] = '0' if conf['boringssl']: if os.path.exists(util.getpath(config.PATH_BORINGSSL)): util.cd(config.PATH_BORINGSSL) util.exec('git', 'reset', '--hard') util.exec('git', 'fetch', '--all') else: util.exec('git', 'clone', 'https://boringssl.googlesource.com/boringssl.git', util.getpath(config.PATH_BORINGSSL)) util.cd(config.PATH_BORINGSSL) util.exec('git', 'checkout', '-f', conf['boringssl']) if os.path.exists(util.getpath(config.PATH_BORINGSSL, 'src', 'include')): conf['boringssl_path'] = util.getpath(config.PATH_BORINGSSL, 'src', 'include') elif os.path.exists(util.getpath(config.PATH_BORINGSSL, 'src')): conf['boringssl_path'] = util.getpath(config.PATH_BORINGSSL, 'src') else: conf['boringssl_path'] = util.getpath(config.PATH_BORINGSSL)
def setup(conf): util.cd(config.DIR_BUILD) if os.path.exists(util.getpath(config.PATH_DEPOT_TOOLS)): util.cd(config.PATH_DEPOT_TOOLS) util.exec('git', 'checkout', '-f', 'master') util.exec('git', 'pull') else: util.exec( 'git', 'clone', 'https://chromium.googlesource.com/chromium/tools/depot_tools.git', util.getpath(config.PATH_DEPOT_TOOLS)) os.environ['PATH'] = util.getpath( config.PATH_DEPOT_TOOLS) + os.path.pathsep + os.environ['PATH'] if sys.platform == 'win32': os.environ['DEPOT_TOOLS_WIN_TOOLCHAIN'] = '0' if conf['boringssl']: if os.path.exists(util.getpath(config.PATH_BORINGSSL)): util.cd(config.PATH_BORINGSSL) util.exec('git', 'reset', '--hard') util.exec('git', 'fetch', '--all') else: util.exec('git', 'clone', 'https://boringssl.googlesource.com/boringssl.git', util.getpath(config.PATH_BORINGSSL)) util.cd(config.PATH_BORINGSSL) util.exec('git', 'checkout', '-f', conf['boringssl']) if os.path.exists(util.getpath(config.PATH_BORINGSSL, 'src', 'include')): conf['boringssl_path'] = util.getpath(config.PATH_BORINGSSL, 'src', 'include') elif os.path.exists(util.getpath(config.PATH_BORINGSSL, 'src')): conf['boringssl_path'] = util.getpath(config.PATH_BORINGSSL, 'src') else: conf['boringssl_path'] = util.getpath(config.PATH_BORINGSSL) if conf['platform'] in config.libcxx_url.keys(): util.cd(config.PATH_LIBCXX) url = config.libcxx_url[conf['platform']] if not os.path.exists(os.path.abspath(url.split('/')[-1])): util.exec('wget', url) util.exec('tar', 'xvaf', url.split('/')[-1], '--strip-components=1', '--wildcards', '*/include/c++', '*/libc++*')