Use Chromium V8's headers in the node headers tarball.
This commit is contained in:
parent
790c53825b
commit
2cbe823773
1 changed files with 19 additions and 7 deletions
|
@ -27,7 +27,6 @@ HEADERS_SUFFIX = [
|
||||||
HEADERS_DIRS = [
|
HEADERS_DIRS = [
|
||||||
'src',
|
'src',
|
||||||
'deps/http_parser',
|
'deps/http_parser',
|
||||||
'deps/v8',
|
|
||||||
'deps/zlib',
|
'deps/zlib',
|
||||||
'deps/uv',
|
'deps/uv',
|
||||||
]
|
]
|
||||||
|
@ -62,6 +61,7 @@ def copy_binaries():
|
||||||
|
|
||||||
def copy_headers():
|
def copy_headers():
|
||||||
os.mkdir(DIST_HEADERS_DIR)
|
os.mkdir(DIST_HEADERS_DIR)
|
||||||
|
# Copy standard node headers from node. repository.
|
||||||
for include_path in HEADERS_DIRS:
|
for include_path in HEADERS_DIRS:
|
||||||
abs_path = os.path.join(NODE_DIR, include_path)
|
abs_path = os.path.join(NODE_DIR, include_path)
|
||||||
for dirpath, dirnames, filenames in os.walk(abs_path):
|
for dirpath, dirnames, filenames in os.walk(abs_path):
|
||||||
|
@ -71,7 +71,19 @@ def copy_headers():
|
||||||
continue
|
continue
|
||||||
copy_source_file(os.path.join(dirpath, filename))
|
copy_source_file(os.path.join(dirpath, filename))
|
||||||
for other_file in HEADERS_FILES:
|
for other_file in HEADERS_FILES:
|
||||||
copy_source_file(os.path.join(NODE_DIR, other_file))
|
copy_source_file(source = os.path.join(NODE_DIR, other_file))
|
||||||
|
|
||||||
|
# Copy V8 headers from chromium's repository.
|
||||||
|
src = os.path.join(SOURCE_ROOT, 'vendor', 'brightray', 'vendor', 'download',
|
||||||
|
'libchromiumcontent', 'src')
|
||||||
|
for dirpath, dirnames, filenames in os.walk(os.path.join(src, 'v8')):
|
||||||
|
for filename in filenames:
|
||||||
|
extension = os.path.splitext(filename)[1]
|
||||||
|
if extension not in HEADERS_SUFFIX:
|
||||||
|
continue
|
||||||
|
copy_source_file(source=os.path.join(dirpath, filename),
|
||||||
|
start=src,
|
||||||
|
destination=os.path.join(DIST_HEADERS_DIR, 'deps'))
|
||||||
|
|
||||||
|
|
||||||
def copy_license():
|
def copy_license():
|
||||||
|
@ -102,11 +114,11 @@ def create_header_tarball():
|
||||||
tarball.close()
|
tarball.close()
|
||||||
|
|
||||||
|
|
||||||
def copy_source_file(source):
|
def copy_source_file(source, start=NODE_DIR, destination=DIST_HEADERS_DIR):
|
||||||
relative = os.path.relpath(source, start=NODE_DIR)
|
relative = os.path.relpath(source, start=start)
|
||||||
destination = os.path.join(DIST_HEADERS_DIR, relative)
|
final_destination = os.path.join(destination, relative)
|
||||||
safe_mkdir(os.path.dirname(destination))
|
safe_mkdir(os.path.dirname(final_destination))
|
||||||
shutil.copy2(source, destination)
|
shutil.copy2(source, final_destination)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Reference in a new issue