|
@@ -9,7 +9,8 @@ import sys
|
|
|
|
|
|
from lib.config import BASE_URL, PLATFORM, enable_verbose_mode, \
|
|
|
is_verbose_mode, get_target_arch
|
|
|
-from lib.util import execute, execute_stdout, get_electron_version, scoped_cwd
|
|
|
+from lib.util import execute, execute_stdout, get_electron_version, \
|
|
|
+ scoped_cwd, update_node_modules
|
|
|
|
|
|
|
|
|
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
|
@@ -17,10 +18,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'
|
|
|
|
|
|
-NPM = 'npm'
|
|
|
-if sys.platform in ['win32', 'cygwin']:
|
|
|
- NPM += '.cmd'
|
|
|
-
|
|
|
|
|
|
def main():
|
|
|
os.chdir(SOURCE_ROOT)
|
|
@@ -65,7 +62,6 @@ def main():
|
|
|
create_chrome_version_h()
|
|
|
touch_config_gypi()
|
|
|
run_update(defines, args.msvs)
|
|
|
- update_electron_modules('spec', args.target_arch)
|
|
|
|
|
|
|
|
|
def parse_args():
|
|
@@ -167,37 +163,6 @@ def set_clang_env(env):
|
|
|
env['CXX'] = os.path.join(llvm_dir, 'clang++')
|
|
|
|
|
|
|
|
|
-def update_node_modules(dirname, env=None):
|
|
|
- if env is None:
|
|
|
- env = os.environ.copy()
|
|
|
- if PLATFORM == 'linux':
|
|
|
- # Use prebuilt clang for building native modules.
|
|
|
- set_clang_env(env)
|
|
|
- env['npm_config_clang'] = '1'
|
|
|
- with scoped_cwd(dirname):
|
|
|
- args = [NPM, 'install']
|
|
|
- if is_verbose_mode():
|
|
|
- args += ['--verbose']
|
|
|
- # Ignore npm install errors when running in CI.
|
|
|
- if os.environ.has_key('CI'):
|
|
|
- try:
|
|
|
- execute_stdout(args, env)
|
|
|
- except subprocess.CalledProcessError:
|
|
|
- pass
|
|
|
- else:
|
|
|
- execute_stdout(args, env)
|
|
|
-
|
|
|
-
|
|
|
-def update_electron_modules(dirname, target_arch):
|
|
|
- env = os.environ.copy()
|
|
|
- version = get_electron_version()
|
|
|
- env['npm_config_arch'] = target_arch
|
|
|
- env['npm_config_target'] = version
|
|
|
- env['npm_config_nodedir'] = os.path.join(SOURCE_ROOT, 'dist',
|
|
|
- 'node-{0}'.format(version))
|
|
|
- update_node_modules(dirname, env)
|
|
|
-
|
|
|
-
|
|
|
def update_win32_python():
|
|
|
with scoped_cwd(VENDOR_DIR):
|
|
|
if not os.path.exists('python_26'):
|