use sysroot by default on linux
This commit is contained in:
Родитель
e27e3d641c
Коммит
91951472bf
|
@ -44,7 +44,7 @@ def main():
|
||||||
args.libcc_static_library_path)
|
args.libcc_static_library_path)
|
||||||
|
|
||||||
if PLATFORM == 'linux':
|
if PLATFORM == 'linux':
|
||||||
download_sysroot(args.target_arch, args.sysroot_url, args.sysroot_sha1sum)
|
download_sysroot(args.target_arch)
|
||||||
|
|
||||||
create_chrome_version_h()
|
create_chrome_version_h()
|
||||||
touch_config_gypi()
|
touch_config_gypi()
|
||||||
|
@ -79,10 +79,6 @@ def parse_args():
|
||||||
help='The shared library path of libchromiumcontent.')
|
help='The shared library path of libchromiumcontent.')
|
||||||
parser.add_argument('--libcc_static_library_path', required=False,
|
parser.add_argument('--libcc_static_library_path', required=False,
|
||||||
help='The static library path of libchromiumcontent.')
|
help='The static library path of libchromiumcontent.')
|
||||||
parser.add_argument('--sysroot_url', required=False,
|
|
||||||
help='The URL to download sysroot image.')
|
|
||||||
parser.add_argument('--sysroot_sha1sum', required=False,
|
|
||||||
help='SHA1 hash of the sysroot image tarball.')
|
|
||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
|
@ -167,23 +163,13 @@ def update_clang():
|
||||||
execute_stdout([os.path.join(SOURCE_ROOT, 'script', 'update-clang.sh')])
|
execute_stdout([os.path.join(SOURCE_ROOT, 'script', 'update-clang.sh')])
|
||||||
|
|
||||||
|
|
||||||
def download_sysroot(target_arch, url, sha1sum):
|
def download_sysroot(target_arch):
|
||||||
if url or target_arch in ['ia32', 'arm']:
|
if target_arch == 'ia32':
|
||||||
os.environ['USE_SYSROOT'] = '1'
|
target_arch = 'i386'
|
||||||
sysroot_script = os.path.join(SOURCE_ROOT, 'script', 'install-sysroot.py')
|
if target_arch == 'x64':
|
||||||
if target_arch == 'ia32':
|
target_arch = 'amd64'
|
||||||
target_arch = 'i386'
|
execute_stdout([os.path.join(SOURCE_ROOT, 'script', 'install-sysroot.py'),
|
||||||
if target_arch == 'x64':
|
'--arch', target_arch])
|
||||||
target_arch = 'amd64'
|
|
||||||
args = [
|
|
||||||
'--arch', target_arch
|
|
||||||
]
|
|
||||||
if url:
|
|
||||||
args += ['--url', url]
|
|
||||||
if sha1sum:
|
|
||||||
args += ['--revision', sha1sum]
|
|
||||||
execute_stdout([sysroot_script] + args)
|
|
||||||
|
|
||||||
|
|
||||||
def create_chrome_version_h():
|
def create_chrome_version_h():
|
||||||
version_file = os.path.join(SOURCE_ROOT, 'vendor', 'brightray', 'vendor',
|
version_file = os.path.join(SOURCE_ROOT, 'vendor', 'brightray', 'vendor',
|
||||||
|
|
|
@ -30,15 +30,15 @@ from lib.util import get_host_arch
|
||||||
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||||
URL_PREFIX = 'https://github.com'
|
URL_PREFIX = 'https://github.com'
|
||||||
URL_PATH = 'atom/debian-sysroot-image-creator/releases/download'
|
URL_PATH = 'atom/debian-sysroot-image-creator/releases/download'
|
||||||
REVISION_AMD64 = 264817
|
REVISION_AMD64 = 'v0.3.0'
|
||||||
REVISION_I386 = 'v0.2.0'
|
REVISION_I386 = 'v0.3.0'
|
||||||
REVISION_ARM = 'v0.1.0'
|
REVISION_ARM = 'v0.3.0'
|
||||||
TARBALL_AMD64 = 'debian_wheezy_amd64_sysroot.tgz'
|
TARBALL_AMD64 = 'debian_wheezy_amd64_sysroot.tgz'
|
||||||
TARBALL_I386 = 'debian_wheezy_i386_sysroot.tgz'
|
TARBALL_I386 = 'debian_wheezy_i386_sysroot.tgz'
|
||||||
TARBALL_ARM = 'debian_wheezy_arm_sysroot.tgz'
|
TARBALL_ARM = 'debian_wheezy_arm_sysroot.tgz'
|
||||||
TARBALL_AMD64_SHA1SUM = '74b7231e12aaf45c5c5489d9aebb56bd6abb3653'
|
TARBALL_AMD64_SHA1SUM = '3dc6f553c3f4e54166ac1264b7754cddc01942e4'
|
||||||
TARBALL_I386_SHA1SUM = 'f5b2ceaeb3f7e6bc2058733585fe877d002b5fa7'
|
TARBALL_I386_SHA1SUM = '62d2490de201f73b3774868f7ab82b2a48acf3c0'
|
||||||
TARBALL_ARM_SHA1SUM = '72e668c57b8591e108759584942ddb6f6cee1322'
|
TARBALL_ARM_SHA1SUM = '1110793341e7a3c12adfe5e53138d692a22c99bc'
|
||||||
SYSROOT_DIR_AMD64 = 'debian_wheezy_amd64-sysroot'
|
SYSROOT_DIR_AMD64 = 'debian_wheezy_amd64-sysroot'
|
||||||
SYSROOT_DIR_I386 = 'debian_wheezy_i386-sysroot'
|
SYSROOT_DIR_I386 = 'debian_wheezy_i386-sysroot'
|
||||||
SYSROOT_DIR_ARM = 'debian_wheezy_arm-sysroot'
|
SYSROOT_DIR_ARM = 'debian_wheezy_arm-sysroot'
|
||||||
|
@ -134,11 +134,7 @@ def main():
|
||||||
print 'Unknown architecture: %s' % target_arch
|
print 'Unknown architecture: %s' % target_arch
|
||||||
assert(False)
|
assert(False)
|
||||||
|
|
||||||
if options.url:
|
url = '%s/%s/%s/%s' % (URL_PREFIX, URL_PATH, revision, tarball_filename)
|
||||||
url = options.url
|
|
||||||
tarball_sha1sum = options.revision
|
|
||||||
else:
|
|
||||||
url = '%s/%s/%s/%s' % (URL_PREFIX, URL_PATH, revision, tarball_filename)
|
|
||||||
|
|
||||||
stamp = os.path.join(sysroot, '.stamp')
|
stamp = os.path.join(sysroot, '.stamp')
|
||||||
if os.path.exists(stamp):
|
if os.path.exists(stamp):
|
||||||
|
@ -157,12 +153,11 @@ def main():
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
sys.stderr.flush()
|
sys.stderr.flush()
|
||||||
subprocess.check_call(['curl', '--fail', '-L', url, '-o', tarball])
|
subprocess.check_call(['curl', '--fail', '-L', url, '-o', tarball])
|
||||||
if tarball_sha1sum:
|
sha1sum = GetSha1(tarball)
|
||||||
sha1sum = GetSha1(tarball)
|
if sha1sum != tarball_sha1sum:
|
||||||
if sha1sum != tarball_sha1sum:
|
print 'Tarball sha1sum is wrong.'
|
||||||
print 'Tarball sha1sum is wrong.'
|
print 'Expected %s, actual: %s' % (tarball_sha1sum, sha1sum)
|
||||||
print 'Expected %s, actual: %s' % (tarball_sha1sum, sha1sum)
|
return 1
|
||||||
return 1
|
|
||||||
subprocess.check_call(['tar', 'xf', tarball, '-C', sysroot])
|
subprocess.check_call(['tar', 'xf', tarball, '-C', sysroot])
|
||||||
os.remove(tarball)
|
os.remove(tarball)
|
||||||
|
|
||||||
|
@ -178,9 +173,5 @@ if __name__ == '__main__':
|
||||||
'Linux builds')
|
'Linux builds')
|
||||||
parser.add_option('--arch', type='choice', choices=valid_archs,
|
parser.add_option('--arch', type='choice', choices=valid_archs,
|
||||||
help='Sysroot architecture: %s' % ', '.join(valid_archs))
|
help='Sysroot architecture: %s' % ', '.join(valid_archs))
|
||||||
parser.add_option('--url', default=None,
|
|
||||||
help='The URL to download sysroot image.')
|
|
||||||
parser.add_option('--revision', default=None,
|
|
||||||
help='SHA1 hash of the sysroot image tarball.')
|
|
||||||
options, _ = parser.parse_args()
|
options, _ = parser.parse_args()
|
||||||
sys.exit(main())
|
sys.exit(main())
|
||||||
|
|
|
@ -60,18 +60,12 @@ def run_gyp(target_arch, component):
|
||||||
mas_build = 1
|
mas_build = 1
|
||||||
else:
|
else:
|
||||||
mas_build = 0
|
mas_build = 0
|
||||||
# Whether to use sysroot image.
|
|
||||||
if os.environ.has_key('USE_SYSROOT'):
|
|
||||||
use_sysroot = 1
|
|
||||||
else:
|
|
||||||
use_sysroot = 0
|
|
||||||
defines = [
|
defines = [
|
||||||
'-Dlibchromiumcontent_component={0}'.format(component),
|
'-Dlibchromiumcontent_component={0}'.format(component),
|
||||||
'-Dtarget_arch={0}'.format(target_arch),
|
'-Dtarget_arch={0}'.format(target_arch),
|
||||||
'-Dhost_arch={0}'.format(get_host_arch()),
|
'-Dhost_arch={0}'.format(get_host_arch()),
|
||||||
'-Dlibrary=static_library',
|
'-Dlibrary=static_library',
|
||||||
'-Dmas_build={0}'.format(mas_build),
|
'-Dmas_build={0}'.format(mas_build),
|
||||||
'-Duse_sysroot={0}'.format(use_sysroot)
|
|
||||||
]
|
]
|
||||||
return subprocess.call([python, gyp, '-f', 'ninja', '--depth', '.',
|
return subprocess.call([python, gyp, '-f', 'ninja', '--depth', '.',
|
||||||
'atom.gyp', '-Icommon.gypi'] + defines, env=env)
|
'atom.gyp', '-Icommon.gypi'] + defines, env=env)
|
||||||
|
|
|
@ -113,7 +113,7 @@
|
||||||
}],
|
}],
|
||||||
|
|
||||||
# Setup sysroot environment.
|
# Setup sysroot environment.
|
||||||
['OS=="linux" and target_arch in ["arm", "ia32", "x64"] and use_sysroot', {
|
['OS=="linux" and target_arch in ["arm", "ia32", "x64"]', {
|
||||||
'variables': {
|
'variables': {
|
||||||
'conditions': [
|
'conditions': [
|
||||||
['target_arch=="arm"', {
|
['target_arch=="arm"', {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче