[arch-commits] Commit in electron6/trunk (3 files)
Evangelos Foutras
foutrelis at archlinux.org
Wed Apr 29 14:23:03 UTC 2020
Date: Wednesday, April 29, 2020 @ 14:23:02
Author: foutrelis
Revision: 622262
Fix build with ICU 67 and clang 10
Added:
electron6/trunk/glslang-remove-setAllocator.patch
electron6/trunk/icu67.patch
Modified:
electron6/trunk/PKGBUILD
-----------------------------------+
PKGBUILD | 6 +
glslang-remove-setAllocator.patch | 24 +++++
icu67.patch | 164 ++++++++++++++++++++++++++++++++++++
3 files changed, 194 insertions(+)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2020-04-29 13:35:28 UTC (rev 622261)
+++ PKGBUILD 2020-04-29 14:23:02 UTC (rev 622262)
@@ -24,6 +24,8 @@
'default_app-icon.patch'
'use-system-libraries-in-node.patch'
'icu65.patch'
+ 'icu67.patch'
+ 'glslang-remove-setAllocator.patch'
'chromium-skia-harmony.patch')
sha512sums=('SKIP'
'SKIP'
@@ -31,6 +33,8 @@
'81a959a2873e868bb9394b1e5371d8c77f13f47d88c070016394188e96420ed64c8d6efa518e854f302ec4e6e7e17888d508f6a3598f433f6f82b8507639c0b7'
'147563fe422108598af26c617edf78d146d4e70223e3093216d5f63a1ab051eff95abd0c8f8c0b6f8a504ae26557d65cd0ffd90c542d6534176b72b99ea44a5e'
'd109937c4a5fba96e82d6fbc7b804943010d5723eef91af4f79355c8b84214da3978fc784dd0fcc3ed228c4684d0d06cf8cd21fa32fc5ec80c00d1bb4e3b9c90'
+ 'b46eeef32c7c773babe15da0c118ca55bf3c084142592695853a73f80b5dc55336cad72636f8ed2308fe9c10bcab953e37ca7ab08f20f545b881fe99a543d247'
+ 'e34562b4b6cf4f0afa3f23afe7336fed4614201b39bfb73871899081161f5927d273c1da14b3ab7edeeb803300ba6e07c1ddf7261e8be12555cbfc4fe0a0d23c'
'6fa7c5f737b3f86274b1f768aadf863dd7542fca9c8885d5c3804590bd04c288394c54b2003234be37d961f48b5470ce15254ba64b2716f8aceb181e1fd3c7c0')
_system_libs=('ffmpeg'
@@ -125,6 +129,8 @@
echo 'Applying local patches...'
patch -Np0 -i ../chromium-skia-harmony.patch
patch -Np1 -i ../icu65.patch
+ patch -Np1 -d v8 <../icu67.patch
+ patch -Np1 -d third_party/glslang/src <../glslang-remove-setAllocator.patch
patch -Np1 -i ../use-system-libraries-in-node.patch
patch -Np1 -i ../default_app-icon.patch # Icon from .desktop file
}
Added: glslang-remove-setAllocator.patch
===================================================================
--- glslang-remove-setAllocator.patch (rev 0)
+++ glslang-remove-setAllocator.patch 2020-04-29 14:23:02 UTC (rev 622262)
@@ -0,0 +1,24 @@
+From 24b3e8384e93f3e73b6aa14ea00a30574112f9ba Mon Sep 17 00:00:00 2001
+From: Reid Kleckner <rnk at google.com>
+Date: Wed, 4 Dec 2019 14:09:03 -0800
+Subject: [PATCH] Remove glslang::pool_allocator::setAllocator
+
+TPoolAllocator is not copy assignable, so this setter could never have
+been used. After a recent change (878a24ee2), new versions of Clang
+reject this code outright.
+---
+ glslang/Include/PoolAlloc.h | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/glslang/Include/PoolAlloc.h b/glslang/Include/PoolAlloc.h
+index 0e237a6a2..b8eccb883 100644
+--- a/glslang/Include/PoolAlloc.h
++++ b/glslang/Include/PoolAlloc.h
+@@ -304,7 +304,6 @@ class pool_allocator {
+ size_type max_size() const { return static_cast<size_type>(-1) / sizeof(T); }
+ size_type max_size(int size) const { return static_cast<size_type>(-1) / size; }
+
+- void setAllocator(TPoolAllocator* a) { allocator = *a; }
+ TPoolAllocator& getAllocator() const { return allocator; }
+
+ protected:
Added: icu67.patch
===================================================================
--- icu67.patch (rev 0)
+++ icu67.patch 2020-04-29 14:23:02 UTC (rev 622262)
@@ -0,0 +1,164 @@
+From d75a2d2661f5c0bec5e10653a2a17bbfa16de765 Mon Sep 17 00:00:00 2001
+From: Frank Tang <ftang at chromium.org>
+Date: Fri, 3 Apr 2020 23:13:54 -0700
+Subject: [PATCH] [intl] Remove soon-to-be removed getAllFieldPositions
+
+Needed to land ICU67.1 soon.
+
+Bug: v8:10393
+Change-Id: I3c7737ca600d6ccfdc46ffaddfb318ce60bc7618
+Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2136489
+Reviewed-by: Jakob Kummerow <jkummerow at chromium.org>
+Commit-Queue: Frank Tang <ftang at chromium.org>
+Cr-Commit-Position: refs/heads/master@{#67027}
+
+[foutrelis: rebased to 27646c1d2e for electron6]
+---
+ src/objects/js-number-format.cc | 72 +++++++++++++++++----------------
+ 1 file changed, 37 insertions(+), 35 deletions(-)
+
+diff --git a/src/objects/js-number-format.cc b/src/objects/js-number-format.cc
+index 67d545e0be..eb8324b51e 100644
+--- a/src/objects/js-number-format.cc
++++ b/src/objects/js-number-format.cc
+@@ -1252,42 +1252,31 @@ MaybeHandle<JSNumberFormat> JSNumberFormat::Initialize(
+ }
+
+ namespace {
+-Maybe<icu::UnicodeString> IcuFormatNumber(
++Maybe<bool> IcuFormatNumber(
+ Isolate* isolate,
+ const icu::number::LocalizedNumberFormatter& number_format,
+- Handle<Object> numeric_obj, icu::FieldPositionIterator* fp_iter) {
++ Handle<Object> numeric_obj, icu::number::FormattedNumber* formatted) {
+ // If it is BigInt, handle it differently.
+ UErrorCode status = U_ZERO_ERROR;
+- icu::number::FormattedNumber formatted;
+ if (numeric_obj->IsBigInt()) {
+ Handle<BigInt> big_int = Handle<BigInt>::cast(numeric_obj);
+ Handle<String> big_int_string;
+ ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, big_int_string,
+ BigInt::ToString(isolate, big_int),
+- Nothing<icu::UnicodeString>());
+- formatted = number_format.formatDecimal(
++ Nothing<bool>());
++ *formatted = number_format.formatDecimal(
+ {big_int_string->ToCString().get(), big_int_string->length()}, status);
+ } else {
+ double number = numeric_obj->Number();
+- formatted = number_format.formatDouble(number, status);
++ *formatted = number_format.formatDouble(number, status);
+ }
+ if (U_FAILURE(status)) {
+ // This happen because of icu data trimming trim out "unit".
+ // See https://bugs.chromium.org/p/v8/issues/detail?id=8641
+- THROW_NEW_ERROR_RETURN_VALUE(isolate,
+- NewTypeError(MessageTemplate::kIcuError),
+- Nothing<icu::UnicodeString>());
+- }
+- if (fp_iter) {
+- formatted.getAllFieldPositions(*fp_iter, status);
++ THROW_NEW_ERROR_RETURN_VALUE(
++ isolate, NewTypeError(MessageTemplate::kIcuError), Nothing<bool>());
+ }
+- icu::UnicodeString result = formatted.toString(status);
+- if (U_FAILURE(status)) {
+- THROW_NEW_ERROR_RETURN_VALUE(isolate,
+- NewTypeError(MessageTemplate::kIcuError),
+- Nothing<icu::UnicodeString>());
+- }
+- return Just(result);
++ return Just(true);
+ }
+
+ } // namespace
+@@ -1298,10 +1287,16 @@ MaybeHandle<String> JSNumberFormat::FormatNumeric(
+ Handle<Object> numeric_obj) {
+ DCHECK(numeric_obj->IsNumeric());
+
+- Maybe<icu::UnicodeString> maybe_format =
+- IcuFormatNumber(isolate, number_format, numeric_obj, nullptr);
++ icu::number::FormattedNumber formatted;
++ Maybe<bool> maybe_format =
++ IcuFormatNumber(isolate, number_format, numeric_obj, &formatted);
+ MAYBE_RETURN(maybe_format, Handle<String>());
+- return Intl::ToString(isolate, maybe_format.FromJust());
++ UErrorCode status = U_ZERO_ERROR;
++ icu::UnicodeString result = formatted.toString(status);
++ if (U_FAILURE(status)) {
++ THROW_NEW_ERROR(isolate, NewTypeError(MessageTemplate::kIcuError), String);
++ }
++ return Intl::ToString(isolate, result);
+ }
+
+ namespace {
+@@ -1414,12 +1409,18 @@ std::vector<NumberFormatSpan> FlattenRegionsToParts(
+ }
+
+ namespace {
+-Maybe<int> ConstructParts(Isolate* isolate, const icu::UnicodeString& formatted,
+- icu::FieldPositionIterator* fp_iter,
++Maybe<int> ConstructParts(Isolate* isolate,
++ icu::number::FormattedNumber* formatted,
+ Handle<JSArray> result, int start_index,
+ Handle<Object> numeric_obj, Handle<String> unit) {
++ UErrorCode status = U_ZERO_ERROR;
++ icu::UnicodeString formatted_text = formatted->toString(status);
++ if (U_FAILURE(status)) {
++ THROW_NEW_ERROR_RETURN_VALUE(
++ isolate, NewTypeError(MessageTemplate::kIcuError), Nothing<int>());
++ }
+ DCHECK(numeric_obj->IsNumeric());
+- int32_t length = formatted.length();
++ int32_t length = formatted_text.length();
+ int index = start_index;
+ if (length == 0) return Just(index);
+
+@@ -1428,13 +1429,14 @@ Maybe<int> ConstructParts(Isolate* isolate, const icu::UnicodeString& formatted,
+ // other region covers some part of the formatted string. It's possible
+ // there's another field with exactly the same begin and end as this backdrop,
+ // in which case the backdrop's field_id of -1 will give it lower priority.
+- regions.push_back(NumberFormatSpan(-1, 0, formatted.length()));
++ regions.push_back(NumberFormatSpan(-1, 0, formatted_text.length()));
+
+ {
+- icu::FieldPosition fp;
+- while (fp_iter->next(fp)) {
+- regions.push_back(NumberFormatSpan(fp.getField(), fp.getBeginIndex(),
+- fp.getEndIndex()));
++ icu::ConstrainedFieldPosition cfp;
++ cfp.constrainCategory(UFIELD_CATEGORY_NUMBER);
++ while (formatted->nextPosition(cfp, status)) {
++ regions.push_back(
++ NumberFormatSpan(cfp.getField(), cfp.getStart(), cfp.getLimit()));
+ }
+ }
+
+@@ -1449,7 +1451,7 @@ Maybe<int> ConstructParts(Isolate* isolate, const icu::UnicodeString& formatted,
+ Handle<String> substring;
+ ASSIGN_RETURN_ON_EXCEPTION_VALUE(
+ isolate, substring,
+- Intl::ToString(isolate, formatted, part.begin_pos, part.end_pos),
++ Intl::ToString(isolate, formatted_text, part.begin_pos, part.end_pos),
+ Nothing<int>());
+ if (unit.is_null()) {
+ Intl::AddElement(isolate, result, index, field_type_string, substring);
+@@ -1474,14 +1476,14 @@ MaybeHandle<JSArray> JSNumberFormat::FormatToParts(
+ number_format->icu_number_formatter().raw();
+ CHECK_NOT_NULL(fmt);
+
+- icu::FieldPositionIterator fp_iter;
+- Maybe<icu::UnicodeString> maybe_format =
+- IcuFormatNumber(isolate, *fmt, numeric_obj, &fp_iter);
++ icu::number::FormattedNumber formatted;
++ Maybe<bool> maybe_format =
++ IcuFormatNumber(isolate, *fmt, numeric_obj, &formatted);
+ MAYBE_RETURN(maybe_format, Handle<JSArray>());
+
+ Handle<JSArray> result = factory->NewJSArray(0);
+ Maybe<int> maybe_format_to_parts =
+- ConstructParts(isolate, maybe_format.FromJust(), &fp_iter, result, 0,
++ ConstructParts(isolate, &formatted, result, 0,
+ numeric_obj, Handle<String>());
+ MAYBE_RETURN(maybe_format_to_parts, Handle<JSArray>());
+
More information about the arch-commits
mailing list