From d332ade60e828db095faefd5ecc6495bb396c4b3 Mon Sep 17 00:00:00 2001 From: Alessio Sergi Date: Sun, 7 May 2017 15:50:13 +0200 Subject: [PATCH] nodejs: fix build with icu-59 --- srcpkgs/nodejs/patches/v8-icu59.patch | 59 +++++++++++++++++++++++++++ srcpkgs/nodejs/template | 4 +- 2 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 srcpkgs/nodejs/patches/v8-icu59.patch diff --git a/srcpkgs/nodejs/patches/v8-icu59.patch b/srcpkgs/nodejs/patches/v8-icu59.patch new file mode 100644 index 00000000000..a89325e0d9f --- /dev/null +++ b/srcpkgs/nodejs/patches/v8-icu59.patch @@ -0,0 +1,59 @@ +https://codereview.chromium.org/2738503008 + +--- deps/v8/src/i18n.cc.orig ++++ deps/v8/src/i18n.cc +@@ -30,8 +30,13 @@ + #include "unicode/ucol.h" + #include "unicode/ucurr.h" + #include "unicode/unum.h" ++#include "unicode/uvernum.h" + #include "unicode/uversion.h" + ++#if U_ICU_VERSION_MAJOR_NUM >= 59 ++#include "unicode/char16ptr.h" ++#endif ++ + namespace v8 { + namespace internal { + +@@ -270,8 +275,13 @@ icu::DecimalFormat* CreateICUNumberFormat( + } + + UErrorCode status_digits = U_ZERO_ERROR; ++#if U_ICU_VERSION_MAJOR_NUM >= 59 + uint32_t fraction_digits = ucurr_getDefaultFractionDigits( +- currency.getTerminatedBuffer(), &status_digits); ++ icu::toUCharPtr(currency.getTerminatedBuffer()), &status_digits); ++#else ++ uint32_t fraction_digits = ucurr_getDefaultFractionDigits( ++ currency.getTerminatedBuffer(), &status_digits); ++#endif + if (U_SUCCESS(status_digits)) { + number_format->setMinimumFractionDigits(fraction_digits); + number_format->setMaximumFractionDigits(fraction_digits); +--- deps/v8/src/runtime/runtime-i18n.cc.orig ++++ deps/v8/src/runtime/runtime-i18n.cc +@@ -43,6 +43,7 @@ + #include "unicode/uloc.h" + #include "unicode/unistr.h" + #include "unicode/unum.h" ++#include "unicode/ustring.h" + #include "unicode/uversion.h" + + +@@ -609,10 +610,11 @@ RUNTIME_FUNCTION(Runtime_InternalCompare) { + String::FlatContent flat2 = string2->GetFlatContent(); + std::unique_ptr sap1; + std::unique_ptr sap2; +- const UChar* string_val1 = GetUCharBufferFromFlat(flat1, &sap1, length1); +- const UChar* string_val2 = GetUCharBufferFromFlat(flat2, &sap2, length2); +- result = +- collator->compare(string_val1, length1, string_val2, length2, status); ++ icu::UnicodeString string_val1( ++ FALSE, GetUCharBufferFromFlat(flat1, &sap1, length1), length1); ++ icu::UnicodeString string_val2( ++ FALSE, GetUCharBufferFromFlat(flat2, &sap2, length2), length2); ++ result = collator->compare(string_val1, string_val2, status); + } + if (U_FAILURE(status)) return isolate->ThrowIllegalOperation(); + diff --git a/srcpkgs/nodejs/template b/srcpkgs/nodejs/template index c79dceb5ae8..28e09de4f22 100644 --- a/srcpkgs/nodejs/template +++ b/srcpkgs/nodejs/template @@ -1,7 +1,7 @@ # Template file for 'nodejs' pkgname=nodejs version=7.10.0 -revision=1 +revision=2 wrksrc=node-v${version} hostmakedepends="pkg-config python $(vopt_if icu icu)" makedepends="zlib-devel python-devel $(vopt_if icu icu-devel) @@ -21,7 +21,7 @@ build_options="ssl libuv http_parser icu" desc_option_libuv="Enable shared libuv" desc_option_http_parser="Enable shared http-parser" desc_option_icu="Enable shared icu" -build_options_default="libuv http_parser" +build_options_default="libuv http_parser icu" replaces="iojs>=0"