2012-08-01 23:06:31 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
2018-12-03 11:28:31 +00:00
|
|
|
from __future__ import print_function
|
2019-04-13 22:09:45 +00:00
|
|
|
|
2018-04-30 12:08:28 +00:00
|
|
|
import ast
|
2012-08-01 23:06:31 +00:00
|
|
|
import errno
|
|
|
|
import os
|
|
|
|
import shutil
|
|
|
|
import sys
|
|
|
|
|
|
|
|
# set at init time
|
2013-04-23 18:17:09 +00:00
|
|
|
node_prefix = '/usr/local' # PREFIX variable from Makefile
|
2019-04-13 22:09:45 +00:00
|
|
|
install_path = '' # base target directory (DESTDIR + PREFIX from Makefile)
|
2012-08-01 23:06:31 +00:00
|
|
|
target_defaults = None
|
|
|
|
variables = None
|
|
|
|
|
|
|
|
def abspath(*args):
|
|
|
|
path = os.path.join(*args)
|
|
|
|
return os.path.abspath(path)
|
|
|
|
|
|
|
|
def load_config():
|
2020-12-25 13:05:28 +00:00
|
|
|
with open('config.gypi') as f:
|
|
|
|
return ast.literal_eval(f.read())
|
2012-08-01 23:06:31 +00:00
|
|
|
|
|
|
|
def try_unlink(path):
|
|
|
|
try:
|
|
|
|
os.unlink(path)
|
2018-12-03 11:28:31 +00:00
|
|
|
except OSError as e:
|
2012-08-01 23:06:31 +00:00
|
|
|
if e.errno != errno.ENOENT: raise
|
|
|
|
|
|
|
|
def try_symlink(source_path, link_path):
|
2018-12-03 11:28:31 +00:00
|
|
|
print('symlinking %s -> %s' % (source_path, link_path))
|
2012-08-01 23:06:31 +00:00
|
|
|
try_unlink(link_path)
|
2017-10-24 11:01:50 +00:00
|
|
|
try_mkdir_r(os.path.dirname(link_path))
|
2012-08-01 23:06:31 +00:00
|
|
|
os.symlink(source_path, link_path)
|
|
|
|
|
|
|
|
def try_mkdir_r(path):
|
|
|
|
try:
|
|
|
|
os.makedirs(path)
|
2018-12-03 11:28:31 +00:00
|
|
|
except OSError as e:
|
2012-08-01 23:06:31 +00:00
|
|
|
if e.errno != errno.EEXIST: raise
|
|
|
|
|
|
|
|
def try_rmdir_r(path):
|
|
|
|
path = abspath(path)
|
2013-04-23 18:17:09 +00:00
|
|
|
while path.startswith(install_path):
|
2012-08-01 23:06:31 +00:00
|
|
|
try:
|
|
|
|
os.rmdir(path)
|
2018-12-03 11:28:31 +00:00
|
|
|
except OSError as e:
|
2012-08-01 23:06:31 +00:00
|
|
|
if e.errno == errno.ENOTEMPTY: return
|
|
|
|
if e.errno == errno.ENOENT: return
|
|
|
|
raise
|
|
|
|
path = abspath(path, '..')
|
|
|
|
|
|
|
|
def mkpaths(path, dst):
|
|
|
|
if dst.endswith('/'):
|
2013-04-23 18:17:09 +00:00
|
|
|
target_path = abspath(install_path, dst, os.path.basename(path))
|
2012-08-01 23:06:31 +00:00
|
|
|
else:
|
2013-04-23 18:17:09 +00:00
|
|
|
target_path = abspath(install_path, dst)
|
2012-08-01 23:06:31 +00:00
|
|
|
return path, target_path
|
|
|
|
|
|
|
|
def try_copy(path, dst):
|
|
|
|
source_path, target_path = mkpaths(path, dst)
|
2018-12-03 11:28:31 +00:00
|
|
|
print('installing %s' % target_path)
|
2012-08-01 23:06:31 +00:00
|
|
|
try_mkdir_r(os.path.dirname(target_path))
|
2012-08-04 00:41:32 +00:00
|
|
|
try_unlink(target_path) # prevent ETXTBSY errors
|
2012-08-01 23:06:31 +00:00
|
|
|
return shutil.copy2(source_path, target_path)
|
|
|
|
|
|
|
|
def try_remove(path, dst):
|
|
|
|
source_path, target_path = mkpaths(path, dst)
|
2018-12-03 11:28:31 +00:00
|
|
|
print('removing %s' % target_path)
|
2012-08-01 23:06:31 +00:00
|
|
|
try_unlink(target_path)
|
|
|
|
try_rmdir_r(os.path.dirname(target_path))
|
|
|
|
|
2019-01-19 10:07:54 +00:00
|
|
|
def install(paths, dst):
|
|
|
|
for path in paths:
|
|
|
|
try_copy(path, dst)
|
|
|
|
|
|
|
|
def uninstall(paths, dst):
|
|
|
|
for path in paths:
|
|
|
|
try_remove(path, dst)
|
2012-08-01 23:06:31 +00:00
|
|
|
|
2020-09-28 15:35:09 +00:00
|
|
|
def package_files(action, name, bins):
|
|
|
|
target_path = 'lib/node_modules/' + name + '/'
|
2012-08-01 23:06:31 +00:00
|
|
|
|
|
|
|
# don't install npm if the target path is a symlink, it probably means
|
|
|
|
# that a dev version of npm is installed there
|
2013-04-23 18:17:09 +00:00
|
|
|
if os.path.islink(abspath(install_path, target_path)): return
|
2012-08-01 23:06:31 +00:00
|
|
|
|
|
|
|
# npm has a *lot* of files and it'd be a pain to maintain a fixed list here
|
|
|
|
# so we walk its source directory instead...
|
2020-09-28 15:35:09 +00:00
|
|
|
root = 'deps/' + name
|
|
|
|
for dirname, subdirs, basenames in os.walk(root, topdown=True):
|
2019-01-19 10:07:54 +00:00
|
|
|
subdirs[:] = [subdir for subdir in subdirs if subdir != 'test']
|
2012-08-01 23:06:31 +00:00
|
|
|
paths = [os.path.join(dirname, basename) for basename in basenames]
|
2020-09-28 15:35:09 +00:00
|
|
|
action(paths, target_path + dirname[len(root) + 1:] + '/')
|
|
|
|
|
|
|
|
# create/remove symlinks
|
|
|
|
for bin_name, bin_target in bins.items():
|
|
|
|
link_path = abspath(install_path, 'bin/' + bin_name)
|
|
|
|
if action == uninstall:
|
|
|
|
action([link_path], 'bin/' + bin_name)
|
|
|
|
elif action == install:
|
|
|
|
try_symlink('../lib/node_modules/' + name + '/' + bin_target, link_path)
|
|
|
|
else:
|
|
|
|
assert 0 # unhandled action type
|
|
|
|
|
|
|
|
def npm_files(action):
|
|
|
|
package_files(action, 'npm', {
|
|
|
|
'npm': 'bin/npm-cli.js',
|
|
|
|
'npx': 'bin/npx-cli.js',
|
|
|
|
})
|
|
|
|
|
|
|
|
def corepack_files(action):
|
|
|
|
package_files(action, 'corepack', {
|
|
|
|
'corepack': 'dist/corepack.js',
|
|
|
|
# Not the default just yet:
|
|
|
|
# 'yarn': 'dist/yarn.js',
|
|
|
|
# 'yarnpkg': 'dist/yarn.js',
|
|
|
|
# 'pnpm': 'dist/pnpm.js',
|
|
|
|
# 'pnpx': 'dist/pnpx.js',
|
|
|
|
})
|
2017-07-11 01:53:58 +00:00
|
|
|
|
2013-10-10 21:42:41 +00:00
|
|
|
def subdir_files(path, dest, action):
|
|
|
|
ret = {}
|
|
|
|
for dirpath, dirnames, filenames in os.walk(path):
|
2019-04-13 22:09:45 +00:00
|
|
|
files_in_path = [dirpath + '/' + f for f in filenames if f.endswith('.h')]
|
|
|
|
ret[dest + dirpath.replace(path, '')] = files_in_path
|
|
|
|
for subdir, files_in_path in ret.items():
|
|
|
|
action(files_in_path, subdir + '/')
|
2013-10-10 21:42:41 +00:00
|
|
|
|
2012-08-01 23:06:31 +00:00
|
|
|
def files(action):
|
2015-01-08 13:21:26 +00:00
|
|
|
is_windows = sys.platform == 'win32'
|
2016-03-27 00:17:55 +00:00
|
|
|
output_file = 'node'
|
|
|
|
output_prefix = 'out/Release/'
|
2015-01-08 13:21:26 +00:00
|
|
|
|
2016-03-27 00:17:55 +00:00
|
|
|
if 'false' == variables.get('node_shared'):
|
|
|
|
if is_windows:
|
|
|
|
output_file += '.exe'
|
|
|
|
else:
|
|
|
|
if is_windows:
|
|
|
|
output_file += '.dll'
|
|
|
|
else:
|
2016-07-12 18:04:29 +00:00
|
|
|
output_file = 'lib' + output_file + '.' + variables.get('shlib_suffix')
|
2016-03-27 00:17:55 +00:00
|
|
|
|
2017-09-02 12:30:14 +00:00
|
|
|
if 'false' == variables.get('node_shared'):
|
|
|
|
action([output_prefix + output_file], 'bin/' + output_file)
|
|
|
|
else:
|
|
|
|
action([output_prefix + output_file], 'lib/' + output_file)
|
2012-08-01 23:06:31 +00:00
|
|
|
|
2014-02-20 21:03:03 +00:00
|
|
|
if 'true' == variables.get('node_use_dtrace'):
|
|
|
|
action(['out/Release/node.d'], 'lib/dtrace/node.d')
|
2012-08-01 23:06:31 +00:00
|
|
|
|
2013-03-31 03:56:39 +00:00
|
|
|
# behave similarly for systemtap
|
|
|
|
action(['src/node.stp'], 'share/systemtap/tapset/')
|
|
|
|
|
2015-07-06 16:41:04 +00:00
|
|
|
action(['deps/v8/tools/gdbinit'], 'share/doc/node/')
|
2017-03-27 07:37:42 +00:00
|
|
|
action(['deps/v8/tools/lldb_commands.py'], 'share/doc/node/')
|
2015-07-06 16:41:04 +00:00
|
|
|
|
2012-12-17 11:05:14 +00:00
|
|
|
if 'freebsd' in sys.platform or 'openbsd' in sys.platform:
|
2015-08-13 16:14:34 +00:00
|
|
|
action(['doc/node.1'], 'man/man1/')
|
2012-12-02 01:54:14 +00:00
|
|
|
else:
|
2015-08-13 16:14:34 +00:00
|
|
|
action(['doc/node.1'], 'share/man/man1/')
|
2012-12-02 01:54:14 +00:00
|
|
|
|
2020-09-28 15:35:09 +00:00
|
|
|
if 'true' == variables.get('node_install_npm'):
|
|
|
|
npm_files(action)
|
2021-12-05 10:23:25 +00:00
|
|
|
|
|
|
|
if 'true' == variables.get('node_install_corepack'):
|
2020-09-28 15:35:09 +00:00
|
|
|
corepack_files(action)
|
2012-08-01 23:06:31 +00:00
|
|
|
|
2015-06-14 10:23:43 +00:00
|
|
|
headers(action)
|
|
|
|
|
|
|
|
def headers(action):
|
build: include minimal V8 headers in distribution
Because Node.js currently distributes all V8 headers, it is not clear
which ones are part of our API and ABI compatibility contract. V8 may
add, remove, or change headers at any time, preventing us sometimes
from updating because the change could affect addons which may depend
on them. Moreover, the `cppgc` library, included in V8, is exposed
even though it is still in active development and doesn't have a
stable API.
Node.js should choose exactly which headers are exposed and part of
our native API, so that it's easier to reason about changes during V8
updates and to prevent us from automatically increasing the API
surface when new headers are added by V8.
Instead of specifically excluding v8-inspector, only include `v8.h`,
`v8-platform.h` (used in `node.h`) and `v8-profiler.h`.
PR-URL: https://github.com/nodejs/node/pull/37570
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: Mary Marchini <oss@mmarchini.me>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2021-03-02 13:44:49 +00:00
|
|
|
def wanted_v8_headers(files_arg, dest):
|
|
|
|
v8_headers = [
|
|
|
|
'deps/v8/include/cppgc/common.h',
|
2021-07-06 14:09:25 +00:00
|
|
|
'deps/v8/include/libplatform/libplatform.h',
|
|
|
|
'deps/v8/include/libplatform/libplatform-export.h',
|
|
|
|
'deps/v8/include/libplatform/v8-tracing.h',
|
build: include minimal V8 headers in distribution
Because Node.js currently distributes all V8 headers, it is not clear
which ones are part of our API and ABI compatibility contract. V8 may
add, remove, or change headers at any time, preventing us sometimes
from updating because the change could affect addons which may depend
on them. Moreover, the `cppgc` library, included in V8, is exposed
even though it is still in active development and doesn't have a
stable API.
Node.js should choose exactly which headers are exposed and part of
our native API, so that it's easier to reason about changes during V8
updates and to prevent us from automatically increasing the API
surface when new headers are added by V8.
Instead of specifically excluding v8-inspector, only include `v8.h`,
`v8-platform.h` (used in `node.h`) and `v8-profiler.h`.
PR-URL: https://github.com/nodejs/node/pull/37570
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: Mary Marchini <oss@mmarchini.me>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2021-03-02 13:44:49 +00:00
|
|
|
'deps/v8/include/v8.h',
|
2021-10-12 07:01:47 +00:00
|
|
|
'deps/v8/include/v8-array-buffer.h',
|
2021-10-19 20:50:35 +00:00
|
|
|
'deps/v8/include/v8-callbacks.h',
|
2021-10-12 07:01:47 +00:00
|
|
|
'deps/v8/include/v8-container.h',
|
|
|
|
'deps/v8/include/v8-context.h',
|
|
|
|
'deps/v8/include/v8-data.h',
|
|
|
|
'deps/v8/include/v8-date.h',
|
|
|
|
'deps/v8/include/v8-debug.h',
|
2021-10-19 20:50:35 +00:00
|
|
|
'deps/v8/include/v8-embedder-heap.h',
|
2021-10-12 07:01:47 +00:00
|
|
|
'deps/v8/include/v8-exception.h',
|
|
|
|
'deps/v8/include/v8-extension.h',
|
|
|
|
'deps/v8/include/v8-external.h',
|
2021-10-19 20:50:35 +00:00
|
|
|
'deps/v8/include/v8-forward.h',
|
|
|
|
'deps/v8/include/v8-function-callback.h',
|
2021-10-12 07:01:47 +00:00
|
|
|
'deps/v8/include/v8-function.h',
|
|
|
|
'deps/v8/include/v8-initialization.h',
|
build: include minimal V8 headers in distribution
Because Node.js currently distributes all V8 headers, it is not clear
which ones are part of our API and ABI compatibility contract. V8 may
add, remove, or change headers at any time, preventing us sometimes
from updating because the change could affect addons which may depend
on them. Moreover, the `cppgc` library, included in V8, is exposed
even though it is still in active development and doesn't have a
stable API.
Node.js should choose exactly which headers are exposed and part of
our native API, so that it's easier to reason about changes during V8
updates and to prevent us from automatically increasing the API
surface when new headers are added by V8.
Instead of specifically excluding v8-inspector, only include `v8.h`,
`v8-platform.h` (used in `node.h`) and `v8-profiler.h`.
PR-URL: https://github.com/nodejs/node/pull/37570
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: Mary Marchini <oss@mmarchini.me>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2021-03-02 13:44:49 +00:00
|
|
|
'deps/v8/include/v8-internal.h',
|
2021-10-12 07:01:47 +00:00
|
|
|
'deps/v8/include/v8-isolate.h',
|
|
|
|
'deps/v8/include/v8-json.h',
|
|
|
|
'deps/v8/include/v8-local-handle.h',
|
|
|
|
'deps/v8/include/v8-locker.h',
|
|
|
|
'deps/v8/include/v8-maybe.h',
|
|
|
|
'deps/v8/include/v8-memory-span.h',
|
|
|
|
'deps/v8/include/v8-message.h',
|
|
|
|
'deps/v8/include/v8-microtask-queue.h',
|
|
|
|
'deps/v8/include/v8-microtask.h',
|
|
|
|
'deps/v8/include/v8-object.h',
|
|
|
|
'deps/v8/include/v8-persistent-handle.h',
|
build: include minimal V8 headers in distribution
Because Node.js currently distributes all V8 headers, it is not clear
which ones are part of our API and ABI compatibility contract. V8 may
add, remove, or change headers at any time, preventing us sometimes
from updating because the change could affect addons which may depend
on them. Moreover, the `cppgc` library, included in V8, is exposed
even though it is still in active development and doesn't have a
stable API.
Node.js should choose exactly which headers are exposed and part of
our native API, so that it's easier to reason about changes during V8
updates and to prevent us from automatically increasing the API
surface when new headers are added by V8.
Instead of specifically excluding v8-inspector, only include `v8.h`,
`v8-platform.h` (used in `node.h`) and `v8-profiler.h`.
PR-URL: https://github.com/nodejs/node/pull/37570
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: Mary Marchini <oss@mmarchini.me>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2021-03-02 13:44:49 +00:00
|
|
|
'deps/v8/include/v8-platform.h',
|
2021-10-12 07:01:47 +00:00
|
|
|
'deps/v8/include/v8-primitive-object.h',
|
|
|
|
'deps/v8/include/v8-primitive.h',
|
build: include minimal V8 headers in distribution
Because Node.js currently distributes all V8 headers, it is not clear
which ones are part of our API and ABI compatibility contract. V8 may
add, remove, or change headers at any time, preventing us sometimes
from updating because the change could affect addons which may depend
on them. Moreover, the `cppgc` library, included in V8, is exposed
even though it is still in active development and doesn't have a
stable API.
Node.js should choose exactly which headers are exposed and part of
our native API, so that it's easier to reason about changes during V8
updates and to prevent us from automatically increasing the API
surface when new headers are added by V8.
Instead of specifically excluding v8-inspector, only include `v8.h`,
`v8-platform.h` (used in `node.h`) and `v8-profiler.h`.
PR-URL: https://github.com/nodejs/node/pull/37570
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: Mary Marchini <oss@mmarchini.me>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2021-03-02 13:44:49 +00:00
|
|
|
'deps/v8/include/v8-profiler.h',
|
2021-10-12 07:01:47 +00:00
|
|
|
'deps/v8/include/v8-promise.h',
|
|
|
|
'deps/v8/include/v8-proxy.h',
|
|
|
|
'deps/v8/include/v8-regexp.h',
|
|
|
|
'deps/v8/include/v8-script.h',
|
|
|
|
'deps/v8/include/v8-snapshot.h',
|
|
|
|
'deps/v8/include/v8-statistics.h',
|
|
|
|
'deps/v8/include/v8-template.h',
|
|
|
|
'deps/v8/include/v8-traced-handle.h',
|
|
|
|
'deps/v8/include/v8-typed-array.h',
|
|
|
|
'deps/v8/include/v8-unwinder.h',
|
|
|
|
'deps/v8/include/v8-value-serializer.h',
|
|
|
|
'deps/v8/include/v8-value.h',
|
build: include minimal V8 headers in distribution
Because Node.js currently distributes all V8 headers, it is not clear
which ones are part of our API and ABI compatibility contract. V8 may
add, remove, or change headers at any time, preventing us sometimes
from updating because the change could affect addons which may depend
on them. Moreover, the `cppgc` library, included in V8, is exposed
even though it is still in active development and doesn't have a
stable API.
Node.js should choose exactly which headers are exposed and part of
our native API, so that it's easier to reason about changes during V8
updates and to prevent us from automatically increasing the API
surface when new headers are added by V8.
Instead of specifically excluding v8-inspector, only include `v8.h`,
`v8-platform.h` (used in `node.h`) and `v8-profiler.h`.
PR-URL: https://github.com/nodejs/node/pull/37570
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: Mary Marchini <oss@mmarchini.me>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2021-03-02 13:44:49 +00:00
|
|
|
'deps/v8/include/v8-version.h',
|
2021-10-12 07:01:47 +00:00
|
|
|
'deps/v8/include/v8-wasm.h',
|
2021-10-19 20:50:35 +00:00
|
|
|
'deps/v8/include/v8-weak-callback-info.h',
|
build: include minimal V8 headers in distribution
Because Node.js currently distributes all V8 headers, it is not clear
which ones are part of our API and ABI compatibility contract. V8 may
add, remove, or change headers at any time, preventing us sometimes
from updating because the change could affect addons which may depend
on them. Moreover, the `cppgc` library, included in V8, is exposed
even though it is still in active development and doesn't have a
stable API.
Node.js should choose exactly which headers are exposed and part of
our native API, so that it's easier to reason about changes during V8
updates and to prevent us from automatically increasing the API
surface when new headers are added by V8.
Instead of specifically excluding v8-inspector, only include `v8.h`,
`v8-platform.h` (used in `node.h`) and `v8-profiler.h`.
PR-URL: https://github.com/nodejs/node/pull/37570
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: Mary Marchini <oss@mmarchini.me>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2021-03-02 13:44:49 +00:00
|
|
|
'deps/v8/include/v8config.h',
|
2018-08-29 16:31:25 +00:00
|
|
|
]
|
build: include minimal V8 headers in distribution
Because Node.js currently distributes all V8 headers, it is not clear
which ones are part of our API and ABI compatibility contract. V8 may
add, remove, or change headers at any time, preventing us sometimes
from updating because the change could affect addons which may depend
on them. Moreover, the `cppgc` library, included in V8, is exposed
even though it is still in active development and doesn't have a
stable API.
Node.js should choose exactly which headers are exposed and part of
our native API, so that it's easier to reason about changes during V8
updates and to prevent us from automatically increasing the API
surface when new headers are added by V8.
Instead of specifically excluding v8-inspector, only include `v8.h`,
`v8-platform.h` (used in `node.h`) and `v8-profiler.h`.
PR-URL: https://github.com/nodejs/node/pull/37570
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: Mary Marchini <oss@mmarchini.me>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2021-03-02 13:44:49 +00:00
|
|
|
files_arg = [name for name in files_arg if name in v8_headers]
|
2019-04-13 22:09:45 +00:00
|
|
|
action(files_arg, dest)
|
2018-08-29 16:31:25 +00:00
|
|
|
|
2013-10-10 21:42:41 +00:00
|
|
|
action([
|
2013-12-20 08:29:06 +00:00
|
|
|
'common.gypi',
|
2013-10-10 21:42:41 +00:00
|
|
|
'config.gypi',
|
|
|
|
'src/node.h',
|
2017-03-20 21:55:26 +00:00
|
|
|
'src/node_api.h',
|
2018-10-19 19:10:59 +00:00
|
|
|
'src/js_native_api.h',
|
|
|
|
'src/js_native_api_types.h',
|
2017-03-20 21:55:26 +00:00
|
|
|
'src/node_api_types.h',
|
2013-10-10 21:42:41 +00:00
|
|
|
'src/node_buffer.h',
|
|
|
|
'src/node_object_wrap.h',
|
|
|
|
'src/node_version.h',
|
|
|
|
], 'include/node/')
|
|
|
|
|
2015-09-29 14:22:00 +00:00
|
|
|
# Add the expfile that is created on AIX
|
|
|
|
if sys.platform.startswith('aix'):
|
|
|
|
action(['out/Release/node.exp'], 'include/node/')
|
|
|
|
|
build: include minimal V8 headers in distribution
Because Node.js currently distributes all V8 headers, it is not clear
which ones are part of our API and ABI compatibility contract. V8 may
add, remove, or change headers at any time, preventing us sometimes
from updating because the change could affect addons which may depend
on them. Moreover, the `cppgc` library, included in V8, is exposed
even though it is still in active development and doesn't have a
stable API.
Node.js should choose exactly which headers are exposed and part of
our native API, so that it's easier to reason about changes during V8
updates and to prevent us from automatically increasing the API
surface when new headers are added by V8.
Instead of specifically excluding v8-inspector, only include `v8.h`,
`v8-platform.h` (used in `node.h`) and `v8-profiler.h`.
PR-URL: https://github.com/nodejs/node/pull/37570
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: Mary Marchini <oss@mmarchini.me>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2021-03-02 13:44:49 +00:00
|
|
|
subdir_files('deps/v8/include', 'include/node/', wanted_v8_headers)
|
2013-10-10 21:42:41 +00:00
|
|
|
|
|
|
|
if 'false' == variables.get('node_shared_libuv'):
|
|
|
|
subdir_files('deps/uv/include', 'include/node/', action)
|
|
|
|
|
2017-03-09 09:31:54 +00:00
|
|
|
if 'true' == variables.get('node_use_openssl') and \
|
|
|
|
'false' == variables.get('node_shared_openssl'):
|
2015-04-06 07:14:27 +00:00
|
|
|
subdir_files('deps/openssl/openssl/include/openssl', 'include/node/openssl/', action)
|
2015-04-08 08:56:52 +00:00
|
|
|
subdir_files('deps/openssl/config/archs', 'include/node/openssl/archs', action)
|
2018-03-14 02:25:48 +00:00
|
|
|
subdir_files('deps/openssl/config', 'include/node/openssl', action)
|
2013-10-10 21:42:41 +00:00
|
|
|
|
|
|
|
if 'false' == variables.get('node_shared_zlib'):
|
|
|
|
action([
|
|
|
|
'deps/zlib/zconf.h',
|
|
|
|
'deps/zlib/zlib.h',
|
|
|
|
], 'include/node/')
|
|
|
|
|
2012-08-01 23:06:31 +00:00
|
|
|
def run(args):
|
2013-04-23 18:17:09 +00:00
|
|
|
global node_prefix, install_path, target_defaults, variables
|
2012-08-01 23:06:31 +00:00
|
|
|
|
|
|
|
# chdir to the project's top-level directory
|
|
|
|
os.chdir(abspath(os.path.dirname(__file__), '..'))
|
|
|
|
|
|
|
|
conf = load_config()
|
|
|
|
variables = conf['variables']
|
|
|
|
target_defaults = conf['target_defaults']
|
|
|
|
|
|
|
|
# argv[2] is a custom install prefix for packagers (think DESTDIR)
|
2013-04-23 18:17:09 +00:00
|
|
|
# argv[3] is a custom install prefix (think PREFIX)
|
|
|
|
# Difference is that dst_dir won't be included in shebang lines etc.
|
2015-05-05 17:23:56 +00:00
|
|
|
dst_dir = args[2] if len(args) > 2 else ''
|
|
|
|
|
2013-04-23 18:17:09 +00:00
|
|
|
if len(args) > 3:
|
|
|
|
node_prefix = args[3]
|
|
|
|
|
|
|
|
# install_path thus becomes the base target directory.
|
|
|
|
install_path = dst_dir + node_prefix + '/'
|
2012-08-01 23:06:31 +00:00
|
|
|
|
|
|
|
cmd = args[1] if len(args) > 1 else 'install'
|
2015-06-14 10:23:43 +00:00
|
|
|
|
|
|
|
if os.environ.get('HEADERS_ONLY'):
|
2020-12-25 13:05:28 +00:00
|
|
|
if cmd == 'install':
|
|
|
|
headers(install)
|
|
|
|
return
|
|
|
|
if cmd == 'uninstall':
|
|
|
|
headers(uninstall)
|
|
|
|
return
|
2015-06-14 10:23:43 +00:00
|
|
|
else:
|
2020-12-25 13:05:28 +00:00
|
|
|
if cmd == 'install':
|
|
|
|
files(install)
|
|
|
|
return
|
|
|
|
if cmd == 'uninstall':
|
|
|
|
files(uninstall)
|
|
|
|
return
|
2015-06-14 10:23:43 +00:00
|
|
|
|
2012-08-01 23:06:31 +00:00
|
|
|
raise RuntimeError('Bad command: %s\n' % cmd)
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
run(sys.argv[:])
|