diff options
author | ryoon <ryoon@pkgsrc.org> | 2021-04-22 17:33:04 +0000 |
---|---|---|
committer | ryoon <ryoon@pkgsrc.org> | 2021-04-22 17:33:04 +0000 |
commit | 620dec05deb432a78dc4d12235849e2c07cca0ac (patch) | |
tree | 42932f18a465123702caa4412746c7db3bfc632a /lang/nodejs | |
parent | ca9755b4aceb4117c3fc5025f6fa87e29c5cacc2 (diff) | |
download | pkgsrc-620dec05deb432a78dc4d12235849e2c07cca0ac.tar.gz |
nodejs: Add a patch really and remove obsolete comment
Noticed by adam@. Thank you.
Diffstat (limited to 'lang/nodejs')
-rw-r--r-- | lang/nodejs/Makefile | 3 | ||||
-rw-r--r-- | lang/nodejs/patches/patch-deps_v8_src_objects_js-list-format.cc | 46 |
2 files changed, 47 insertions, 2 deletions
diff --git a/lang/nodejs/Makefile b/lang/nodejs/Makefile index 9a1acdc8ef4..b0d2c47b572 100644 --- a/lang/nodejs/Makefile +++ b/lang/nodejs/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.211 2021/04/22 15:52:25 ryoon Exp $ +# $NetBSD: Makefile,v 1.212 2021/04/22 17:33:04 ryoon Exp $ DISTNAME= node-v14.16.1 EXTRACT_SUFX= .tar.xz @@ -12,7 +12,6 @@ PKGREVISION= 2 MAKE_ENV+= LD_LIBRARY_PATH=${PREFIX}/lib CONFIGURE_ARGS+= --shared-nghttp2 -# ICU 69.1: error: 'createInstance' is a private member of 'icu_69::ListFormatter' CONFIGURE_ARGS+= --with-intl=system-icu PYTHON_VERSIONS_ACCEPTED= 27 diff --git a/lang/nodejs/patches/patch-deps_v8_src_objects_js-list-format.cc b/lang/nodejs/patches/patch-deps_v8_src_objects_js-list-format.cc new file mode 100644 index 00000000000..33c2534a770 --- /dev/null +++ b/lang/nodejs/patches/patch-deps_v8_src_objects_js-list-format.cc @@ -0,0 +1,46 @@ +$NetBSD: patch-deps_v8_src_objects_js-list-format.cc,v 1.1 2021/04/22 17:33:04 ryoon Exp $ + +* Fix build with ICU 69.1. Backported from 16.0.0. + +--- deps/v8/src/objects/js-list-format.cc.orig 2021-04-06 19:42:15.000000000 +0000 ++++ deps/v8/src/objects/js-list-format.cc +@@ -73,6 +73,30 @@ const char* GetIcuStyleString(JSListForm + UNREACHABLE(); + } + ++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: ++ return ULISTFMT_TYPE_AND; ++ case JSListFormat::Type::DISJUNCTION: ++ return ULISTFMT_TYPE_OR; ++ case JSListFormat::Type::UNIT: ++ return ULISTFMT_TYPE_UNITS; ++ } ++ UNREACHABLE(); ++} ++ + } // namespace + + MaybeHandle<JSListFormat> JSListFormat::New(Isolate* isolate, Handle<Map> map, +@@ -143,7 +167,7 @@ MaybeHandle<JSListFormat> JSListFormat:: + 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), |