зеркало из https://github.com/electron/electron.git
Wire up build for new brightray location
This commit is contained in:
Родитель
4dab62dfcf
Коммит
5ea20b5b54
|
@ -5,7 +5,7 @@
|
|||
/dist/
|
||||
/external_binaries/
|
||||
/out/
|
||||
/vendor/brightray/vendor/download/
|
||||
/vendor/download/
|
||||
/vendor/debian_wheezy_amd64-sysroot/
|
||||
/vendor/debian_wheezy_arm-sysroot/
|
||||
/vendor/debian_wheezy_i386-sysroot/
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
'direct_dependent_settings': {
|
||||
'include_dirs': [
|
||||
'.',
|
||||
'..',
|
||||
'../vendor',
|
||||
'<(libchromiumcontent_src_dir)',
|
||||
'<(libchromiumcontent_src_dir)/gpu',
|
||||
'<(libchromiumcontent_src_dir)/skia/config',
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
'includes': [
|
||||
'vendor/download/libchromiumcontent/filenames.gypi',
|
||||
'../vendor/download/libchromiumcontent/filenames.gypi',
|
||||
],
|
||||
'variables': {
|
||||
'libchromiumcontent_component%': 1,
|
||||
|
|
|
@ -1,99 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import argparse
|
||||
import errno
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
|
||||
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
||||
VENDOR_DIR = os.path.join(SOURCE_ROOT, 'vendor')
|
||||
DOWNLOAD_DIR = os.path.join(VENDOR_DIR, 'download')
|
||||
|
||||
|
||||
def main():
|
||||
args = parse_args()
|
||||
if (args.libcc_source_path != None and
|
||||
args.libcc_shared_library_path != None and
|
||||
args.libcc_static_library_path != None):
|
||||
pass
|
||||
elif (args.libcc_source_path != None or
|
||||
args.libcc_shared_library_path != None or
|
||||
args.libcc_static_library_path != None):
|
||||
print "Error: All options of libchromiumcontent are required OR let " \
|
||||
"brightray choose it"
|
||||
sys.exit(0)
|
||||
update_submodules()
|
||||
setup_libchromiumcontent(args.dev, args.commit, args.target_arch, args.url,
|
||||
args.libcc_source_path,
|
||||
args.libcc_shared_library_path,
|
||||
args.libcc_static_library_path)
|
||||
|
||||
|
||||
def parse_args():
|
||||
parser = argparse.ArgumentParser(description='Bootstrap this project')
|
||||
parser.add_argument('-c', '--commit', required=True,
|
||||
help='The commit of libchromiumcontent to download.')
|
||||
parser.add_argument('-d', '--dev', action='store_true',
|
||||
help='Do not download static_library build')
|
||||
parser.add_argument('--target_arch', required=True,
|
||||
help='The arch of libchromiumcontent to download.')
|
||||
parser.add_argument('url', help='The base URL from which to download '
|
||||
'libchromiumcontent (i.e., the URL you passed to '
|
||||
'libchromiumcontent\'s script/upload script')
|
||||
parser.add_argument('--libcc_source_path', required=False,
|
||||
help='The source path of libchromiumcontent. ' \
|
||||
'NOTE: All options of libchromiumcontent are '
|
||||
'required OR let brightray choose it')
|
||||
parser.add_argument('--libcc_shared_library_path', required=False,
|
||||
help='The shared library path of libchromiumcontent. ' \
|
||||
'NOTE: All options of libchromiumcontent are ' \
|
||||
'required OR let brightray choose it')
|
||||
parser.add_argument('--libcc_static_library_path', required=False,
|
||||
help='The static library path of libchromiumcontent. ' \
|
||||
'NOTE: All options of libchromiumcontent are ' \
|
||||
'required OR let brightray choose it')
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def update_submodules():
|
||||
return (subprocess.call(['git', 'submodule', 'sync', '--quiet'],
|
||||
cwd=SOURCE_ROOT) or
|
||||
subprocess.call(['git', 'submodule', 'update', '--init',
|
||||
'--recursive'], cwd=SOURCE_ROOT))
|
||||
|
||||
|
||||
def setup_libchromiumcontent(is_dev, commit, target_arch, url,
|
||||
libcc_source_path,
|
||||
libcc_shared_library_path,
|
||||
libcc_static_library_path):
|
||||
target_dir = os.path.join(DOWNLOAD_DIR, 'libchromiumcontent')
|
||||
download = os.path.join(VENDOR_DIR, 'libchromiumcontent', 'script',
|
||||
'download')
|
||||
args = ['-f', '-c', commit, '--target_arch', target_arch, url, target_dir]
|
||||
if (libcc_source_path != None and
|
||||
libcc_shared_library_path != None and
|
||||
libcc_static_library_path != None):
|
||||
args += ['--libcc_source_path', libcc_source_path,
|
||||
'--libcc_shared_library_path', libcc_shared_library_path,
|
||||
'--libcc_static_library_path', libcc_static_library_path]
|
||||
mkdir_p(target_dir)
|
||||
else:
|
||||
mkdir_p(DOWNLOAD_DIR)
|
||||
if is_dev:
|
||||
subprocess.check_call([sys.executable, download] + args)
|
||||
else:
|
||||
subprocess.check_call([sys.executable, download, '-s'] + args)
|
||||
|
||||
|
||||
def mkdir_p(path):
|
||||
try:
|
||||
os.makedirs(path)
|
||||
except OSError as e:
|
||||
if e.errno != errno.EEXIST:
|
||||
raise
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main())
|
|
@ -1,40 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
|
||||
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
||||
GYP = os.path.join(SOURCE_ROOT, 'vendor', 'gyp', 'gyp_main.py')
|
||||
|
||||
|
||||
def main():
|
||||
os.chdir(SOURCE_ROOT)
|
||||
return (run_gyp() or build())
|
||||
|
||||
|
||||
def run_gyp():
|
||||
env = os.environ.copy()
|
||||
gyp_pylib = os.path.join(os.path.dirname(GYP), 'pylib')
|
||||
env['PYTHONPATH'] = os.path.pathsep.join([gyp_pylib,
|
||||
env.get('PYTHONPATH', '')])
|
||||
env['GYP_DEFINES'] = 'libchromiumcontent_component=static_library'
|
||||
return subprocess.call([sys.executable, GYP, '--depth', '.',
|
||||
'-Ibrightray.gypi', 'brightray.gyp'], env=env)
|
||||
|
||||
|
||||
def build():
|
||||
if sys.platform == 'darwin':
|
||||
return subprocess.call(['xcodebuild'])
|
||||
if sys.platform == 'linux2':
|
||||
return subprocess.call(['make'])
|
||||
|
||||
assert sys.platform == 'win32', sys.platform
|
||||
program_files = os.environ.get('PROGRAMFILES(X86)', os.environ['PROGRAMFILES'])
|
||||
msbuild = os.path.join(program_files, 'MSBuild', '12.0', 'Bin', 'MSBuild.exe')
|
||||
return subprocess.call([msbuild, 'brightray.sln'])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main())
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
'includes': [
|
||||
'toolchain.gypi',
|
||||
'vendor/brightray/brightray.gypi',
|
||||
'brightray/brightray.gypi',
|
||||
],
|
||||
'variables': {
|
||||
# Tell crashpad to build as external project.
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
# is marked for no PIE (ASLR).
|
||||
'postbuild_name': 'Make More Helpers',
|
||||
'action': [
|
||||
'vendor/brightray/tools/mac/make_more_helpers.sh',
|
||||
'brightray/tools/mac/make_more_helpers.sh',
|
||||
'Frameworks',
|
||||
'<(product_name)',
|
||||
],
|
||||
|
@ -220,7 +220,7 @@
|
|||
'dependencies': [
|
||||
'atom_js2c',
|
||||
'vendor/pdf_viewer/pdf_viewer.gyp:pdf_viewer',
|
||||
'vendor/brightray/brightray.gyp:brightray',
|
||||
'brightray/brightray.gyp:brightray',
|
||||
'vendor/node/node.gyp:node',
|
||||
],
|
||||
'defines': [
|
||||
|
@ -244,7 +244,7 @@
|
|||
'include_dirs': [
|
||||
'.',
|
||||
'chromium_src',
|
||||
'vendor/brightray',
|
||||
'brightray',
|
||||
'vendor/native_mate',
|
||||
# Include atom_natives.h.
|
||||
'<(SHARED_INTERMEDIATE_DIR)',
|
||||
|
@ -271,7 +271,7 @@
|
|||
],
|
||||
},
|
||||
'export_dependent_settings': [
|
||||
'vendor/brightray/brightray.gyp:brightray',
|
||||
'brightray/brightray.gyp:brightray',
|
||||
],
|
||||
'conditions': [
|
||||
['libchromiumcontent_component', {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import argparse
|
||||
import errno
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
@ -12,6 +13,7 @@ from lib.util import execute_stdout, get_electron_version, scoped_cwd
|
|||
|
||||
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
||||
VENDOR_DIR = os.path.join(SOURCE_ROOT, 'vendor')
|
||||
DOWNLOAD_DIR = os.path.join(VENDOR_DIR, 'download')
|
||||
PYTHON_26_URL = 'https://chromium.googlesource.com/chromium/deps/python_26'
|
||||
|
||||
NPM = 'npm'
|
||||
|
@ -40,8 +42,7 @@ def main():
|
|||
# Redirect to use local libchromiumcontent build.
|
||||
if args.build_libchromiumcontent:
|
||||
build_libchromiumcontent(args.verbose, args.target_arch, defines)
|
||||
dist_dir = os.path.join(SOURCE_ROOT, 'vendor', 'brightray', 'vendor',
|
||||
'libchromiumcontent', 'dist', 'main')
|
||||
dist_dir = os.path.join(VENDOR_DIR, 'libchromiumcontent', 'dist', 'main')
|
||||
libcc_source_path = os.path.join(dist_dir, 'src')
|
||||
libcc_shared_library_path = os.path.join(dist_dir, 'shared_library')
|
||||
libcc_static_library_path = os.path.join(dist_dir, 'static_library')
|
||||
|
@ -53,9 +54,9 @@ def main():
|
|||
|
||||
setup_python_libs()
|
||||
update_node_modules('.')
|
||||
bootstrap_brightray(args.dev, args.url, args.target_arch,
|
||||
libcc_source_path, libcc_shared_library_path,
|
||||
libcc_static_library_path)
|
||||
setup_libchromiumcontent(args.dev, args.target_arch, args.url,
|
||||
libcc_source_path, libcc_shared_library_path,
|
||||
libcc_static_library_path)
|
||||
|
||||
if PLATFORM == 'linux':
|
||||
download_sysroot(args.target_arch)
|
||||
|
@ -135,10 +136,33 @@ def setup_python_libs():
|
|||
execute_stdout([sys.executable, 'setup.py', 'build'])
|
||||
|
||||
|
||||
def setup_libchromiumcontent(is_dev, target_arch, url,
|
||||
libcc_source_path,
|
||||
libcc_shared_library_path,
|
||||
libcc_static_library_path):
|
||||
target_dir = os.path.join(DOWNLOAD_DIR, 'libchromiumcontent')
|
||||
download = os.path.join(VENDOR_DIR, 'libchromiumcontent', 'script',
|
||||
'download')
|
||||
args = ['-f', '-c', LIBCHROMIUMCONTENT_COMMIT, '--target_arch', target_arch,
|
||||
url, target_dir]
|
||||
if (libcc_source_path != None and
|
||||
libcc_shared_library_path != None and
|
||||
libcc_static_library_path != None):
|
||||
args += ['--libcc_source_path', libcc_source_path,
|
||||
'--libcc_shared_library_path', libcc_shared_library_path,
|
||||
'--libcc_static_library_path', libcc_static_library_path]
|
||||
mkdir_p(target_dir)
|
||||
else:
|
||||
mkdir_p(DOWNLOAD_DIR)
|
||||
if is_dev:
|
||||
subprocess.check_call([sys.executable, download] + args)
|
||||
else:
|
||||
subprocess.check_call([sys.executable, download, '-s'] + args)
|
||||
|
||||
def bootstrap_brightray(is_dev, url, target_arch, libcc_source_path,
|
||||
libcc_shared_library_path,
|
||||
libcc_static_library_path):
|
||||
bootstrap = os.path.join(VENDOR_DIR, 'brightray', 'script', 'bootstrap')
|
||||
bootstrap = os.path.join(SOURCE_ROOT, 'brightray', 'script', 'bootstrap')
|
||||
args = [
|
||||
'--commit', LIBCHROMIUMCONTENT_COMMIT,
|
||||
'--target_arch', target_arch,
|
||||
|
@ -225,8 +249,7 @@ def download_sysroot(target_arch):
|
|||
'--arch', target_arch])
|
||||
|
||||
def create_chrome_version_h():
|
||||
version_file = os.path.join(SOURCE_ROOT, 'vendor', 'brightray', 'vendor',
|
||||
'libchromiumcontent', 'VERSION')
|
||||
version_file = os.path.join(VENDOR_DIR, 'libchromiumcontent', 'VERSION')
|
||||
target_file = os.path.join(SOURCE_ROOT, 'atom', 'common', 'chrome_version.h')
|
||||
template_file = os.path.join(SOURCE_ROOT, 'script', 'chrome_version.h.in')
|
||||
|
||||
|
@ -271,5 +294,13 @@ def create_node_headers():
|
|||
'--version', get_electron_version()])
|
||||
|
||||
|
||||
def mkdir_p(path):
|
||||
try:
|
||||
os.makedirs(path)
|
||||
except OSError as e:
|
||||
if e.errno != errno.EEXIST:
|
||||
raise
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main())
|
||||
|
|
|
@ -22,8 +22,8 @@ def main():
|
|||
remove_directory('node_modules')
|
||||
remove_directory('spec/node_modules')
|
||||
|
||||
remove_directory('vendor/brightray/vendor/download/libchromiumcontent')
|
||||
remove_directory('vendor/brightray/vendor/libchromiumcontent/src')
|
||||
remove_directory('vendor/download/libchromiumcontent')
|
||||
remove_directory('vendor/libchromiumcontent/src')
|
||||
|
||||
remove_directory(os.path.expanduser('~/.node-gyp'))
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ def run_gyp(target_arch, component):
|
|||
if sys.platform == 'cygwin':
|
||||
# Force using win32 python on cygwin.
|
||||
python = os.path.join('vendor', 'python_26', 'python.exe')
|
||||
gyp = os.path.join('vendor', 'brightray', 'vendor', 'gyp', 'gyp_main.py')
|
||||
gyp = os.path.join('vendor', 'gyp', 'gyp_main.py')
|
||||
gyp_pylib = os.path.join(os.path.dirname(gyp), 'pylib')
|
||||
# Avoid using the old gyp lib in system.
|
||||
env['PYTHONPATH'] = os.path.pathsep.join([gyp_pylib,
|
||||
|
|
Загрузка…
Ссылка в новой задаче