Files
electron/patches/node/build_allow_unbundling_of_node_js_dependencies.patch
electron-roller[bot] 82a59d9894 chore: bump node to v22.16.0 (main) (#47217)
* chore: bump node in DEPS to v22.16.0

* crypto: remove BoringSSL dh-primes addition

https://github.com/nodejs/node/pull/57023

* tools: enable linter in test/fixtures/test\-runner/output

https://github.com/nodejs/node/pull/57698

* src: improve thread safety of TaskQueue

https://github.com/nodejs/node/pull/57910

* buffer: define global v8::CFunction objects as const

https://github.com/nodejs/node/pull/57676

* src: disable abseil deadlock detection

https://github.com/nodejs/node/pull/57582

* zlib: fix pointer alignment

https://github.com/nodejs/node/pull/57727

* chore: fixup patch indices

* src: set default config as node.config.json

https://github.com/nodejs/node/pull/57171

* src: update std::vector<v8::Local<T>> to use v8::LocalVector<T>

https://github.com/nodejs/node/pull/57578

* test: disable chmod tests failing in Docker

https://github.com/nodejs/node/issues/58326

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2025-06-02 17:30:15 -04:00

67 lines
2.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Sun, 17 Nov 2024 22:33:19 +0100
Subject: build: allow unbundling of Node.js dependencies
Linux distributions have guidelines on using distro-provided dependencies,
rather than compiling them in statically.
This PR this enables downstream packagers to unbundle these dependencies.
We don't need to do this for zlib, as the existing gn workflow uses the same
//third_party/zlib, so unbundling zlib with Chromium tools in
//build/linux/unbundle works already. This adds support for some of the others.
Upstreamed at https://github.com/nodejs/node/pull/55903
diff --git a/unofficial.gni b/unofficial.gni
index e17e4f043af6e4047ab82723ffd83187f3c04c5c..d591dfc99fdea4f830008502786ee44d863a31fc 100644
--- a/unofficial.gni
+++ b/unofficial.gni
@@ -155,7 +155,6 @@ template("node_gn_build") {
":run_node_js2c",
"deps/cares",
"deps/histogram",
- "deps/llhttp",
"deps/nbytes",
"deps/nghttp2",
"deps/postject",
@@ -194,7 +193,17 @@ template("node_gn_build") {
configs -= [ "//build/config/gcc:symbol_visibility_hidden" ]
configs += [ "//build/config/gcc:symbol_visibility_default" ]
}
-
+ if (use_system_llhttp) {
+ libs += [ "llhttp" ]
+ } else {
+ deps += [ "deps/llhttp" ]
+ }
+ if (use_system_histogram) {
+ libs += [ "hdr_histogram" ]
+ include_dirs += [ "/usr/include/hdr" ]
+ } else {
+ deps += [ "deps/histogram" ]
+ }
if (v8_enable_i18n_support) {
deps += [ "//third_party/icu" ]
}
@@ -222,6 +231,19 @@ template("node_gn_build") {
sources += node_inspector.node_inspector_sources +
node_inspector.node_inspector_generated_sources
}
+ if (is_linux) {
+ import("//build/config/linux/pkg_config.gni")
+ if (use_system_cares) {
+ pkg_config("cares") {
+ packages = [ "libcares" ]
+ }
+ }
+ if (use_system_nghttp2) {
+ pkg_config("nghttp2") {
+ packages = [ "libnghttp2" ]
+ }
+ }
+ }
}
config("zstd_include_config") {