Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtwebengine/files/, dev-qt/qtwebengine/
Date: Sat, 02 Jan 2021 01:23:08
Message-Id: 1609550553.3946a54e64f9f6c2f82ed4f35246f295e4d67d81.asturm@gentoo
1 commit: 3946a54e64f9f6c2f82ed4f35246f295e4d67d81
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jan 1 16:56:11 2021 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Sat Jan 2 01:22:33 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3946a54e
7
8 dev-qt/qtwebengine: Fix V8 runtime issues with ICU-68
9
10 Thanks-to: Stephan Hartmann <sultan <AT> gentoo.org>
11 Package-Manager: Portage-3.0.12, Repoman-3.0.2
12 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
13
14 .../qtwebengine-5.15.2-icu-68-v8-runtime-fix.patch | 170 +++++++++++++++++++++
15 dev-qt/qtwebengine/qtwebengine-5.15.2.ebuild | 3 +-
16 2 files changed, 172 insertions(+), 1 deletion(-)
17
18 diff --git a/dev-qt/qtwebengine/files/qtwebengine-5.15.2-icu-68-v8-runtime-fix.patch b/dev-qt/qtwebengine/files/qtwebengine-5.15.2-icu-68-v8-runtime-fix.patch
19 new file mode 100644
20 index 00000000000..7d6401759a7
21 --- /dev/null
22 +++ b/dev-qt/qtwebengine/files/qtwebengine-5.15.2-icu-68-v8-runtime-fix.patch
23 @@ -0,0 +1,170 @@
24 +From b0a7f5691113534c2cf771f2dd3cece5e93bc7d4 Mon Sep 17 00:00:00 2001
25 +From: Frank Tang <ftang@××××××××.org>
26 +Date: Tue, 03 Nov 2020 23:20:37 -0800
27 +Subject: [PATCH] Update to ICU68-1
28 +
29 +ICU68-1 change the output skeleton format. So we need to change
30 +resolvedOptions code for 68 migration.
31 +
32 +Chromium roll
33 +https://chromium-review.googlesource.com/c/chromium/src/+/2474093
34 +
35 +Bug: v8:10945
36 +Change-Id: I3b2c7fbe8abb22df8fa51287c498ca3245b8c55b
37 +Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2477431
38 +Commit-Queue: Frank Tang <ftang@××××××××.org>
39 +Reviewed-by: Jakob Kummerow <jkummerow@××××××××.org>
40 +Reviewed-by: Shu-yu Guo <syg@××××××××.org>
41 +Cr-Commit-Position: refs/heads/master@{#70972}
42 +
43 +(ported to work with <ICU-68.1 and rebased to qtwebengine)
44 +---
45 +
46 +diff --git a/src/3rdparty/chromium/v8/src/objects/js-number-format.cc b/src/3rdparty/chromium/v8/src/objects/js-number-format.cc
47 +index 6f3d97a619..83cf021fb1 100644
48 +--- a/src/3rdparty/chromium/v8/src/objects/js-number-format.cc
49 ++++ b/src/3rdparty/chromium/v8/src/objects/js-number-format.cc
50 +@@ -390,17 +390,20 @@ Handle<String> CurrencySignString(Isolate* isolate,
51 + Handle<String> UnitDisplayString(Isolate* isolate,
52 + const icu::UnicodeString& skeleton) {
53 + // Ex: skeleton as
54 +- // "measure-unit/length-meter .### rounding-mode-half-up unit-width-full-name"
55 ++ // <ICU-68.1: "measure-unit/length-meter .### rounding-mode-half-up unit-width-full-name".
56 ++ // >=ICU-68.1: "unit/length-meter .### rounding-mode-half-up unit-width-full-name"
57 + if (skeleton.indexOf("unit-width-full-name") >= 0) {
58 + return ReadOnlyRoots(isolate).long_string_handle();
59 + }
60 + // Ex: skeleton as
61 +- // "measure-unit/length-meter .### rounding-mode-half-up unit-width-narrow".
62 ++ // <ICU-68.1: "measure-unit/length-meter .### rounding-mode-half-up unit-width-narrow".
63 ++ // >=ICU-68.1: "unit/length-meter .### rounding-mode-half-up unit-width-narrow".
64 + if (skeleton.indexOf("unit-width-narrow") >= 0) {
65 + return ReadOnlyRoots(isolate).narrow_string_handle();
66 + }
67 + // Ex: skeleton as
68 +- // "measure-unit/length-foot .### rounding-mode-half-up"
69 ++ // <ICU-68.1: "measure-unit/length-foot .### rounding-mode-half-up"
70 ++ // >=ICU-68.1: "unit/length-foot .### rounding-mode-half-up"
71 + return ReadOnlyRoots(isolate).short_string_handle();
72 + }
73 +
74 +@@ -423,7 +426,8 @@ Notation NotationFromSkeleton(const icu::UnicodeString& skeleton) {
75 + return Notation::COMPACT;
76 + }
77 + // Ex: skeleton as
78 +- // "measure-unit/length-foot .### rounding-mode-half-up"
79 ++ // <ICU-68.1: "measure-unit/length-foot .### rounding-mode-half-up"
80 ++ // >=ICU-68.1: "unit/length-foot .### rounding-mode-half-up"
81 + return Notation::STANDARD;
82 + }
83 +
84 +@@ -563,14 +567,23 @@ namespace {
85 +
86 + // Ex: percent .### rounding-mode-half-up
87 + // Special case for "percent"
88 +-// Ex: "measure-unit/length-kilometer per-measure-unit/duration-hour .###
89 +-// rounding-mode-half-up" should return "kilometer-per-unit".
90 +-// Ex: "measure-unit/duration-year .### rounding-mode-half-up" should return
91 +-// "year".
92 ++// <ICU-68.1:
93 ++// Ex: "measure-unit/length-kilometer per-measure-unit/duration-hour .###
94 ++// rounding-mode-half-up" should return "kilometer-per-unit".
95 ++// Ex: "measure-unit/duration-year .### rounding-mode-half-up" should return
96 ++// >=ICU-68.1:
97 ++// Ex: "unit/milliliter-per-acre .### rounding-mode-half-up"
98 ++// should return "milliliter-per-acre".
99 ++// Ex: "unit/year .### rounding-mode-half-up" should return
100 ++// "year".
101 + std::string UnitFromSkeleton(const icu::UnicodeString& skeleton) {
102 + std::string str;
103 + str = skeleton.toUTF8String<std::string>(str);
104 ++#if U_ICU_VERSION_MAJOR_NUM < 68
105 + std::string search("measure-unit/");
106 ++#else
107 ++ std::string search("unit/");
108 ++#endif
109 + size_t begin = str.find(search);
110 + if (begin == str.npos) {
111 + // Special case for "percent".
112 +@@ -579,20 +592,41 @@ std::string UnitFromSkeleton(const icu::UnicodeString& skeleton) {
113 + }
114 + return "";
115 + }
116 ++#if U_ICU_VERSION_MAJOR_NUM < 68
117 + // Skip the type (ex: "length").
118 + // "measure-unit/length-kilometer per-measure-unit/duration-hour"
119 + // b
120 + begin = str.find("-", begin + search.size());
121 ++#else
122 ++ // Ex:
123 ++ // "unit/acre .### rounding-mode-half-up"
124 ++ // b
125 ++ // Ex:
126 ++ // "unit/milliliter-per-acre .### rounding-mode-half-up"
127 ++ // b
128 ++ begin += search.size();
129 ++#endif
130 + if (begin == str.npos) {
131 + return "";
132 + }
133 ++#if U_ICU_VERSION_MAJOR_NUM < 68
134 + begin++; // Skip the '-'.
135 ++#endif
136 + // Find the end of the subtype.
137 + size_t end = str.find(" ", begin);
138 +- // "measure-unit/length-kilometer per-measure-unit/duration-hour"
139 +- // b e
140 ++ // <ICU-68.1:
141 ++ // "measure-unit/length-kilometer per-measure-unit/duration-hour"
142 ++ // b e
143 ++ // >=ICU-68.1:
144 ++ // Ex:
145 ++ // "unit/acre .### rounding-mode-half-up"
146 ++ // b e
147 ++ // Ex:
148 ++ // "unit/milliliter-per-acre .### rounding-mode-half-up"
149 ++ // b e
150 + if (end == str.npos) {
151 + end = str.size();
152 ++#if U_ICU_VERSION_MAJOR_NUM < 68
153 + return str.substr(begin, end - begin);
154 + }
155 + // "measure-unit/length-kilometer per-measure-unit/duration-hour"
156 +@@ -626,18 +660,37 @@ std::string UnitFromSkeleton(const icu::UnicodeString& skeleton) {
157 + // "measure-unit/length-kilometer per-measure-unit/duration-hour"
158 + // [result ] b e
159 + return result + "-per-" + str.substr(begin, end - begin);
160 ++#else
161 ++ }
162 ++ return str.substr(begin, end - begin);
163 ++#endif
164 + }
165 +
166 + Style StyleFromSkeleton(const icu::UnicodeString& skeleton) {
167 + if (skeleton.indexOf("currency/") >= 0) {
168 + return Style::CURRENCY;
169 + }
170 ++#if U_ICU_VERSION_MAJOR_NUM < 68
171 + if (skeleton.indexOf("measure-unit/") >= 0) {
172 ++#else
173 ++ if (skeleton.indexOf("unit/") >= 0) {
174 ++#endif
175 + return Style::UNIT;
176 + }
177 ++#if U_ICU_VERSION_MAJOR_NUM < 68
178 + if (skeleton.indexOf("percent ") >= 0) {
179 + return Style::PERCENT;
180 + }
181 ++#else
182 ++ if (skeleton.indexOf("percent") >= 0) {
183 ++ // percent precision-integer rounding-mode-half-up scale/100
184 ++ if (skeleton.indexOf("scale/100") >= 0) {
185 ++ return Style::PERCENT;
186 ++ } else {
187 ++ return Style::UNIT;
188 ++ }
189 ++ }
190 ++#endif
191 + return Style::DECIMAL;
192 + }
193 +
194
195 diff --git a/dev-qt/qtwebengine/qtwebengine-5.15.2.ebuild b/dev-qt/qtwebengine/qtwebengine-5.15.2.ebuild
196 index ae2669805a1..b0f613093dd 100644
197 --- a/dev-qt/qtwebengine/qtwebengine-5.15.2.ebuild
198 +++ b/dev-qt/qtwebengine/qtwebengine-5.15.2.ebuild
199 @@ -1,4 +1,4 @@
200 -# Copyright 1999-2020 Gentoo Authors
201 +# Copyright 1999-2021 Gentoo Authors
202 # Distributed under the terms of the GNU General Public License v2
203
204 EAPI=7
205 @@ -84,6 +84,7 @@ DEPEND="${RDEPEND}
206 PATCHES=(
207 "${FILESDIR}/${PN}-5.15.0-disable-fatal-warnings.patch" # bug 695446
208 "${FILESDIR}/${P}-icu-68.patch" # bug 751997, QTBUG-88116
209 + "${FILESDIR}/${P}-icu-68-v8-runtime-fix.patch"
210 )
211
212 src_prepare() {