Gentoo Archives: gentoo-commits

From: Marek Szuba <marecki@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-libs/nodejs/, net-libs/nodejs/files/
Date: Tue, 20 Apr 2021 17:48:58
Message-Id: 1618940920.75c8059bb0bc595deff3cadcc1195e1ffdf0f385.marecki@gentoo
1 commit: 75c8059bb0bc595deff3cadcc1195e1ffdf0f385
2 Author: Marek Szuba <marecki <AT> gentoo <DOT> org>
3 AuthorDate: Tue Apr 20 17:17:14 2021 +0000
4 Commit: Marek Szuba <marecki <AT> gentoo <DOT> org>
5 CommitDate: Tue Apr 20 17:48:40 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=75c8059b
7
8 net-libs/nodejs: support dev-libs/icu-69.1
9
10 The version of V8 bundled with all versions of NodeJS currently in the
11 tree calls ListFormatter::createInstance() in a way that is both marked
12 as internal in icu-68 and absent from icu-69. Apply a fix originally
13 developed from Chromium which switches to a style marked as stable since
14 icu-67, meaning it works with both versions of dev-libs/icu currently in
15 the tree (confirmed by building 12.22.1 against both, with USE=icu of
16 course).
17
18 Closes: https://bugs.gentoo.org/781287
19 Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>
20
21 .../nodejs/files/nodejs-12.22.1-v8_icu69.patch | 85 ++++++++++++++++++++++
22 .../nodejs/files/nodejs-14.16.1-v8_icu69.patch | 84 +++++++++++++++++++++
23 net-libs/nodejs/nodejs-12.22.1.ebuild | 1 +
24 net-libs/nodejs/nodejs-14.16.1.ebuild | 1 +
25 net-libs/nodejs/nodejs-15.14.0.ebuild | 1 +
26 5 files changed, 172 insertions(+)
27
28 diff --git a/net-libs/nodejs/files/nodejs-12.22.1-v8_icu69.patch b/net-libs/nodejs/files/nodejs-12.22.1-v8_icu69.patch
29 new file mode 100644
30 index 00000000000..bd6d5c64b02
31 --- /dev/null
32 +++ b/net-libs/nodejs/files/nodejs-12.22.1-v8_icu69.patch
33 @@ -0,0 +1,85 @@
34 +Port of the Chromium commit 035c305ce7761f51328b45f1bd83e26aef267c9d to node-v12.
35 +Original commit message follows.
36 +
37 +Author: Frank Tang <ftang@××××××××.org>
38 +AuthorDate: 2020-10-15 22:44:27 -0700
39 +Commit: Commit Bot <commit-bot@××××××××.org>
40 +CommitDate: 2020-10-20 02:08:13 +0000
41 +[Intl] call new ListFormatter::createInstance
42 +The one we currently using is now marked as internal and to be removed
43 +for 68. Migrating to the style which already avaiable in ICU 67-1.
44 +
45 +--- a/deps/v8/src/objects/js-list-format.cc
46 ++++ b/deps/v8/src/objects/js-list-format.cc
47 +@@ -29,46 +29,27 @@
48 + namespace internal {
49 +
50 + namespace {
51 +-const char* kStandard = "standard";
52 +-const char* kOr = "or";
53 +-const char* kUnit = "unit";
54 +-const char* kStandardShort = "standard-short";
55 +-const char* kOrShort = "or-short";
56 +-const char* kUnitShort = "unit-short";
57 +-const char* kStandardNarrow = "standard-narrow";
58 +-const char* kOrNarrow = "or-narrow";
59 +-const char* kUnitNarrow = "unit-narrow";
60 +
61 +-const char* GetIcuStyleString(JSListFormat::Style style,
62 +- JSListFormat::Type type) {
63 ++UListFormatterWidth GetIcuWidth(JSListFormat::Style style) {
64 ++ switch (style) {
65 ++ case JSListFormat::Style::LONG:
66 ++ return ULISTFMT_WIDTH_WIDE;
67 ++ case JSListFormat::Style::SHORT:
68 ++ return ULISTFMT_WIDTH_SHORT;
69 ++ case JSListFormat::Style::NARROW:
70 ++ return ULISTFMT_WIDTH_NARROW;
71 ++ }
72 ++ UNREACHABLE();
73 ++}
74 ++
75 ++UListFormatterType GetIcuType(JSListFormat::Type type) {
76 + switch (type) {
77 + case JSListFormat::Type::CONJUNCTION:
78 +- switch (style) {
79 +- case JSListFormat::Style::LONG:
80 +- return kStandard;
81 +- case JSListFormat::Style::SHORT:
82 +- return kStandardShort;
83 +- case JSListFormat::Style::NARROW:
84 +- return kStandardNarrow;
85 +- }
86 ++ return ULISTFMT_TYPE_AND;
87 + case JSListFormat::Type::DISJUNCTION:
88 +- switch (style) {
89 +- case JSListFormat::Style::LONG:
90 +- return kOr;
91 +- case JSListFormat::Style::SHORT:
92 +- return kOrShort;
93 +- case JSListFormat::Style::NARROW:
94 +- return kOrNarrow;
95 +- }
96 ++ return ULISTFMT_TYPE_OR;
97 + case JSListFormat::Type::UNIT:
98 +- switch (style) {
99 +- case JSListFormat::Style::LONG:
100 +- return kUnit;
101 +- case JSListFormat::Style::SHORT:
102 +- return kUnitShort;
103 +- case JSListFormat::Style::NARROW:
104 +- return kUnitNarrow;
105 +- }
106 ++ return ULISTFMT_TYPE_UNITS;
107 + }
108 + UNREACHABLE();
109 + }
110 +@@ -170,7 +151,7 @@
111 + icu::Locale icu_locale = r.icu_locale;
112 + UErrorCode status = U_ZERO_ERROR;
113 + icu::ListFormatter* formatter = icu::ListFormatter::createInstance(
114 +- icu_locale, GetIcuStyleString(style_enum, type_enum), status);
115 ++ icu_locale, GetIcuType(type_enum), GetIcuWidth(style_enum), status);
116 + if (U_FAILURE(status)) {
117 + delete formatter;
118 + FATAL("Failed to create ICU list formatter, are ICU data files missing?");
119
120 diff --git a/net-libs/nodejs/files/nodejs-14.16.1-v8_icu69.patch b/net-libs/nodejs/files/nodejs-14.16.1-v8_icu69.patch
121 new file mode 100644
122 index 00000000000..d1e204f0c5d
123 --- /dev/null
124 +++ b/net-libs/nodejs/files/nodejs-14.16.1-v8_icu69.patch
125 @@ -0,0 +1,84 @@
126 +Port of the Chromium commit 035c305ce7761f51328b45f1bd83e26aef267c9d to node-v14.
127 +Original commit message follows.
128 +
129 +Author: Frank Tang <ftang@××××××××.org>
130 +AuthorDate: 2020-10-15 22:44:27 -0700
131 +Commit: Commit Bot <commit-bot@××××××××.org>
132 +CommitDate: 2020-10-20 02:08:13 +0000
133 +[Intl] call new ListFormatter::createInstance
134 +The one we currently using is now marked as internal and to be removed
135 +for 68. Migrating to the style which already avaiable in ICU 67-1.
136 +
137 +--- a/deps/v8/src/objects/js-list-format.cc
138 ++++ b/deps/v8/src/objects/js-list-format.cc
139 +@@ -29,46 +29,26 @@
140 + namespace internal {
141 +
142 + namespace {
143 +-const char* kStandard = "standard";
144 +-const char* kOr = "or";
145 +-const char* kUnit = "unit";
146 +-const char* kStandardShort = "standard-short";
147 +-const char* kOrShort = "or-short";
148 +-const char* kUnitShort = "unit-short";
149 +-const char* kStandardNarrow = "standard-narrow";
150 +-const char* kOrNarrow = "or-narrow";
151 +-const char* kUnitNarrow = "unit-narrow";
152 ++UListFormatterWidth GetIcuWidth(JSListFormat::Style style) {
153 ++ switch (style) {
154 ++ case JSListFormat::Style::LONG:
155 ++ return ULISTFMT_WIDTH_WIDE;
156 ++ case JSListFormat::Style::SHORT:
157 ++ return ULISTFMT_WIDTH_SHORT;
158 ++ case JSListFormat::Style::NARROW:
159 ++ return ULISTFMT_WIDTH_NARROW;
160 ++ }
161 ++ UNREACHABLE();
162 ++}
163 +
164 +-const char* GetIcuStyleString(JSListFormat::Style style,
165 +- JSListFormat::Type type) {
166 ++UListFormatterType GetIcuType(JSListFormat::Type type) {
167 + switch (type) {
168 + case JSListFormat::Type::CONJUNCTION:
169 +- switch (style) {
170 +- case JSListFormat::Style::LONG:
171 +- return kStandard;
172 +- case JSListFormat::Style::SHORT:
173 +- return kStandardShort;
174 +- case JSListFormat::Style::NARROW:
175 +- return kStandardNarrow;
176 +- }
177 ++ return ULISTFMT_TYPE_AND;
178 + case JSListFormat::Type::DISJUNCTION:
179 +- switch (style) {
180 +- case JSListFormat::Style::LONG:
181 +- return kOr;
182 +- case JSListFormat::Style::SHORT:
183 +- return kOrShort;
184 +- case JSListFormat::Style::NARROW:
185 +- return kOrNarrow;
186 +- }
187 ++ return ULISTFMT_TYPE_OR;
188 + case JSListFormat::Type::UNIT:
189 +- switch (style) {
190 +- case JSListFormat::Style::LONG:
191 +- return kUnit;
192 +- case JSListFormat::Style::SHORT:
193 +- return kUnitShort;
194 +- case JSListFormat::Style::NARROW:
195 +- return kUnitNarrow;
196 +- }
197 ++ return ULISTFMT_TYPE_UNITS;
198 + }
199 + UNREACHABLE();
200 + }
201 +@@ -143,7 +123,7 @@
202 + icu::Locale icu_locale = r.icu_locale;
203 + UErrorCode status = U_ZERO_ERROR;
204 + icu::ListFormatter* formatter = icu::ListFormatter::createInstance(
205 +- icu_locale, GetIcuStyleString(style_enum, type_enum), status);
206 ++ icu_locale, GetIcuType(type_enum), GetIcuWidth(style_enum), status);
207 + if (U_FAILURE(status) || formatter == nullptr) {
208 + delete formatter;
209 + THROW_NEW_ERROR(isolate, NewRangeError(MessageTemplate::kIcuError),
210
211 diff --git a/net-libs/nodejs/nodejs-12.22.1.ebuild b/net-libs/nodejs/nodejs-12.22.1.ebuild
212 index 09249518e7e..4d8fd536264 100644
213 --- a/net-libs/nodejs/nodejs-12.22.1.ebuild
214 +++ b/net-libs/nodejs/nodejs-12.22.1.ebuild
215 @@ -47,6 +47,7 @@ DEPEND="
216 PATCHES=(
217 "${FILESDIR}"/${PN}-10.3.0-global-npm-config.patch
218 "${FILESDIR}"/${PN}-12.20.1-fix_ppc64_crashes.patch
219 + "${FILESDIR}"/${PN}-12.22.1-v8_icu69.patch
220 "${FILESDIR}"/${PN}-99999999-llhttp.patch
221 )
222 RESTRICT="test"
223
224 diff --git a/net-libs/nodejs/nodejs-14.16.1.ebuild b/net-libs/nodejs/nodejs-14.16.1.ebuild
225 index b9e5858aaa6..c7c510655c8 100644
226 --- a/net-libs/nodejs/nodejs-14.16.1.ebuild
227 +++ b/net-libs/nodejs/nodejs-14.16.1.ebuild
228 @@ -43,6 +43,7 @@ DEPEND="${RDEPEND}"
229 PATCHES=(
230 "${FILESDIR}"/${PN}-10.3.0-global-npm-config.patch
231 "${FILESDIR}"/${PN}-14.15.0-fix_ppc64_crashes.patch
232 + "${FILESDIR}"/${PN}-14.16.1-v8_icu69.patch
233 )
234
235 S="${WORKDIR}/node-v${PV}"
236
237 diff --git a/net-libs/nodejs/nodejs-15.14.0.ebuild b/net-libs/nodejs/nodejs-15.14.0.ebuild
238 index 3b317ab08c9..9ef4cb031dd 100644
239 --- a/net-libs/nodejs/nodejs-15.14.0.ebuild
240 +++ b/net-libs/nodejs/nodejs-15.14.0.ebuild
241 @@ -41,6 +41,7 @@ BDEPEND="${PYTHON_DEPS}
242 DEPEND="${RDEPEND}"
243
244 PATCHES=(
245 + "${FILESDIR}"/${PN}-14.16.1-v8_icu69.patch
246 "${FILESDIR}"/${PN}-15.2.0-global-npm-config.patch
247 )