blob: 2885a92ad00dc39842635f10c0f161b7ea3ba36e [file] [log] [blame]
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from recipe_engine import post_process
DEPS = [
def RunSteps(api):
build_dir = api.path['start_dir'].join('build_dir')
version =['version']
tar_filename = 'chromium-%s.tar.xz' % version
tar_file = build_dir.join(tar_filename)
api.gsutil.download_url('gs://chromium-browser-official/' + tar_filename,
api.step('Extract tarball.',
['tar', '-xJf', str(tar_file), '-C',
src_dir = build_dir.join('chromium-' + version)
# TODO(tandrii,thomasanderson): use ninja from CIPD package
with api.context(
env_suffixes={'PATH': [api.path.dirname(api.depot_tools.ninja_path)]}):
llvm_bin_dir = src_dir.join('third_party', 'llvm-build',
'Release+Asserts', 'bin')
gn_bootstrap_env = {
'CC': llvm_bin_dir.join('clang'),
'CXX': llvm_bin_dir.join('clang++'),
'AR': llvm_bin_dir.join('llvm-ar'),
'LDFLAGS': '-fuse-ld=lld',
gn_args = [
# TODO(thomasanderson): Setting use_system_libjpeg shouldn't be
# necessary when unbundling libjpeg.
unbundle_libs = [
# 'ffmpeg',
# TODO(thomasanderson): Add ogg-dev to sysroots.
# 'flac',
# TODO(thomasanderson): Reenable once Debian unstable pulls in
# harfbuzz 1.7.5 or later.
# 'harfbuzz-ng',
# The icu dev package is huge, so it's omitted from the sysroots.
# 'icu',
# 'libpng',
# TODO(thomasanderson): Update the sysroot.
# 'libvpx',
# 'libxml',
# TODO(thomasanderson): Add libxml2-dev to sysroots.
# 'libxslt',
# Chrome passes c++ strings to re2, but the inline namespace used by
# libc++ (std::__1::string) differs from the one re2 expects
# (std::__cxx11::string), causing link failures.
# 're2',
# Use the yasm in third_party to prevent having to install yasm on the
# bot.
# 'yasm',
# TODO(thomasanderson): Add libminizip-dev to sysroots.
# 'zlib',
'Download sysroot.',
api.path.join(src_dir, 'build', 'linux', 'sysroot_scripts',
''), ['--arch=amd64'])
'Build clang.',
api.path.join(src_dir, 'tools', 'clang', 'scripts', ''),
['--skip-checkout', '--without-android', '--without-fuchsia'])
with api.context(env=gn_bootstrap_env):
'Bootstrap gn.',
api.path.join(src_dir, 'tools', 'gn', 'bootstrap', ''),
['--gn-gen-args=%s' % ' '.join(gn_args), '--use-custom-libcxx'])
api.step('Download nodejs.', [
api.path.join(src_dir, 'third_party', 'node', 'update_node_binaries')
'Unbundle libraries.',
api.path.join(src_dir, 'build', 'linux', 'unbundle',
['--system-libraries'] + unbundle_libs)
api.step('Build chrome.',
['ninja', '-C', 'out/Release', 'chrome/installer/linux'])
api.file.rmtree('Cleaning build dir.', build_dir)
def GenTests(api):
yield (api.test('basic') +'80.0.3987.76') +
api.platform('linux', 64))