community/nodejs to 7.9.0-2

This commit is contained in:
Kevin Mihelich 2017-04-29 16:36:39 +00:00
parent 0686436d00
commit 335d83c8aa
2 changed files with 69 additions and 1 deletions

View file

@ -10,7 +10,7 @@
pkgname=nodejs
pkgver=7.9.0
pkgrel=1
pkgrel=2
pkgdesc='Evented I/O for V8 javascript'
arch=('i686' 'x86_64')
url='http://nodejs.org/'
@ -20,8 +20,10 @@ depends=('openssl-1.0' 'zlib' 'icu' 'libuv' 'http-parser' 'c-ares') # 'v8')
makedepends=('python2' 'procps-ng')
optdepends=('npm: nodejs package manager')
source=("nodejs-$pkgver.tar.gz::https://github.com/nodejs/node/archive/v$pkgver.tar.gz"
'nodejs-v8-icu59.patch'
'0001-arm-fixes.patch')
sha256sums=('77b8f773ad7eca17e56e8d25f66be862999d6479a06767efe5ccf64f2dfd03ea'
'38ffab18dd2cbb9ac2ee5f4cedffae6943abeb479427eeebd3e2870981cb089b'
'6115d4500d16254cc706e8a4f534f714f3fac7e3b90a06d19264246a55e7f36a')
set_flags_for_arm() {
@ -46,6 +48,9 @@ set_flags_for_arm() {
prepare() {
cd node-$pkgver
# https://github.com/nodejs/node/pull/11754#issuecomment-285407461
patch -Np1 -d deps/v8 <../nodejs-v8-icu59.patch
patch -p1 -i ../0001-arm-fixes.patch
msg 'Fixing for python2 name'

View file

@ -0,0 +1,63 @@
Index: src/i18n.cc
diff --git a/src/i18n.cc b/src/i18n.cc
index d2245ef34a9a319a53b4cf4b4ea05ec095fef2d5..7c22871ff5e440f771659d44a0db013b34ec2105 100644
--- a/src/i18n.cc
+++ b/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);
Index: src/runtime/runtime-i18n.cc
diff --git a/src/runtime/runtime-i18n.cc b/src/runtime/runtime-i18n.cc
index 0b45381914641a824e36e99eaa0d315bf96252aa..e89175a37db11aa6990888e26e6bb989cf7c36b5 100644
--- a/src/runtime/runtime-i18n.cc
+++ b/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<uc16[]> sap1;
std::unique_ptr<uc16[]> 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();