From d5171ab941b6170b31dcd75f8402cc7ae46d152a Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 18 May 2014 22:37:59 +0800 Subject: [PATCH 1/7] Add spec for checking webgl support. --- spec/chromium-spec.coffee | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spec/chromium-spec.coffee b/spec/chromium-spec.coffee index 7a1b68efd4cf..f7d56e71089a 100644 --- a/spec/chromium-spec.coffee +++ b/spec/chromium-spec.coffee @@ -65,3 +65,8 @@ describe 'chromium feature', -> it 'does not crash', -> RUint8Array = require('remote').getGlobal 'Uint8Array' new RUint8Array + + describe 'webgl', -> + it 'can be get as context in canvas', -> + webgl = document.createElement('canvas').getContext 'webgl' + assert.notEqual webgl, null From 8f9e0d8d59abc85d487279058a5f3743e7fb4f33 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 18 May 2014 23:03:46 +0800 Subject: [PATCH 2/7] Download dirextx sdk dlls. --- atom.gyp | 2 ++ script/update-frameworks.py | 27 +++++++++++++++++---------- script/update.py | 5 ++--- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/atom.gyp b/atom.gyp index 016260065ba6..0da45657a6a2 100644 --- a/atom.gyp +++ b/atom.gyp @@ -329,6 +329,8 @@ '<(libchromiumcontent_library_dir)/icudt.dll', '<(libchromiumcontent_library_dir)/libGLESv2.dll', '<(libchromiumcontent_resources_dir)/content_shell.pak', + 'frameworks/d3dcompiler_43.dll', + 'frameworks/xinput1_3.dll', ], }, { diff --git a/script/update-frameworks.py b/script/update-frameworks.py index f87be75809dd..89f78847ae67 100755 --- a/script/update-frameworks.py +++ b/script/update-frameworks.py @@ -1,5 +1,6 @@ #!/usr/bin/env python +import errno import sys import os @@ -8,15 +9,25 @@ from lib.util import safe_mkdir, extract_zip, tempdir, download SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) FRAMEWORKS_URL = 'https://github.com/atom/atom-shell-frameworks/releases' \ - '/download/v0.0.2' + '/download/v0.0.3' def main(): os.chdir(SOURCE_ROOT) - safe_mkdir('frameworks') - download_and_unzip('Mantle') - download_and_unzip('ReactiveCocoa') - download_and_unzip('Squirrel') + try: + os.makedirs('frameworks') + except OSError as e: + if e.errno != errno.EEXIST: + raise + else: + return + + if sys.platform == 'darwin': + download_and_unzip('Mantle') + download_and_unzip('ReactiveCocoa') + download_and_unzip('Squirrel') + elif sys.platform in ['cygwin', 'win32']: + download_and_unzip('directxsdk') def download_and_unzip(framework): @@ -26,11 +37,7 @@ def download_and_unzip(framework): def download_framework(framework): - framework_path = os.path.join('frameworks', framework) + '.framework' - if os.path.exists(framework_path): - return - - filename = framework + '.framework.zip' + filename = framework + '.zip' url = FRAMEWORKS_URL + '/' + filename download_dir = tempdir(prefix='atom-shell-') path = os.path.join(download_dir, filename) diff --git a/script/update.py b/script/update.py index 16e850ad4502..241d746e6251 100755 --- a/script/update.py +++ b/script/update.py @@ -16,9 +16,8 @@ def main(): def update_frameworks(): - if sys.platform == 'darwin': - uf = os.path.join('script', 'update-frameworks.py') - subprocess.check_call([sys.executable, uf]) + uf = os.path.join('script', 'update-frameworks.py') + subprocess.check_call([sys.executable, uf]) def update_gyp(): From a83787ea42ff5710dbdc09e5527fed41e51795e0 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 18 May 2014 23:11:32 +0800 Subject: [PATCH 3/7] Update libchromiumcontent for libEGL.dll. --- atom.gyp | 1 + script/lib/config.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/atom.gyp b/atom.gyp index 0da45657a6a2..8cd7accc04f6 100644 --- a/atom.gyp +++ b/atom.gyp @@ -327,6 +327,7 @@ '<(libchromiumcontent_library_dir)/chromiumcontent.dll', '<(libchromiumcontent_library_dir)/ffmpegsumo.dll', '<(libchromiumcontent_library_dir)/icudt.dll', + '<(libchromiumcontent_library_dir)/libEGL.dll', '<(libchromiumcontent_library_dir)/libGLESv2.dll', '<(libchromiumcontent_resources_dir)/content_shell.pak', 'frameworks/d3dcompiler_43.dll', diff --git a/script/lib/config.py b/script/lib/config.py index dbf09ea7244d..9ac2a7bdd2c3 100644 --- a/script/lib/config.py +++ b/script/lib/config.py @@ -2,4 +2,4 @@ NODE_VERSION = 'v0.11.10' BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent' -LIBCHROMIUMCONTENT_COMMIT = '276722e68bb643e3ae3b468b701c276aeb884838' +LIBCHROMIUMCONTENT_COMMIT = '34d71b3bcc65c5213663a967ee1950c6d3729346' From 6358fd1a4b896c312caf2607be30fdbbfd22f443 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 18 May 2014 23:15:53 +0800 Subject: [PATCH 4/7] Ship WebGL necessary files in distribution. --- script/create-dist.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/script/create-dist.py b/script/create-dist.py index 823371a5aaff..3354b65cc2c3 100755 --- a/script/create-dist.py +++ b/script/create-dist.py @@ -44,7 +44,10 @@ TARGET_BINARIES = { 'content_shell.pak', 'ffmpegsumo.dll', 'icudt.dll', + 'libEGL.dll', 'libGLESv2.dll', + 'd3dcompiler_43.dll', + 'xinput1_3.dll', ], 'linux': [ 'atom', From 975405059887cf485aed5c69efb25901e290c456 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 18 May 2014 23:35:07 +0800 Subject: [PATCH 5/7] Rename "frameworks" to "external_binaries". --- atom.gyp | 18 +++++++++--------- script/cibuild | 1 + ...ameworks.py => update-external-binaries.py} | 4 ++-- script/update.py | 6 +++--- 4 files changed, 15 insertions(+), 14 deletions(-) rename script/{update-frameworks.py => update-external-binaries.py} (92%) diff --git a/atom.gyp b/atom.gyp index 8cd7accc04f6..335b021c4bc8 100644 --- a/atom.gyp +++ b/atom.gyp @@ -235,7 +235,7 @@ }, 'target_defaults': { 'mac_framework_dirs': [ - '<(atom_source_root)/frameworks', + '<(atom_source_root)/external_binaries', ], 'includes': [ # Rules for excluding e.g. foo_win.cc from the build on non-Windows. @@ -288,9 +288,9 @@ 'files': [ '<(PRODUCT_DIR)/<(product_name) Helper.app', '<(PRODUCT_DIR)/<(framework_name).framework', - 'frameworks/Squirrel.framework', - 'frameworks/ReactiveCocoa.framework', - 'frameworks/Mantle.framework', + 'external_binaries/Squirrel.framework', + 'external_binaries/ReactiveCocoa.framework', + 'external_binaries/Mantle.framework', ], }, { @@ -330,8 +330,8 @@ '<(libchromiumcontent_library_dir)/libEGL.dll', '<(libchromiumcontent_library_dir)/libGLESv2.dll', '<(libchromiumcontent_resources_dir)/content_shell.pak', - 'frameworks/d3dcompiler_43.dll', - 'frameworks/xinput1_3.dll', + 'external_binaries/d3dcompiler_43.dll', + 'external_binaries/xinput1_3.dll', ], }, { @@ -601,9 +601,9 @@ 'link_settings': { 'libraries': [ '$(SDKROOT)/System/Library/Frameworks/Carbon.framework', - 'frameworks/Squirrel.framework', - 'frameworks/ReactiveCocoa.framework', - 'frameworks/Mantle.framework', + 'external_binaries/Squirrel.framework', + 'external_binaries/ReactiveCocoa.framework', + 'external_binaries/Mantle.framework', ], }, 'mac_bundle': 1, diff --git a/script/cibuild b/script/cibuild index 5e7f1e5d8f92..c235ed067d5c 100755 --- a/script/cibuild +++ b/script/cibuild @@ -16,6 +16,7 @@ def main(): rm_rf(os.path.join(SOURCE_ROOT, 'out')) rm_rf(os.path.join(SOURCE_ROOT, 'node_modules')) rm_rf(os.path.join(SOURCE_ROOT, 'frameworks')) + rm_rf(os.path.join(SOURCE_ROOT, 'external_binaries')) rm_rf(os.path.join(SOURCE_ROOT, 'vendor', 'apm', 'node_modules')) rm_rf(os.path.join(SOURCE_ROOT, 'vendor', 'brightray', 'vendor', 'download', 'libchromiumcontent')) diff --git a/script/update-frameworks.py b/script/update-external-binaries.py similarity index 92% rename from script/update-frameworks.py rename to script/update-external-binaries.py index 89f78847ae67..c8045c28cad0 100755 --- a/script/update-frameworks.py +++ b/script/update-external-binaries.py @@ -15,7 +15,7 @@ FRAMEWORKS_URL = 'https://github.com/atom/atom-shell-frameworks/releases' \ def main(): os.chdir(SOURCE_ROOT) try: - os.makedirs('frameworks') + os.makedirs('external_binaries') except OSError as e: if e.errno != errno.EEXIST: raise @@ -33,7 +33,7 @@ def main(): def download_and_unzip(framework): zip_path = download_framework(framework) if zip_path: - extract_zip(zip_path, 'frameworks') + extract_zip(zip_path, 'external_binaries') def download_framework(framework): diff --git a/script/update.py b/script/update.py index 241d746e6251..63b7b4f72185 100755 --- a/script/update.py +++ b/script/update.py @@ -11,12 +11,12 @@ SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) def main(): os.chdir(SOURCE_ROOT) - update_frameworks() + update_external_binaries() update_gyp() -def update_frameworks(): - uf = os.path.join('script', 'update-frameworks.py') +def update_external_binaries(): + uf = os.path.join('script', 'update-external-binaries.py') subprocess.check_call([sys.executable, uf]) From c1e2348695e4cd3c9760bff49e48c433f4512afb Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 18 May 2014 23:42:47 +0800 Subject: [PATCH 6/7] Check for version when downloading external binaries. --- .gitignore | 2 +- script/update-external-binaries.py | 29 +++++++++++++++++++++-------- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index c9a7fece9aa3..1907e665442e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ .DS_Store /build/ /dist/ -/frameworks/ +/external_binaries/ /out/ /vendor/brightray/vendor/download/ /vendor/python_26/ diff --git a/script/update-external-binaries.py b/script/update-external-binaries.py index c8045c28cad0..5d8014f55c13 100755 --- a/script/update-external-binaries.py +++ b/script/update-external-binaries.py @@ -7,20 +7,22 @@ import os from lib.util import safe_mkdir, extract_zip, tempdir, download +VERSION = 'v0.0.3' SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) FRAMEWORKS_URL = 'https://github.com/atom/atom-shell-frameworks/releases' \ - '/download/v0.0.3' + '/download/' + VERSION def main(): os.chdir(SOURCE_ROOT) - try: - os.makedirs('external_binaries') - except OSError as e: - if e.errno != errno.EEXIST: - raise - else: - return + version_file = os.path.join(SOURCE_ROOT, 'external_binaries', '.version') + + safe_mkdir('external_binaries') + if (is_updated(version_file, VERSION)): + return + + with open(version_file, 'w') as f: + f.write(VERSION) if sys.platform == 'darwin': download_and_unzip('Mantle') @@ -30,6 +32,17 @@ def main(): download_and_unzip('directxsdk') +def is_updated(version_file, version): + existing_version = '' + try: + with open(version_file, 'r') as f: + existing_version = f.readline().strip() + except IOError as e: + if e.errno != errno.ENOENT: + raise + return existing_version == version + + def download_and_unzip(framework): zip_path = download_framework(framework) if zip_path: From 59293bc938097b1df95dee50d098dd56e36a0561 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 18 May 2014 23:52:14 +0800 Subject: [PATCH 7/7] Only build Debug target in cibuild. --- script/cibuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/cibuild b/script/cibuild index c235ed067d5c..b91df13371ff 100755 --- a/script/cibuild +++ b/script/cibuild @@ -26,7 +26,7 @@ def main(): if sys.platform != 'win32': run_script('pylint.py') run_script('coffeelint.py') - run_script('build.py') + run_script('build.py', ['-c', 'Debug']) run_script('test.py', ['--ci'])