2013-06-24 07:24:30 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
2013-09-27 02:21:27 +00:00
|
|
|
import os
|
2013-06-24 07:24:30 +00:00
|
|
|
import subprocess
|
|
|
|
import sys
|
|
|
|
|
2014-08-03 15:13:04 +00:00
|
|
|
from lib.config import DIST_ARCH
|
|
|
|
|
2013-06-24 07:24:30 +00:00
|
|
|
|
2013-07-01 07:49:52 +00:00
|
|
|
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)
|
|
|
|
|
2014-05-18 15:35:07 +00:00
|
|
|
update_external_binaries()
|
2013-06-24 07:24:30 +00:00
|
|
|
update_gyp()
|
|
|
|
|
|
|
|
|
2014-05-18 15:35:07 +00:00
|
|
|
def update_external_binaries():
|
|
|
|
uf = os.path.join('script', 'update-external-binaries.py')
|
2014-05-18 15:03:46 +00:00
|
|
|
subprocess.check_call([sys.executable, uf])
|
2013-06-28 08:12:40 +00:00
|
|
|
|
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')
|
2013-07-01 07:49:52 +00:00
|
|
|
python = sys.executable
|
2014-08-03 15:13:04 +00:00
|
|
|
arch = DIST_ARCH
|
|
|
|
if sys.platform == 'darwin':
|
|
|
|
# Only have 64bit build on OS X.
|
2014-07-31 18:58:45 +00:00
|
|
|
arch = 'x64'
|
|
|
|
elif sys.platform in ['cygwin', 'win32']:
|
2014-08-03 15:13:04 +00:00
|
|
|
# Only have 32bit build on Windows.
|
|
|
|
arch = 'ia32'
|
|
|
|
if sys.platform == 'cygwin':
|
|
|
|
# Force using win32 python on cygwin.
|
|
|
|
python = os.path.join('vendor', 'python_26', 'python.exe')
|
2014-08-08 15:23:56 +00:00
|
|
|
|
|
|
|
ret = subprocess.call([python, gyp,
|
|
|
|
'-f', 'ninja', '--depth', '.', 'atom.gyp',
|
|
|
|
'-Icommon.gypi', '-Ivendor/brightray/brightray.gypi',
|
|
|
|
'-Dlinux_clang=0', # Disable brightray's clang setting
|
|
|
|
'-Dtarget_arch={0}'.format(arch),
|
|
|
|
'-Dlibrary=static_library'])
|
|
|
|
if ret != 0:
|
|
|
|
sys.exit(ret)
|
2013-06-24 07:24:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
sys.exit(main())
|