public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Marek Szuba" <marecki@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: net-libs/nodejs/, net-libs/nodejs/files/
Date: Tue, 20 Apr 2021 17:48:54 +0000 (UTC)	[thread overview]
Message-ID: <1618940920.75c8059bb0bc595deff3cadcc1195e1ffdf0f385.marecki@gentoo> (raw)

commit:     75c8059bb0bc595deff3cadcc1195e1ffdf0f385
Author:     Marek Szuba <marecki <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 20 17:17:14 2021 +0000
Commit:     Marek Szuba <marecki <AT> gentoo <DOT> org>
CommitDate: Tue Apr 20 17:48:40 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=75c8059b

net-libs/nodejs: support dev-libs/icu-69.1

The version of V8 bundled with all versions of NodeJS currently in the
tree calls ListFormatter::createInstance() in a way that is both marked
as internal in icu-68 and absent from icu-69. Apply a fix originally
developed from Chromium which switches to a style marked as stable since
icu-67, meaning it works with both versions of dev-libs/icu currently in
the tree (confirmed by building 12.22.1 against both, with USE=icu of
course).

Closes: https://bugs.gentoo.org/781287
Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>

 .../nodejs/files/nodejs-12.22.1-v8_icu69.patch     | 85 ++++++++++++++++++++++
 .../nodejs/files/nodejs-14.16.1-v8_icu69.patch     | 84 +++++++++++++++++++++
 net-libs/nodejs/nodejs-12.22.1.ebuild              |  1 +
 net-libs/nodejs/nodejs-14.16.1.ebuild              |  1 +
 net-libs/nodejs/nodejs-15.14.0.ebuild              |  1 +
 5 files changed, 172 insertions(+)

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
new file mode 100644
index 00000000000..bd6d5c64b02
--- /dev/null
+++ b/net-libs/nodejs/files/nodejs-12.22.1-v8_icu69.patch
@@ -0,0 +1,85 @@
+Port of the Chromium commit 035c305ce7761f51328b45f1bd83e26aef267c9d to node-v12.
+Original commit message follows.
+
+Author:     Frank Tang <ftang@chromium.org>
+AuthorDate: 2020-10-15 22:44:27 -0700
+Commit:     Commit Bot <commit-bot@chromium.org>
+CommitDate: 2020-10-20 02:08:13 +0000
+[Intl] call new ListFormatter::createInstance
+The one we currently using is now marked as internal and to be removed
+for 68. Migrating to the style which already avaiable in ICU 67-1.
+
+--- a/deps/v8/src/objects/js-list-format.cc
++++ b/deps/v8/src/objects/js-list-format.cc
+@@ -29,46 +29,27 @@
+ namespace internal {
+ 
+ namespace {
+-const char* kStandard = "standard";
+-const char* kOr = "or";
+-const char* kUnit = "unit";
+-const char* kStandardShort = "standard-short";
+-const char* kOrShort = "or-short";
+-const char* kUnitShort = "unit-short";
+-const char* kStandardNarrow = "standard-narrow";
+-const char* kOrNarrow = "or-narrow";
+-const char* kUnitNarrow = "unit-narrow";
+ 
+-const char* GetIcuStyleString(JSListFormat::Style style,
+-                              JSListFormat::Type type) {
++UListFormatterWidth GetIcuWidth(JSListFormat::Style style) {
++  switch (style) {
++    case JSListFormat::Style::LONG:
++      return ULISTFMT_WIDTH_WIDE;
++    case JSListFormat::Style::SHORT:
++      return ULISTFMT_WIDTH_SHORT;
++    case JSListFormat::Style::NARROW:
++      return ULISTFMT_WIDTH_NARROW;
++  }
++  UNREACHABLE();
++}
++
++UListFormatterType GetIcuType(JSListFormat::Type type) {
+   switch (type) {
+     case JSListFormat::Type::CONJUNCTION:
+-      switch (style) {
+-        case JSListFormat::Style::LONG:
+-          return kStandard;
+-        case JSListFormat::Style::SHORT:
+-          return kStandardShort;
+-        case JSListFormat::Style::NARROW:
+-          return kStandardNarrow;
+-      }
++      return ULISTFMT_TYPE_AND;
+     case JSListFormat::Type::DISJUNCTION:
+-      switch (style) {
+-        case JSListFormat::Style::LONG:
+-          return kOr;
+-        case JSListFormat::Style::SHORT:
+-          return kOrShort;
+-        case JSListFormat::Style::NARROW:
+-          return kOrNarrow;
+-      }
++      return ULISTFMT_TYPE_OR;
+     case JSListFormat::Type::UNIT:
+-      switch (style) {
+-        case JSListFormat::Style::LONG:
+-          return kUnit;
+-        case JSListFormat::Style::SHORT:
+-          return kUnitShort;
+-        case JSListFormat::Style::NARROW:
+-          return kUnitNarrow;
+-      }
++      return ULISTFMT_TYPE_UNITS;
+   }
+   UNREACHABLE();
+ }
+@@ -170,7 +151,7 @@
+   icu::Locale icu_locale = r.icu_locale;
+   UErrorCode status = U_ZERO_ERROR;
+   icu::ListFormatter* formatter = icu::ListFormatter::createInstance(
+-      icu_locale, GetIcuStyleString(style_enum, type_enum), status);
++      icu_locale, GetIcuType(type_enum), GetIcuWidth(style_enum), status);
+   if (U_FAILURE(status)) {
+     delete formatter;
+     FATAL("Failed to create ICU list formatter, are ICU data files missing?");

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
new file mode 100644
index 00000000000..d1e204f0c5d
--- /dev/null
+++ b/net-libs/nodejs/files/nodejs-14.16.1-v8_icu69.patch
@@ -0,0 +1,84 @@
+Port of the Chromium commit 035c305ce7761f51328b45f1bd83e26aef267c9d to node-v14.
+Original commit message follows.
+
+Author:     Frank Tang <ftang@chromium.org>
+AuthorDate: 2020-10-15 22:44:27 -0700
+Commit:     Commit Bot <commit-bot@chromium.org>
+CommitDate: 2020-10-20 02:08:13 +0000
+[Intl] call new ListFormatter::createInstance
+The one we currently using is now marked as internal and to be removed
+for 68. Migrating to the style which already avaiable in ICU 67-1.
+
+--- a/deps/v8/src/objects/js-list-format.cc
++++ b/deps/v8/src/objects/js-list-format.cc
+@@ -29,46 +29,26 @@
+ namespace internal {
+ 
+ namespace {
+-const char* kStandard = "standard";
+-const char* kOr = "or";
+-const char* kUnit = "unit";
+-const char* kStandardShort = "standard-short";
+-const char* kOrShort = "or-short";
+-const char* kUnitShort = "unit-short";
+-const char* kStandardNarrow = "standard-narrow";
+-const char* kOrNarrow = "or-narrow";
+-const char* kUnitNarrow = "unit-narrow";
++UListFormatterWidth GetIcuWidth(JSListFormat::Style style) {
++  switch (style) {
++    case JSListFormat::Style::LONG:
++      return ULISTFMT_WIDTH_WIDE;
++    case JSListFormat::Style::SHORT:
++      return ULISTFMT_WIDTH_SHORT;
++    case JSListFormat::Style::NARROW:
++      return ULISTFMT_WIDTH_NARROW;
++  }
++  UNREACHABLE();
++}
+ 
+-const char* GetIcuStyleString(JSListFormat::Style style,
+-                              JSListFormat::Type type) {
++UListFormatterType GetIcuType(JSListFormat::Type type) {
+   switch (type) {
+     case JSListFormat::Type::CONJUNCTION:
+-      switch (style) {
+-        case JSListFormat::Style::LONG:
+-          return kStandard;
+-        case JSListFormat::Style::SHORT:
+-          return kStandardShort;
+-        case JSListFormat::Style::NARROW:
+-          return kStandardNarrow;
+-      }
++      return ULISTFMT_TYPE_AND;
+     case JSListFormat::Type::DISJUNCTION:
+-      switch (style) {
+-        case JSListFormat::Style::LONG:
+-          return kOr;
+-        case JSListFormat::Style::SHORT:
+-          return kOrShort;
+-        case JSListFormat::Style::NARROW:
+-          return kOrNarrow;
+-      }
++      return ULISTFMT_TYPE_OR;
+     case JSListFormat::Type::UNIT:
+-      switch (style) {
+-        case JSListFormat::Style::LONG:
+-          return kUnit;
+-        case JSListFormat::Style::SHORT:
+-          return kUnitShort;
+-        case JSListFormat::Style::NARROW:
+-          return kUnitNarrow;
+-      }
++      return ULISTFMT_TYPE_UNITS;
+   }
+   UNREACHABLE();
+ }
+@@ -143,7 +123,7 @@
+   icu::Locale icu_locale = r.icu_locale;
+   UErrorCode status = U_ZERO_ERROR;
+   icu::ListFormatter* formatter = icu::ListFormatter::createInstance(
+-      icu_locale, GetIcuStyleString(style_enum, type_enum), status);
++      icu_locale, GetIcuType(type_enum), GetIcuWidth(style_enum), status);
+   if (U_FAILURE(status) || formatter == nullptr) {
+     delete formatter;
+     THROW_NEW_ERROR(isolate, NewRangeError(MessageTemplate::kIcuError),

diff --git a/net-libs/nodejs/nodejs-12.22.1.ebuild b/net-libs/nodejs/nodejs-12.22.1.ebuild
index 09249518e7e..4d8fd536264 100644
--- a/net-libs/nodejs/nodejs-12.22.1.ebuild
+++ b/net-libs/nodejs/nodejs-12.22.1.ebuild
@@ -47,6 +47,7 @@ DEPEND="
 PATCHES=(
 	"${FILESDIR}"/${PN}-10.3.0-global-npm-config.patch
 	"${FILESDIR}"/${PN}-12.20.1-fix_ppc64_crashes.patch
+	"${FILESDIR}"/${PN}-12.22.1-v8_icu69.patch
 	"${FILESDIR}"/${PN}-99999999-llhttp.patch
 )
 RESTRICT="test"

diff --git a/net-libs/nodejs/nodejs-14.16.1.ebuild b/net-libs/nodejs/nodejs-14.16.1.ebuild
index b9e5858aaa6..c7c510655c8 100644
--- a/net-libs/nodejs/nodejs-14.16.1.ebuild
+++ b/net-libs/nodejs/nodejs-14.16.1.ebuild
@@ -43,6 +43,7 @@ DEPEND="${RDEPEND}"
 PATCHES=(
 	"${FILESDIR}"/${PN}-10.3.0-global-npm-config.patch
 	"${FILESDIR}"/${PN}-14.15.0-fix_ppc64_crashes.patch
+	"${FILESDIR}"/${PN}-14.16.1-v8_icu69.patch
 )
 
 S="${WORKDIR}/node-v${PV}"

diff --git a/net-libs/nodejs/nodejs-15.14.0.ebuild b/net-libs/nodejs/nodejs-15.14.0.ebuild
index 3b317ab08c9..9ef4cb031dd 100644
--- a/net-libs/nodejs/nodejs-15.14.0.ebuild
+++ b/net-libs/nodejs/nodejs-15.14.0.ebuild
@@ -41,6 +41,7 @@ BDEPEND="${PYTHON_DEPS}
 DEPEND="${RDEPEND}"
 
 PATCHES=(
+	"${FILESDIR}"/${PN}-14.16.1-v8_icu69.patch
 	"${FILESDIR}"/${PN}-15.2.0-global-npm-config.patch
 )
 


             reply	other threads:[~2021-04-20 17:48 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-20 17:48 Marek Szuba [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-06-25 16:45 [gentoo-commits] repo/gentoo:master commit in: net-libs/nodejs/, net-libs/nodejs/files/ Jakov Smolić
2024-02-04  0:37 Jakov Smolić
2024-01-22 21:16 William Hubbs
2023-11-02 21:34 William Hubbs
2023-08-09 19:21 William Hubbs
2023-06-10 19:32 William Hubbs
2023-05-05 15:16 William Hubbs
2023-04-30  1:24 William Hubbs
2022-05-06  5:21 Joonas Niilola
2022-03-17 21:39 William Hubbs
2021-09-16 16:42 Marek Szuba
2021-08-13 17:36 Marek Szuba
2021-05-13 21:36 Marek Szuba
2021-05-13 15:30 Georgy Yakovlev
2021-04-22 15:27 Marek Szuba
2020-11-20 20:28 William Hubbs
2020-08-27 17:48 Jeroen Roovers
2020-02-17  0:38 Magnus Granberg
2018-12-13 12:12 Jeroen Roovers
2018-12-09 14:59 Jeroen Roovers
2018-05-30  7:46 Jeroen Roovers
2017-11-02 22:59 Jeroen Roovers
2017-11-01 11:42 Jeroen Roovers
2016-02-11 12:07 Patrick Lauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1618940920.75c8059bb0bc595deff3cadcc1195e1ffdf0f385.marecki@gentoo \
    --to=marecki@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox