Download mips64el toolchain

This commit is contained in:
Cheng Zhao 2017-11-21 19:22:31 +09:00
parent 447e0e6c8b
commit a83b8e751b
3 changed files with 32 additions and 4 deletions

3
.gitignore vendored
View file

@ -32,9 +32,12 @@
/vendor/debian_jessie_arm-sysroot/
/vendor/debian_jessie_arm64-sysroot/
/vendor/debian_jessie_i386-sysroot/
/vendor/debian_jessie_mips64-sysroot/
/vendor/debian_wheezy_amd64-sysroot/
/vendor/debian_wheezy_arm-sysroot/
/vendor/debian_wheezy_i386-sysroot/
/vendor/gcc-4.8.3-d197-n64-loongson/
/vendor/readme-gcc483-loongson.txt
/vendor/download/
/vendor/llvm-build/
/vendor/llvm/

View file

@ -7,10 +7,11 @@ import re
import subprocess
import sys
from lib.config import BASE_URL, PLATFORM, enable_verbose_mode, \
from lib.config import BASE_URL, PLATFORM, MIPS64EL_SYSROOT_URL, \
MIPS64EL_GCC, MIPS64EL_GCC_URL, enable_verbose_mode, \
is_verbose_mode, get_target_arch
from lib.util import execute, execute_stdout, get_electron_version, \
scoped_cwd, update_node_modules
scoped_cwd, download, update_node_modules
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
@ -18,7 +19,6 @@ VENDOR_DIR = os.path.join(SOURCE_ROOT, 'vendor')
DOWNLOAD_DIR = os.path.join(VENDOR_DIR, 'download')
PYTHON_26_URL = 'https://chromium.googlesource.com/chromium/deps/python_26'
def main():
os.chdir(SOURCE_ROOT)
@ -37,6 +37,9 @@ def main():
libcc_shared_library_path = args.libcc_shared_library_path
libcc_static_library_path = args.libcc_static_library_path
if args.target_arch == 'mips64el':
download_mips64el_toolchain()
# Redirect to use local libchromiumcontent build.
if args.build_release_libcc or args.build_debug_libcc:
build_libchromiumcontent(args.verbose, args.target_arch, defines,
@ -57,7 +60,7 @@ def main():
libcc_source_path, libcc_shared_library_path,
libcc_static_library_path)
if PLATFORM == 'linux':
if PLATFORM == 'linux' and args.target_arch != 'mips64el':
download_sysroot(args.target_arch)
create_chrome_version_h()
@ -198,6 +201,23 @@ def download_sysroot(target_arch):
'--arch', target_arch],
cwd=VENDOR_DIR)
def download_mips64el_toolchain():
# Download sysroot image.
if not os.path.exists(os.path.join(VENDOR_DIR, 'debian_jessie_mips64-sysroot')):
tar_name = 'debian_jessie_mips64-sysroot.tar.bz2'
download(tar_name, MIPS64EL_SYSROOT_URL,
os.path.join(SOURCE_ROOT, tar_name))
subprocess.call(['tar', '-jxf', tar_name, '-C', VENDOR_DIR])
os.remove(tar_name)
# Download toolchain.
if not os.path.exists(os.path.join(VENDOR_DIR, MIPS64EL_GCC)):
tar_name = MIPS64EL_GCC + '.tar.gz'
download(tar_name, MIPS64EL_GCC_URL, os.path.join(SOURCE_ROOT, tar_name))
subprocess.check_call(['tar', '-xf', tar_name, '-C', VENDOR_DIR])
os.remove(tar_name)
def create_chrome_version_h():
version_file = os.path.join(VENDOR_DIR, 'libchromiumcontent', 'VERSION')
target_file = os.path.join(SOURCE_ROOT, 'atom', 'common', 'chrome_version.h')

View file

@ -5,6 +5,11 @@ import os
import platform
import sys
# URL to the mips64el sysroot image.
MIPS64EL_SYSROOT_URL = 'https://github.com/electron/debian-sysroot-image-creator/releases/download/v0.5.0/debian_jessie_mips64-sysroot.tar.bz2'
# URL to the mips64el toolchain.
MIPS64EL_GCC = 'gcc-4.8.3-d197-n64-loongson'
MIPS64EL_GCC_URL = 'http://ftp.loongnix.org/toolchain/gcc/release/' + MIPS64EL_GCC + '.tar.gz'
BASE_URL = os.getenv('LIBCHROMIUMCONTENT_MIRROR') or \
'https://s3.amazonaws.com/github-janky-artifacts/libchromiumcontent'