diff --git a/.gitignore b/.gitignore index 76bfa72b49d..eb045368b7a 100644 --- a/.gitignore +++ b/.gitignore @@ -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/ diff --git a/script/bootstrap.py b/script/bootstrap.py index 9345bd8ac5f..f7183d866bf 100755 --- a/script/bootstrap.py +++ b/script/bootstrap.py @@ -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') diff --git a/script/lib/config.py b/script/lib/config.py index 58f467b5b64..93056665cea 100644 --- a/script/lib/config.py +++ b/script/lib/config.py @@ -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'