Merge pull request #330 from atom/windows-webgl
Fix WebGL support on Windows
This commit is contained in:
commit
b2abeb9beb
9 changed files with 89 additions and 58 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,7 +1,7 @@
|
||||||
.DS_Store
|
.DS_Store
|
||||||
/build/
|
/build/
|
||||||
/dist/
|
/dist/
|
||||||
/frameworks/
|
/external_binaries/
|
||||||
/out/
|
/out/
|
||||||
/vendor/brightray/vendor/download/
|
/vendor/brightray/vendor/download/
|
||||||
/vendor/python_26/
|
/vendor/python_26/
|
||||||
|
|
17
atom.gyp
17
atom.gyp
|
@ -235,7 +235,7 @@
|
||||||
},
|
},
|
||||||
'target_defaults': {
|
'target_defaults': {
|
||||||
'mac_framework_dirs': [
|
'mac_framework_dirs': [
|
||||||
'<(atom_source_root)/frameworks',
|
'<(atom_source_root)/external_binaries',
|
||||||
],
|
],
|
||||||
'includes': [
|
'includes': [
|
||||||
# Rules for excluding e.g. foo_win.cc from the build on non-Windows.
|
# Rules for excluding e.g. foo_win.cc from the build on non-Windows.
|
||||||
|
@ -288,9 +288,9 @@
|
||||||
'files': [
|
'files': [
|
||||||
'<(PRODUCT_DIR)/<(product_name) Helper.app',
|
'<(PRODUCT_DIR)/<(product_name) Helper.app',
|
||||||
'<(PRODUCT_DIR)/<(framework_name).framework',
|
'<(PRODUCT_DIR)/<(framework_name).framework',
|
||||||
'frameworks/Squirrel.framework',
|
'external_binaries/Squirrel.framework',
|
||||||
'frameworks/ReactiveCocoa.framework',
|
'external_binaries/ReactiveCocoa.framework',
|
||||||
'frameworks/Mantle.framework',
|
'external_binaries/Mantle.framework',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -327,8 +327,11 @@
|
||||||
'<(libchromiumcontent_library_dir)/chromiumcontent.dll',
|
'<(libchromiumcontent_library_dir)/chromiumcontent.dll',
|
||||||
'<(libchromiumcontent_library_dir)/ffmpegsumo.dll',
|
'<(libchromiumcontent_library_dir)/ffmpegsumo.dll',
|
||||||
'<(libchromiumcontent_library_dir)/icudt.dll',
|
'<(libchromiumcontent_library_dir)/icudt.dll',
|
||||||
|
'<(libchromiumcontent_library_dir)/libEGL.dll',
|
||||||
'<(libchromiumcontent_library_dir)/libGLESv2.dll',
|
'<(libchromiumcontent_library_dir)/libGLESv2.dll',
|
||||||
'<(libchromiumcontent_resources_dir)/content_shell.pak',
|
'<(libchromiumcontent_resources_dir)/content_shell.pak',
|
||||||
|
'external_binaries/d3dcompiler_43.dll',
|
||||||
|
'external_binaries/xinput1_3.dll',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -598,9 +601,9 @@
|
||||||
'link_settings': {
|
'link_settings': {
|
||||||
'libraries': [
|
'libraries': [
|
||||||
'$(SDKROOT)/System/Library/Frameworks/Carbon.framework',
|
'$(SDKROOT)/System/Library/Frameworks/Carbon.framework',
|
||||||
'frameworks/Squirrel.framework',
|
'external_binaries/Squirrel.framework',
|
||||||
'frameworks/ReactiveCocoa.framework',
|
'external_binaries/ReactiveCocoa.framework',
|
||||||
'frameworks/Mantle.framework',
|
'external_binaries/Mantle.framework',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
'mac_bundle': 1,
|
'mac_bundle': 1,
|
||||||
|
|
|
@ -16,6 +16,7 @@ def main():
|
||||||
rm_rf(os.path.join(SOURCE_ROOT, 'out'))
|
rm_rf(os.path.join(SOURCE_ROOT, 'out'))
|
||||||
rm_rf(os.path.join(SOURCE_ROOT, 'node_modules'))
|
rm_rf(os.path.join(SOURCE_ROOT, 'node_modules'))
|
||||||
rm_rf(os.path.join(SOURCE_ROOT, 'frameworks'))
|
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', 'apm', 'node_modules'))
|
||||||
rm_rf(os.path.join(SOURCE_ROOT, 'vendor', 'brightray', 'vendor', 'download',
|
rm_rf(os.path.join(SOURCE_ROOT, 'vendor', 'brightray', 'vendor', 'download',
|
||||||
'libchromiumcontent'))
|
'libchromiumcontent'))
|
||||||
|
@ -25,7 +26,7 @@ def main():
|
||||||
if sys.platform != 'win32':
|
if sys.platform != 'win32':
|
||||||
run_script('pylint.py')
|
run_script('pylint.py')
|
||||||
run_script('coffeelint.py')
|
run_script('coffeelint.py')
|
||||||
run_script('build.py')
|
run_script('build.py', ['-c', 'Debug'])
|
||||||
run_script('test.py', ['--ci'])
|
run_script('test.py', ['--ci'])
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,10 @@ TARGET_BINARIES = {
|
||||||
'content_shell.pak',
|
'content_shell.pak',
|
||||||
'ffmpegsumo.dll',
|
'ffmpegsumo.dll',
|
||||||
'icudt.dll',
|
'icudt.dll',
|
||||||
|
'libEGL.dll',
|
||||||
'libGLESv2.dll',
|
'libGLESv2.dll',
|
||||||
|
'd3dcompiler_43.dll',
|
||||||
|
'xinput1_3.dll',
|
||||||
],
|
],
|
||||||
'linux': [
|
'linux': [
|
||||||
'atom',
|
'atom',
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
|
|
||||||
NODE_VERSION = 'v0.11.10'
|
NODE_VERSION = 'v0.11.10'
|
||||||
BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
|
BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
|
||||||
LIBCHROMIUMCONTENT_COMMIT = '276722e68bb643e3ae3b468b701c276aeb884838'
|
LIBCHROMIUMCONTENT_COMMIT = '34d71b3bcc65c5213663a967ee1950c6d3729346'
|
||||||
|
|
63
script/update-external-binaries.py
Executable file
63
script/update-external-binaries.py
Executable file
|
@ -0,0 +1,63 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import errno
|
||||||
|
import sys
|
||||||
|
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/' + VERSION
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
os.chdir(SOURCE_ROOT)
|
||||||
|
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')
|
||||||
|
download_and_unzip('ReactiveCocoa')
|
||||||
|
download_and_unzip('Squirrel')
|
||||||
|
elif sys.platform in ['cygwin', 'win32']:
|
||||||
|
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:
|
||||||
|
extract_zip(zip_path, 'external_binaries')
|
||||||
|
|
||||||
|
|
||||||
|
def download_framework(framework):
|
||||||
|
filename = framework + '.zip'
|
||||||
|
url = FRAMEWORKS_URL + '/' + filename
|
||||||
|
download_dir = tempdir(prefix='atom-shell-')
|
||||||
|
path = os.path.join(download_dir, filename)
|
||||||
|
|
||||||
|
download('Download ' + framework, url, path)
|
||||||
|
return path
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.exit(main())
|
|
@ -1,43 +0,0 @@
|
||||||
#!/usr/bin/env python
|
|
||||||
|
|
||||||
import sys
|
|
||||||
import os
|
|
||||||
|
|
||||||
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'
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
|
||||||
os.chdir(SOURCE_ROOT)
|
|
||||||
safe_mkdir('frameworks')
|
|
||||||
download_and_unzip('Mantle')
|
|
||||||
download_and_unzip('ReactiveCocoa')
|
|
||||||
download_and_unzip('Squirrel')
|
|
||||||
|
|
||||||
|
|
||||||
def download_and_unzip(framework):
|
|
||||||
zip_path = download_framework(framework)
|
|
||||||
if zip_path:
|
|
||||||
extract_zip(zip_path, 'frameworks')
|
|
||||||
|
|
||||||
|
|
||||||
def download_framework(framework):
|
|
||||||
framework_path = os.path.join('frameworks', framework) + '.framework'
|
|
||||||
if os.path.exists(framework_path):
|
|
||||||
return
|
|
||||||
|
|
||||||
filename = framework + '.framework.zip'
|
|
||||||
url = FRAMEWORKS_URL + '/' + filename
|
|
||||||
download_dir = tempdir(prefix='atom-shell-')
|
|
||||||
path = os.path.join(download_dir, filename)
|
|
||||||
|
|
||||||
download('Download ' + framework, url, path)
|
|
||||||
return path
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
sys.exit(main())
|
|
|
@ -11,13 +11,12 @@ SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
||||||
def main():
|
def main():
|
||||||
os.chdir(SOURCE_ROOT)
|
os.chdir(SOURCE_ROOT)
|
||||||
|
|
||||||
update_frameworks()
|
update_external_binaries()
|
||||||
update_gyp()
|
update_gyp()
|
||||||
|
|
||||||
|
|
||||||
def update_frameworks():
|
def update_external_binaries():
|
||||||
if sys.platform == 'darwin':
|
uf = os.path.join('script', 'update-external-binaries.py')
|
||||||
uf = os.path.join('script', 'update-frameworks.py')
|
|
||||||
subprocess.check_call([sys.executable, uf])
|
subprocess.check_call([sys.executable, uf])
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -65,3 +65,8 @@ describe 'chromium feature', ->
|
||||||
it 'does not crash', ->
|
it 'does not crash', ->
|
||||||
RUint8Array = require('remote').getGlobal 'Uint8Array'
|
RUint8Array = require('remote').getGlobal 'Uint8Array'
|
||||||
new RUint8Array
|
new RUint8Array
|
||||||
|
|
||||||
|
describe 'webgl', ->
|
||||||
|
it 'can be get as context in canvas', ->
|
||||||
|
webgl = document.createElement('canvas').getContext 'webgl'
|
||||||
|
assert.notEqual webgl, null
|
||||||
|
|
Loading…
Reference in a new issue