1 |
commit: d2da708be8232c1fde4417584c056e519d015087 |
2 |
Author: Stephan Hartmann <stha09 <AT> googlemail <DOT> com> |
3 |
AuthorDate: Fri May 1 10:18:49 2020 +0000 |
4 |
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri May 1 15:32:08 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d2da708b |
7 |
|
8 |
www-client/chromium: fix stable channel to build with icu-67.1 |
9 |
|
10 |
Closes: https://bugs.gentoo.org/720100 |
11 |
Package-Manager: Portage-2.3.89, Repoman-2.3.20 |
12 |
Signed-off-by: Stephan Hartmann <stha09 <AT> googlemail.com> |
13 |
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org> |
14 |
Closes: https://github.com/gentoo/gentoo/pull/15595 |
15 |
|
16 |
www-client/chromium/chromium-81.0.4044.129.ebuild | 1 + |
17 |
www-client/chromium/files/chromium-81-icu67.patch | 162 ++++++++++++++++++++++ |
18 |
2 files changed, 163 insertions(+) |
19 |
|
20 |
diff --git a/www-client/chromium/chromium-81.0.4044.129.ebuild b/www-client/chromium/chromium-81.0.4044.129.ebuild |
21 |
index 551aed9bd1d..b110b41753b 100644 |
22 |
--- a/www-client/chromium/chromium-81.0.4044.129.ebuild |
23 |
+++ b/www-client/chromium/chromium-81.0.4044.129.ebuild |
24 |
@@ -155,6 +155,7 @@ PATCHES=( |
25 |
"${FILESDIR}/chromium-81-gcc-noexcept.patch" |
26 |
"${FILESDIR}/chromium-81-gcc-constexpr.patch" |
27 |
"${FILESDIR}/chromium-81-gcc-10.patch" |
28 |
+ "${FILESDIR}/chromium-81-icu67.patch" |
29 |
) |
30 |
|
31 |
pre_build_checks() { |
32 |
|
33 |
diff --git a/www-client/chromium/files/chromium-81-icu67.patch b/www-client/chromium/files/chromium-81-icu67.patch |
34 |
new file mode 100644 |
35 |
index 00000000000..745bad28ee2 |
36 |
--- /dev/null |
37 |
+++ b/www-client/chromium/files/chromium-81-icu67.patch |
38 |
@@ -0,0 +1,162 @@ |
39 |
+From 3f8dc4b2e5baf77b463334c769af85b79d8c1463 Mon Sep 17 00:00:00 2001 |
40 |
+From: Frank Tang <ftang@××××××××.org> |
41 |
+Date: Fri, 03 Apr 2020 23:13:54 -0700 |
42 |
+Subject: [PATCH] [intl] Remove soon-to-be removed getAllFieldPositions |
43 |
+ |
44 |
+Needed to land ICU67.1 soon. |
45 |
+ |
46 |
+Bug: v8:10393 |
47 |
+Change-Id: I3c7737ca600d6ccfdc46ffaddfb318ce60bc7618 |
48 |
+Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2136489 |
49 |
+Reviewed-by: Jakob Kummerow <jkummerow@××××××××.org> |
50 |
+Commit-Queue: Frank Tang <ftang@××××××××.org> |
51 |
+Cr-Commit-Position: refs/heads/master@{#67027} |
52 |
+--- |
53 |
+ |
54 |
+(backported for chromium-81) |
55 |
+ |
56 |
+diff --git a/v8/src/objects/js-number-format.cc b/v8/src/objects/js-number-format.cc |
57 |
+index 92d3e2f..ced408a 100644 |
58 |
+--- a/v8/src/objects/js-number-format.cc |
59 |
++++ b/v8/src/objects/js-number-format.cc |
60 |
+@@ -1197,42 +1197,31 @@ MaybeHandle<JSNumberFormat> JSNumberFormat::New(Isolate* isolate, |
61 |
+ } |
62 |
+ |
63 |
+ namespace { |
64 |
+-Maybe<icu::UnicodeString> IcuFormatNumber( |
65 |
++Maybe<bool> IcuFormatNumber( |
66 |
+ Isolate* isolate, |
67 |
+ const icu::number::LocalizedNumberFormatter& number_format, |
68 |
+- Handle<Object> numeric_obj, icu::FieldPositionIterator* fp_iter) { |
69 |
++ Handle<Object> numeric_obj, icu::number::FormattedNumber* formatted) { |
70 |
+ // If it is BigInt, handle it differently. |
71 |
+ UErrorCode status = U_ZERO_ERROR; |
72 |
+- icu::number::FormattedNumber formatted; |
73 |
+ if (numeric_obj->IsBigInt()) { |
74 |
+ Handle<BigInt> big_int = Handle<BigInt>::cast(numeric_obj); |
75 |
+ Handle<String> big_int_string; |
76 |
+ ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, big_int_string, |
77 |
+ BigInt::ToString(isolate, big_int), |
78 |
+- Nothing<icu::UnicodeString>()); |
79 |
+- formatted = number_format.formatDecimal( |
80 |
++ Nothing<bool>()); |
81 |
++ *formatted = number_format.formatDecimal( |
82 |
+ {big_int_string->ToCString().get(), big_int_string->length()}, status); |
83 |
+ } else { |
84 |
+ double number = numeric_obj->Number(); |
85 |
+- formatted = number_format.formatDouble(number, status); |
86 |
++ *formatted = number_format.formatDouble(number, status); |
87 |
+ } |
88 |
+ if (U_FAILURE(status)) { |
89 |
+ // This happen because of icu data trimming trim out "unit". |
90 |
+ // See https://bugs.chromium.org/p/v8/issues/detail?id=8641 |
91 |
+- THROW_NEW_ERROR_RETURN_VALUE(isolate, |
92 |
+- NewTypeError(MessageTemplate::kIcuError), |
93 |
+- Nothing<icu::UnicodeString>()); |
94 |
+- } |
95 |
+- if (fp_iter) { |
96 |
+- formatted.getAllFieldPositions(*fp_iter, status); |
97 |
++ THROW_NEW_ERROR_RETURN_VALUE( |
98 |
++ isolate, NewTypeError(MessageTemplate::kIcuError), Nothing<bool>()); |
99 |
+ } |
100 |
+- icu::UnicodeString result = formatted.toString(status); |
101 |
+- if (U_FAILURE(status)) { |
102 |
+- THROW_NEW_ERROR_RETURN_VALUE(isolate, |
103 |
+- NewTypeError(MessageTemplate::kIcuError), |
104 |
+- Nothing<icu::UnicodeString>()); |
105 |
+- } |
106 |
+- return Just(result); |
107 |
++ return Just(true); |
108 |
+ } |
109 |
+ |
110 |
+ } // namespace |
111 |
+@@ -1243,10 +1232,16 @@ MaybeHandle<String> JSNumberFormat::FormatNumeric( |
112 |
+ Handle<Object> numeric_obj) { |
113 |
+ DCHECK(numeric_obj->IsNumeric()); |
114 |
+ |
115 |
+- Maybe<icu::UnicodeString> maybe_format = |
116 |
+- IcuFormatNumber(isolate, number_format, numeric_obj, nullptr); |
117 |
++ icu::number::FormattedNumber formatted; |
118 |
++ Maybe<bool> maybe_format = |
119 |
++ IcuFormatNumber(isolate, number_format, numeric_obj, &formatted); |
120 |
+ MAYBE_RETURN(maybe_format, Handle<String>()); |
121 |
+- return Intl::ToString(isolate, maybe_format.FromJust()); |
122 |
++ UErrorCode status = U_ZERO_ERROR; |
123 |
++ icu::UnicodeString result = formatted.toString(status); |
124 |
++ if (U_FAILURE(status)) { |
125 |
++ THROW_NEW_ERROR(isolate, NewTypeError(MessageTemplate::kIcuError), String); |
126 |
++ } |
127 |
++ return Intl::ToString(isolate, result); |
128 |
+ } |
129 |
+ |
130 |
+ namespace { |
131 |
+@@ -1359,12 +1354,18 @@ std::vector<NumberFormatSpan> FlattenRegionsToParts( |
132 |
+ } |
133 |
+ |
134 |
+ namespace { |
135 |
+-Maybe<int> ConstructParts(Isolate* isolate, const icu::UnicodeString& formatted, |
136 |
+- icu::FieldPositionIterator* fp_iter, |
137 |
++Maybe<int> ConstructParts(Isolate* isolate, |
138 |
++ icu::number::FormattedNumber* formatted, |
139 |
+ Handle<JSArray> result, int start_index, |
140 |
+ Handle<Object> numeric_obj, bool style_is_unit) { |
141 |
++ UErrorCode status = U_ZERO_ERROR; |
142 |
++ icu::UnicodeString formatted_text = formatted->toString(status); |
143 |
++ if (U_FAILURE(status)) { |
144 |
++ THROW_NEW_ERROR_RETURN_VALUE( |
145 |
++ isolate, NewTypeError(MessageTemplate::kIcuError), Nothing<int>()); |
146 |
++ } |
147 |
+ DCHECK(numeric_obj->IsNumeric()); |
148 |
+- int32_t length = formatted.length(); |
149 |
++ int32_t length = formatted_text.length(); |
150 |
+ int index = start_index; |
151 |
+ if (length == 0) return Just(index); |
152 |
+ |
153 |
+@@ -1373,13 +1374,14 @@ Maybe<int> ConstructParts(Isolate* isolate, const icu::UnicodeString& formatted, |
154 |
+ // other region covers some part of the formatted string. It's possible |
155 |
+ // there's another field with exactly the same begin and end as this backdrop, |
156 |
+ // in which case the backdrop's field_id of -1 will give it lower priority. |
157 |
+- regions.push_back(NumberFormatSpan(-1, 0, formatted.length())); |
158 |
++ regions.push_back(NumberFormatSpan(-1, 0, formatted_text.length())); |
159 |
+ |
160 |
+ { |
161 |
+- icu::FieldPosition fp; |
162 |
+- while (fp_iter->next(fp)) { |
163 |
+- regions.push_back(NumberFormatSpan(fp.getField(), fp.getBeginIndex(), |
164 |
+- fp.getEndIndex())); |
165 |
++ icu::ConstrainedFieldPosition cfp; |
166 |
++ cfp.constrainCategory(UFIELD_CATEGORY_NUMBER); |
167 |
++ while (formatted->nextPosition(cfp, status)) { |
168 |
++ regions.push_back( |
169 |
++ NumberFormatSpan(cfp.getField(), cfp.getStart(), cfp.getLimit())); |
170 |
+ } |
171 |
+ } |
172 |
+ |
173 |
+@@ -1401,7 +1403,7 @@ Maybe<int> ConstructParts(Isolate* isolate, const icu::UnicodeString& formatted, |
174 |
+ Handle<String> substring; |
175 |
+ ASSIGN_RETURN_ON_EXCEPTION_VALUE( |
176 |
+ isolate, substring, |
177 |
+- Intl::ToString(isolate, formatted, part.begin_pos, part.end_pos), |
178 |
++ Intl::ToString(isolate, formatted_text, part.begin_pos, part.end_pos), |
179 |
+ Nothing<int>()); |
180 |
+ Intl::AddElement(isolate, result, index, field_type_string, substring); |
181 |
+ ++index; |
182 |
+@@ -1421,14 +1423,14 @@ MaybeHandle<JSArray> JSNumberFormat::FormatToParts( |
183 |
+ number_format->icu_number_formatter().raw(); |
184 |
+ CHECK_NOT_NULL(fmt); |
185 |
+ |
186 |
+- icu::FieldPositionIterator fp_iter; |
187 |
+- Maybe<icu::UnicodeString> maybe_format = |
188 |
+- IcuFormatNumber(isolate, *fmt, numeric_obj, &fp_iter); |
189 |
++ icu::number::FormattedNumber formatted; |
190 |
++ Maybe<bool> maybe_format = |
191 |
++ IcuFormatNumber(isolate, *fmt, numeric_obj, &formatted); |
192 |
+ MAYBE_RETURN(maybe_format, Handle<JSArray>()); |
193 |
+ |
194 |
+ Handle<JSArray> result = factory->NewJSArray(0); |
195 |
+ Maybe<int> maybe_format_to_parts = ConstructParts( |
196 |
+- isolate, maybe_format.FromJust(), &fp_iter, result, 0, numeric_obj, |
197 |
++ isolate, &formatted, result, 0, numeric_obj, |
198 |
+ number_format->style() == JSNumberFormat::Style::UNIT); |
199 |
+ MAYBE_RETURN(maybe_format_to_parts, Handle<JSArray>()); |
200 |
+ |