electron/script/update.py

42 lines
1 KiB
Python
Raw Normal View History

2013-06-24 07:24:30 +00:00
#!/usr/bin/env python
import os
2013-06-24 07:24:30 +00:00
import subprocess
import sys
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
2013-06-24 07:24:30 +00:00
def main():
os.chdir(SOURCE_ROOT)
2013-08-03 08:16:32 +00:00
update_frameworks()
2013-06-24 07:24:30 +00:00
update_gyp()
2013-08-03 08:16:32 +00:00
def update_frameworks():
2013-08-06 12:44:18 +00:00
if sys.platform == 'darwin':
uf = os.path.join('script', 'update-frameworks.py')
2013-06-28 08:12:40 +00:00
subprocess.check_call([sys.executable, uf])
2013-06-24 07:24:30 +00:00
def update_gyp():
2013-12-25 10:47:19 +00:00
gyp = os.path.join('vendor', 'brightray', 'vendor', 'gyp', 'gyp_main.py')
python = sys.executable
2013-08-06 12:44:18 +00:00
if sys.platform == 'cygwin':
python = os.path.join('vendor', 'python_26', 'python.exe')
arch = 'ia32'
if sys.platform == 'darwin':
arch = 'x64'
subprocess.call([python, gyp,
'-f', 'ninja', '--depth', '.', 'atom.gyp',
'-Icommon.gypi', '-Ivendor/brightray/brightray.gypi',
2013-12-31 11:27:31 +00:00
'-Dlinux_clang=0', # Disable brightray's clang setting
'-Dtarget_arch={0}'.format(arch),
'-Dlibrary=static_library'])
2013-06-24 07:24:30 +00:00
if __name__ == '__main__':
sys.exit(main())