aboutsummaryrefslogtreecommitdiffhomepage
path: root/infra/bots/recipe_modules/flavor/pdfium_flavor.py
diff options
context:
space:
mode:
authorGravatar Eric Boren <borenet@google.com>2017-01-13 13:37:53 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-01-17 12:58:30 +0000
commit6441a4645be53e124ec88b8f6c59b8ca2ca4b427 (patch)
tree91892859ad02d4267d6f494dee5284254bb9b12b /infra/bots/recipe_modules/flavor/pdfium_flavor.py
parent2103cf0ff09763aeaa35508734f765aec9b75665 (diff)
Move recipe modules to shared repo
BUG=skia:6070 Change-Id: I6c487e77ddfddb6164b983981dff5ee8ae870376 Reviewed-on: https://skia-review.googlesource.com/6946 Commit-Queue: Eric Boren <borenet@google.com> Reviewed-by: Ravi Mistry <rmistry@google.com> Reviewed-by: Stephan Altmueller <stephana@google.com>
Diffstat (limited to 'infra/bots/recipe_modules/flavor/pdfium_flavor.py')
-rw-r--r--infra/bots/recipe_modules/flavor/pdfium_flavor.py87
1 files changed, 0 insertions, 87 deletions
diff --git a/infra/bots/recipe_modules/flavor/pdfium_flavor.py b/infra/bots/recipe_modules/flavor/pdfium_flavor.py
deleted file mode 100644
index f16f51f229..0000000000
--- a/infra/bots/recipe_modules/flavor/pdfium_flavor.py
+++ /dev/null
@@ -1,87 +0,0 @@
-# Copyright 2016 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.
-
-import re
-
-import default_flavor
-
-
-"""PDFium flavor utils, used for building PDFium with Skia."""
-
-
-class PDFiumFlavorUtils(default_flavor.DefaultFlavorUtils):
-
- def compile(self, target, **kwargs):
- """Build PDFium with Skia."""
- pdfium_dir = self.m.vars.checkout_root.join('pdfium')
-
- # Runhook to generate the gn binary in buildtools.
- self.m.run(
- self.m.step,
- 'runhook',
- cmd=['gclient', 'runhook', 'gn_linux64'],
- cwd=pdfium_dir,
- **kwargs)
-
- # Install the sysroot.
- self.m.run(
- self.m.step,
- 'sysroot',
- cmd=['python', 'build/linux/sysroot_scripts/install-sysroot.py',
- '--arch=amd64'],
- cwd=pdfium_dir)
-
- # Setup gn args.
- gn_args = [
- 'pdf_is_standalone=true',
- 'clang_use_chrome_plugins=false',
- 'is_component_build=false',
- 'is_debug=false',
- ]
- if 'SkiaPaths' in self.m.vars.builder_name:
- gn_args.append('pdf_use_skia_paths=true')
- else:
- gn_args.append('pdf_use_skia=true')
-
-
- env = kwargs.pop('env', {})
- env['CHROMIUM_BUILDTOOLS_PATH'] = str(pdfium_dir.join('buildtools'))
- self.m.run(
- self.m.step,
- 'gn_gen',
- cmd=['gn', 'gen', 'out/skia', '--args=%s' % ' '.join(gn_args)],
- cwd=pdfium_dir,
- env=env)
-
- # Modify DEPS file to contain the current Skia revision.
- skia_revision = self.m.vars.got_revision
- deps_file = pdfium_dir.join('DEPS')
- test_data = "'skia_revision': 'abc'"
-
- original_contents = self.m.file.read(
- 'read PDFium DEPS', deps_file, test_data=test_data, infra_step=True)
-
- deps_skia_regexp = re.compile(
- r'(?<=["\']skia_revision["\']: ["\'])([a-fA-F0-9]+)(?=["\'])',
- re.MULTILINE)
- patched_contents = re.sub(deps_skia_regexp, str(skia_revision),
- original_contents)
- self.m.file.write('write PDFium DEPs', deps_file,
- patched_contents, infra_step=True)
-
- # gclient sync after updating DEPS.
- self.m.run(
- self.m.step,
- 'sync_pdfium',
- cmd=['gclient', 'sync'],
- cwd=pdfium_dir)
-
- # Build PDFium.
- self.m.run(
- self.m.step,
- 'build_pdfium',
- cmd=['ninja', '-C', 'out/skia', '-j100'],
- cwd=pdfium_dir,
- env=env,
- **kwargs)