projects/aports·blob master · refs

150 lines · 4.6 KiB

1diff --git a/electron/script/generate-config-gypi.py.orig b/electron/script/generate-config-gypi.py
2index 58c973b..c215d90 100755
3--- a/electron/script/generate-config-gypi.py.orig
4+++ b/electron/script/generate-config-gypi.py
5@@ -64,6 +64,11 @@ def main(target_file, target_cpu):
6 # in common.gypi
7 if 'clang' in v:
8 del v['clang']
9+
10+ with open(os.path.join(NODE_DIR, 'use_system.txt')) as f:
11+ for dep in f.read().strip().split(' '):
12+ if v.get(f'node_shared_{dep}') is not None:
13+ v[f'node_shared_{dep}'] = 'true'
14
15 with open(target_file, 'w+', encoding='utf-8') as file_out:
16 file_out.write(pprint.pformat(config, indent=2))
17
18diff --git a/third_party/electron_node/node.gni.orig b/third_party/electron_node/node.gni
19index 73bf383..1c80d5a 100644
20--- a/third_party/electron_node/node.gni.orig
21+++ b/third_party/electron_node/node.gni
22@@ -73,6 +73,7 @@ declare_args() {
23 node_use_amaro = true
24
25 # Allows downstream packagers (eg. Linux distributions) to build against system shared libraries.
26+ use_system_ada = false
27 use_system_cares = false
28 use_system_nghttp2 = false
29 use_system_llhttp = false
30diff --git a/third_party/electron_node/unofficial.gni.orig b/third_party/electron_node/unofficial.gni
31index 95feec9..396252e 100644
32--- a/third_party/electron_node/unofficial.gni.orig
33+++ b/third_party/electron_node/unofficial.gni
34@@ -171,10 +171,8 @@ template("node_gn_build") {
35 public_configs = [
36 ":node_external_config",
37 "deps/googletest:googletest_config",
38- ":zstd_include_config"
39 ]
40 public_deps = [
41- "deps/ada",
42 "deps/uv",
43 "//electron:electron_js2c",
44 "deps/simdjson",
45@@ -187,19 +185,13 @@ template("node_gn_build") {
46 ]
47 deps = [
48 ":run_node_js2c",
49- "deps/cares",
50- "deps/histogram",
51- "deps/llhttp",
52 "deps/merve",
53 "deps/nbytes",
54- "deps/nghttp2",
55 "deps/postject",
56 "deps/uvwasi",
57 "//third_party/zlib",
58 "//third_party/brotli:dec",
59 "//third_party/brotli:enc",
60- "//third_party/zstd:decompress",
61- "//third_party/zstd:headers",
62 "$node_simdutf_path",
63 "$node_v8_path:v8_libplatform",
64 "$node_v8_path:v8_tracing",
65@@ -235,12 +227,30 @@ template("node_gn_build") {
66 if (is_posix) {
67 configs -= [ "//build/config/gcc:symbol_visibility_hidden" ]
68 configs += [ "//build/config/gcc:symbol_visibility_default" ]
69+ libs = []
70+ include_dirs = []
71 }
72 if (use_system_llhttp) {
73 libs += [ "llhttp" ]
74 } else {
75 deps += [ "deps/llhttp" ]
76 }
77+ if (use_system_cares) {
78+ libs += [ "cares" ]
79+ } else {
80+ deps += [ "deps/cares" ]
81+ }
82+ if (use_system_nghttp2) {
83+ libs += [ "nghttp2" ]
84+ } else {
85+ deps += [ "deps/nghttp2" ]
86+ }
87+ if (use_system_ada) {
88+ libs += [ "ada" ]
89+ include_dirs += [ "/usr/include/ada" ]
90+ } else {
91+ public_deps += [ "deps/ada" ]
92+ }
93 if (use_system_histogram) {
94 libs += [ "hdr_histogram" ]
95 include_dirs += [ "/usr/include/hdr" ]
96@@ -265,7 +275,7 @@ template("node_gn_build") {
97 "src/inspector:node_protocol_generated_sources",
98 "src/inspector:v8_inspector_compress_protocol_json",
99 ]
100- include_dirs = [
101+ include_dirs += [
102 "$target_gen_dir/src",
103 "$target_gen_dir/src/inspector",
104 "$node_inspector_protocol_path",
105@@ -279,17 +289,18 @@ template("node_gn_build") {
106 sources += node_inspector.node_inspector_sources +
107 node_inspector.node_inspector_generated_sources
108 }
109- if (is_linux) {
110- import("//build/config/linux/pkg_config.gni")
111- if (use_system_cares) {
112- pkg_config("cares") {
113- packages = [ "libcares" ]
114- }
115- }
116- if (use_system_nghttp2) {
117- pkg_config("nghttp2") {
118- packages = [ "libnghttp2" ]
119- }
120+ }
121+
122+ if (is_linux) {
123+ import("//build/config/linux/pkg_config.gni")
124+ if (use_system_cares) {
125+ pkg_config("cares") {
126+ packages = [ "libcares" ]
127+ }
128+ }
129+ if (use_system_nghttp2) {
130+ pkg_config("nghttp2") {
131+ packages = [ "libnghttp2" ]
132 }
133 }
134 }
135@@ -434,7 +445,6 @@ template("node_gn_build") {
136 "deps/ada",
137 "deps/simdjson",
138 "deps/uv",
139- "//third_party/zstd:headers",
140 "$node_v8_path",
141 "$node_v8_path:v8_libplatform",
142 ]
143@@ -463,7 +473,6 @@ template("node_gn_build") {
144 "deps/uv",
145 "deps/ada",
146 "deps/simdjson",
147- "//third_party/zstd:headers",
148 "$node_v8_path",
149 "$node_v8_path:v8_libplatform",
150 ]