import stat
from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, PLATFORM, \
- DIST_ARCH
+ get_target_arch
from lib.util import scoped_cwd, rm_rf, get_atom_shell_version, make_zip, \
execute, get_chromedriver_version
def create_dist_zip():
dist_name = 'atom-shell-{0}-{1}-{2}.zip'.format(ATOM_SHELL_VERSION,
- PLATFORM, DIST_ARCH)
+ PLATFORM, get_target_arch())
zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name)
with scoped_cwd(DIST_DIR):
def create_chromedriver_zip():
dist_name = 'chromedriver-{0}-{1}-{2}.zip'.format(get_chromedriver_version(),
- PLATFORM, DIST_ARCH)
+ PLATFORM, get_target_arch())
zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name)
with scoped_cwd(DIST_DIR):
def create_symbols_zip():
dist_name = 'atom-shell-{0}-{1}-{2}-symbols.zip'.format(ATOM_SHELL_VERSION,
PLATFORM,
- DIST_ARCH)
+ get_target_arch())
zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name)
with scoped_cwd(DIST_DIR):
#!/usr/bin/env python
+import os
import platform
import sys
+
BASE_URL = 'http://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = 'f1ad1412461ba3345a27cfe935ffc872dba0ac5b'
-ARCH = {
- 'cygwin': '32bit',
- 'darwin': '64bit',
- 'linux2': platform.architecture()[0],
- 'win32': '32bit',
-}[sys.platform]
-DIST_ARCH = {
- '32bit': 'ia32',
- '64bit': 'x64',
-}[ARCH]
-
PLATFORM = {
'cygwin': 'win32',
'darwin': 'darwin',
verbose_mode = False
+
+def get_target_arch():
+ # Always build 64bit on OS X.
+ if PLATFORM == 'darwin':
+ return 'x64'
+ # Only build for host's arch on Linux.
+ elif PLATFORM == 'linux':
+ if platform.architecture()[0] == '32bit':
+ return 'ia32'
+ else:
+ return 'x64'
+ # On Windows it depends on user.
+ elif PLATFORM == 'win32':
+ target_arch_path = os.path.join(__file__, '..', '..', '..', 'vendor',
+ 'brightray', 'vendor', 'download',
+ 'libchromiumcontent', '.target_arch')
+ with open(os.path.normpath(target_arch_path)) as f:
+ target_arch = f.read().strip()
+ return target_arch
+ # Maybe we will support other platforms in future.
+ else:
+ return 'x64'
+
+
def enable_verbose_mode():
print 'Running in verbose mode'
global verbose_mode
verbose_mode = True
+
def is_verbose_mode():
return verbose_mode
import subprocess
import sys
-from lib.config import DIST_ARCH
+from lib.config import get_target_arch
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
def update_gyp():
- target_arch = DIST_ARCH
- if sys.platform == 'darwin':
- # Only have 64bit build on OS X.
- target_arch = 'x64'
- elif sys.platform in ['cygwin', 'win32']:
- # Only have 32bit build on Windows.
- target_arch = 'ia32'
-
# Since gyp doesn't support specify link_settings for each configuration,
# we are not able to link to different libraries in "Debug" and "Release"
# configurations.
# for twice, one is to generate "Debug" config, the other one to generate
# the "Release" config. And the settings are controlled by the variable
# "libchromiumcontent_component" which is defined before running gyp.
+ target_arch = get_target_arch()
return (run_gyp(target_arch, 0) or run_gyp(target_arch, 1))
import sys
import tempfile
-from lib.config import DIST_ARCH, PLATFORM
+from lib.config import PLATFORM, get_target_arch
from lib.util import execute, get_atom_shell_version, parse_version, \
get_chromedriver_version, scoped_cwd
from lib.github import GitHub
DIST_DIR = os.path.join(SOURCE_ROOT, 'dist')
DIST_NAME = 'atom-shell-{0}-{1}-{2}.zip'.format(ATOM_SHELL_VERSION,
PLATFORM,
- DIST_ARCH)
+ get_target_arch())
SYMBOLS_NAME = 'atom-shell-{0}-{1}-{2}-symbols.zip'.format(ATOM_SHELL_VERSION,
PLATFORM,
- DIST_ARCH)
+ get_target_arch())
CHROMEDRIVER_NAME = 'chromedriver-{0}-{1}-{2}.zip'.format(CHROMEDRIVER_VERSION,
PLATFORM,
- DIST_ARCH)
+ get_target_arch())
def main():
-Subproject commit f44a3834690c010a1841cde92ca5e4798b1c9d2f
+Subproject commit 33367e86d33f2ba8bf3d9dc796b469e6d5855e20