Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(460)

Side by Side Diff: build/linux/sysroot_scripts/install-sysroot.py

Issue 2476343004: GN: Add an option to build against the Debian wheezy sysroot (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « build/detect_host_arch.py ('k') | tools/gn.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 # Script to install a Debian Wheezy sysroot for making official Google Chrome 6 # Script to install a Debian Wheezy sysroot for making official Google Chrome
7 # Linux builds. 7 # Linux builds.
8 # The sysroot is needed to make Chrome work for Debian Wheezy. 8 # The sysroot is needed to make Chrome work for Debian Wheezy.
9 # This script can be run manually but is more often run as part of gclient 9 # This script can be run manually but is more often run as part of gclient
10 # hooks. When run from hooks this script should be a no-op on non-linux 10 # hooks. When run from hooks this script should be a no-op on non-linux
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 gyp_defines = os.environ.get('GYP_DEFINES', '') 101 gyp_defines = os.environ.get('GYP_DEFINES', '')
102 102
103 if options.arch: 103 if options.arch:
104 target_arch = options.arch 104 target_arch = options.arch
105 else: 105 else:
106 target_arch = DetectArch(gyp_defines) 106 target_arch = DetectArch(gyp_defines)
107 if not target_arch: 107 if not target_arch:
108 print 'Unable to detect host architecture' 108 print 'Unable to detect host architecture'
109 return 1 109 return 1
110 110
111 if options.running_as_hook and target_arch != 'arm' and target_arch != 'mips':
112 # When run from runhooks, only install the sysroot for an Official Chrome
113 # Linux build, except on ARM where we always use a sysroot.
114 skip_if_defined = ['branding=Chrome', 'buildtype=Official']
115 skip_if_undefined = ['chromeos=1']
116 for option in skip_if_defined:
117 if option not in gyp_defines:
118 return 0
119 for option in skip_if_undefined:
120 if option in gyp_defines:
121 return 0
122
123 # The sysroot directory should match the one specified in build/common.gypi. 111 # The sysroot directory should match the one specified in build/common.gypi.
124 # TODO(thestig) Consider putting this else where to avoid having to recreate 112 # TODO(thestig) Consider putting this else where to avoid having to recreate
125 # it on every build. 113 # it on every build.
126 linux_dir = os.path.dirname(SCRIPT_DIR) 114 linux_dir = os.path.dirname(SCRIPT_DIR)
127 if target_arch == 'amd64': 115 if target_arch == 'amd64':
128 sysroot = os.path.join(linux_dir, SYSROOT_DIR_AMD64) 116 sysroot = os.path.join(linux_dir, SYSROOT_DIR_AMD64)
129 tarball_filename = TARBALL_AMD64 117 tarball_filename = TARBALL_AMD64
130 tarball_sha1sum = TARBALL_AMD64_SHA1SUM 118 tarball_sha1sum = TARBALL_AMD64_SHA1SUM
131 revision = REVISION_AMD64 119 revision = REVISION_AMD64
132 elif target_arch == 'arm': 120 elif target_arch == 'arm':
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 parser = optparse.OptionParser('usage: %prog [OPTIONS]') 172 parser = optparse.OptionParser('usage: %prog [OPTIONS]')
185 parser.add_option('--running-as-hook', action='store_true', 173 parser.add_option('--running-as-hook', action='store_true',
186 default=False, help='Used when running from gclient hooks.' 174 default=False, help='Used when running from gclient hooks.'
187 ' In this mode the sysroot will only ' 175 ' In this mode the sysroot will only '
188 'be installed for official Linux ' 176 'be installed for official Linux '
189 'builds or ARM Linux builds') 177 'builds or ARM Linux builds')
190 parser.add_option('--arch', type='choice', choices=valid_archs, 178 parser.add_option('--arch', type='choice', choices=valid_archs,
191 help='Sysroot architecture: %s' % ', '.join(valid_archs)) 179 help='Sysroot architecture: %s' % ', '.join(valid_archs))
192 options, _ = parser.parse_args() 180 options, _ = parser.parse_args()
193 sys.exit(main()) 181 sys.exit(main())
OLDNEW
« no previous file with comments | « build/detect_host_arch.py ('k') | tools/gn.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698