Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Sep 2017 14:39:53 +0000 (UTC)
From:      Jan Beich <jbeich@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r449690 - in head/lang/phantomjs: . files
Message-ID:  <201709121439.v8CEdrVs061998@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jbeich
Date: Tue Sep 12 14:39:53 2017
New Revision: 449690
URL: https://svnweb.freebsd.org/changeset/ports/449690

Log:
  lang/phantomjs: unbreak with ICU 59.1
  
  API/JSStringRef.cpp:40:12: error: no matching function for call to 'create'
      return OpaqueJSString::create(chars, numChars).leakRef();
             ^~~~~~~~~~~~~~~~~~~~~~
  API/OpaqueJSString.h:44:39: note: candidate function not viable: no known conversion from 'const JSChar *' (aka 'const unsigned short *') to 'const LChar *' (aka 'const unsigned char *') for 1st argument
      static PassRefPtr<OpaqueJSString> create(const LChar* characters, unsigned length)
                                        ^
  API/OpaqueJSString.h:49:39: note: candidate function not viable: no known conversion from 'const JSChar *' (aka 'const unsigned short *') to 'const UChar *' (aka 'const char16_t *') for 1st argument
      static PassRefPtr<OpaqueJSString> create(const UChar* characters, unsigned length)
                                        ^
  API/OpaqueJSString.h:39:39: note: candidate function not viable: requires 0 arguments, but 2 were provided
      static PassRefPtr<OpaqueJSString> create() // null
                                        ^
  API/OpaqueJSString.h:54:57: note: candidate function not viable: requires 1 argument, but 2 were provided
      JS_EXPORT_PRIVATE static PassRefPtr<OpaqueJSString> create(const String&);
                                                          ^
  API/JSStringRef.cpp:65:35: error: no matching function for call to 'createWithoutCopying'
      return OpaqueJSString::create(StringImpl::createWithoutCopying(chars, numChars, WTF::DoesNotHaveTerminatingNullCharacter)).leakRef();
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ../WTF/wtf/text/StringImpl.h:431:57: note: candidate function not viable: no known conversion from 'const JSChar *' (aka 'const unsigned short *') to 'const UChar *' (aka 'const char16_t *') for 1st argument
      WTF_EXPORT_STRING_API static PassRefPtr<StringImpl> createWithoutCopying(const UChar* characters, unsigned length, HasTerminatingNullCharacter);
                                                          ^
  ../WTF/wtf/text/StringImpl.h:432:57: note: candidate function not viable: no known conversion from 'const JSChar *' (aka 'const unsigned short *') to 'const LChar *' (aka 'const unsigned char *') for 1st argument
      WTF_EXPORT_STRING_API static PassRefPtr<StringImpl> createWithoutCopying(const LChar* characters, unsigned length, HasTerminatingNullCharacter);
                                                          ^
  API/JSStringRef.cpp:86:12: error: cannot initialize return object of type 'const JSChar *' (aka 'const unsigned short *') with an rvalue of type 'const UChar *' (aka 'const char16_t *')
      return string->characters();
             ^~~~~~~~~~~~~~~~~~~~
  
  PR:		222222
  Obtained from:	upstream (WebKit, rebased)

Added:
  head/lang/phantomjs/files/patch-icu59   (contents, props changed)
Modified:
  head/lang/phantomjs/Makefile   (contents, props changed)

Modified: head/lang/phantomjs/Makefile
==============================================================================
--- head/lang/phantomjs/Makefile	Tue Sep 12 14:39:44 2017	(r449689)
+++ head/lang/phantomjs/Makefile	Tue Sep 12 14:39:53 2017	(r449690)
@@ -2,7 +2,7 @@
 
 PORTNAME=	phantomjs
 PORTVERSION=	2.1.1
-PORTREVISION=	4
+PORTREVISION=	5
 CATEGORIES=	lang
 
 MAINTAINER=	feld@FreeBSD.org

Added: head/lang/phantomjs/files/patch-icu59
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/phantomjs/files/patch-icu59	Tue Sep 12 14:39:53 2017	(r449690)
@@ -0,0 +1,64 @@
+------------------------------------------------------------------------
+r216187 | annulen@yandex.ru | 2017-05-05 00:33:41 +0900 (Fri, 05 May 2017) | 28 lines
+
+Fix compilation with ICU 59.1
+https://bugs.webkit.org/show_bug.cgi?id=171612
+
+Reviewed by Mark Lam.
+
+ICU 59.1 has broken source compatibility. Now it defines UChar as
+char16_t, which does not allow automatic type conversion from unsigned
+short in C++ code.
+
+--- src/qt/qtwebkit/Source/JavaScriptCore/API/JSStringRef.cpp.orig	2016-01-08 10:07:46 UTC
++++ src/qt/qtwebkit/Source/JavaScriptCore/API/JSStringRef.cpp
+@@ -37,7 +37,7 @@ using namespace WTF::Unicode;
+ JSStringRef JSStringCreateWithCharacters(const JSChar* chars, size_t numChars)
+ {
+     initializeThreading();
+-    return OpaqueJSString::create(chars, numChars).leakRef();
++    return OpaqueJSString::create(reinterpret_cast<const UChar*>(chars), numChars).leakRef();
+ }
+ 
+ JSStringRef JSStringCreateWithUTF8CString(const char* string)
+@@ -62,7 +62,7 @@ JSStringRef JSStringCreateWithUTF8CString(const char* 
+ JSStringRef JSStringCreateWithCharactersNoCopy(const JSChar* chars, size_t numChars)
+ {
+     initializeThreading();
+-    return OpaqueJSString::create(StringImpl::createWithoutCopying(chars, numChars, WTF::DoesNotHaveTerminatingNullCharacter)).leakRef();
++    return OpaqueJSString::create(StringImpl::createWithoutCopying(reinterpret_cast<const UChar*>(chars), numChars, WTF::DoesNotHaveTerminatingNullCharacter)).leakRef();
+ }
+ 
+ JSStringRef JSStringRetain(JSStringRef string)
+@@ -83,7 +83,7 @@ size_t JSStringGetLength(JSStringRef string)
+ 
+ const JSChar* JSStringGetCharactersPtr(JSStringRef string)
+ {
+-    return string->characters();
++    return reinterpret_cast<const JSChar*>(string->characters());
+ }
+ 
+ size_t JSStringGetMaximumUTF8CStringSize(JSStringRef string)
+--- src/qt/qtwebkit/Source/JavaScriptCore/runtime/DateConversion.cpp.orig	2016-01-08 10:07:46 UTC
++++ src/qt/qtwebkit/Source/JavaScriptCore/runtime/DateConversion.cpp
+@@ -107,7 +107,8 @@ String formatDateTime(const GregorianDateTime& t, Date
+ #if OS(WINDOWS)
+             TIME_ZONE_INFORMATION timeZoneInformation;
+             GetTimeZoneInformation(&timeZoneInformation);
+-            const WCHAR* timeZoneName = t.isDST() ? timeZoneInformation.DaylightName : timeZoneInformation.StandardName;
++            const WCHAR* winTimeZoneName = t.isDST() ? timeZoneInformation.DaylightName : timeZoneInformation.StandardName;
++            String timeZoneName(reinterpret_cast<const UChar*>(winTimeZoneName));
+ #else
+             struct tm gtm = t;
+             char timeZoneName[70];
+--- src/qt/qtwebkit/Source/WebKit2/Shared/API/c/WKString.cpp.orig	2016-01-08 10:07:46 UTC
++++ src/qt/qtwebkit/Source/WebKit2/Shared/API/c/WKString.cpp
+@@ -55,7 +55,7 @@ size_t WKStringGetLength(WKStringRef stringRef)
+ size_t WKStringGetCharacters(WKStringRef stringRef, WKChar* buffer, size_t bufferLength)
+ {
+     COMPILE_ASSERT(sizeof(WKChar) == sizeof(UChar), WKStringGetCharacters_sizeof_WKChar_matches_UChar);
+-    return (toImpl(stringRef)->getCharacters(static_cast<UChar*>(buffer), bufferLength));
++    return (toImpl(stringRef)->getCharacters(reinterpret_cast<UChar*>(buffer), bufferLength));
+ }
+ 
+ size_t WKStringGetMaximumUTF8CStringSize(WKStringRef stringRef)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201709121439.v8CEdrVs061998>