[packages/phantomjs] - fix qtwebkit build with icu59 and gcc 6.x c++11

baggins baggins at pld-linux.org
Wed Apr 26 20:29:29 CEST 2017


commit 310b97643ebdea85e78c1b69b38aa6930a3164a2
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Wed Apr 26 20:29:12 2017 +0200

    - fix qtwebkit build with icu59 and gcc 6.x c++11

 phantomjs.spec                |  5 +++++
 qtwebkit-icu59.patch          | 38 ++++++++++++++++++++++++++++++++++++++
 qtwebkit-new-char-types.patch | 35 +++++++++++++++++++++++++++++++++++
 3 files changed, 78 insertions(+)
---
diff --git a/phantomjs.spec b/phantomjs.spec
index d106930..21c708f 100644
--- a/phantomjs.spec
+++ b/phantomjs.spec
@@ -30,6 +30,8 @@ Patch101:	qtbase.diff.xz
 # Patch101-md5:	8e8fb4b12c672ecd128fbcf1fccd964b
 Patch102:	qtwebkit.diff.xz
 # Patch102-md5:	ab3a7372ea3f7bb6326e666ffad7acda
+Patch201:	qtwebkit-icu59.patch
+Patch202:	qtwebkit-new-char-types.patch
 URL:		http://phantomjs.org/
 BuildRequires:	linenoise-devel
 BuildRequires:	mongoose-devel
@@ -90,6 +92,9 @@ mv qtwebkit-* src/qt/qtwebkit
 %patch101 -p1 -d src/qt/qtbase
 %patch102 -p1 -d src/qt/qtwebkit
 
+%patch201 -p1 -d src/qt/qtwebkit
+%patch202 -p1 -d src/qt/qtwebkit
+
 # https://github.com/ariya/phantomjs/issues/13930
 # otherwise we get this error:
 # https://bugreports.qt.io/browse/QTBUG-48626
diff --git a/qtwebkit-icu59.patch b/qtwebkit-icu59.patch
new file mode 100644
index 0000000..a7c190e
--- /dev/null
+++ b/qtwebkit-icu59.patch
@@ -0,0 +1,38 @@
+--- qtwebkit-opensource-src-5.5.1/Source/JavaScriptCore/API/JSStringRef.h.orig	2015-10-13 06:37:10.000000000 +0200
++++ qtwebkit-opensource-src-5.5.1/Source/JavaScriptCore/API/JSStringRef.h	2017-04-24 12:26:42.495345570 +0200
+@@ -32,6 +32,7 @@
+ #include <stdbool.h>
+ #endif
+ #include <stddef.h> /* for size_t */
++#include <uchar.h>
+ 
+ #ifdef __cplusplus
+ extern "C" {
+@@ -43,7 +44,7 @@
+ @typedef JSChar
+ @abstract A Unicode character.
+ */
+-    typedef unsigned short JSChar;
++    typedef char16_t JSChar;
+ #else
+     typedef wchar_t JSChar;
+ #endif
+--- qtwebkit-opensource-src-5.5.1/Source/WebKit2/Shared/API/c/WKString.h.orig	2015-10-13 06:37:12.000000000 +0200
++++ qtwebkit-opensource-src-5.5.1/Source/WebKit2/Shared/API/c/WKString.h	2017-04-24 12:27:33.432011867 +0200
+@@ -31,6 +31,7 @@
+ #ifndef __cplusplus
+ #include <stdbool.h>
+ #endif
++#include <uchar.h>
+ 
+ #ifdef __cplusplus
+ extern "C" {
+@@ -38,7 +39,7 @@
+ 
+ #if !defined(WIN32) && !defined(_WIN32) \
+     && !((defined(__CC_ARM) || defined(__ARMCC__)) && !defined(__linux__)) /* RVCT */
+-    typedef unsigned short WKChar;
++    typedef char16_t WKChar;
+ #else
+     typedef wchar_t WKChar;
+ #endif
diff --git a/qtwebkit-new-char-types.patch b/qtwebkit-new-char-types.patch
new file mode 100644
index 0000000..a096203
--- /dev/null
+++ b/qtwebkit-new-char-types.patch
@@ -0,0 +1,35 @@
+diff --git a/Source/WTF/wtf/Compiler.h b/Source/WTF/wtf/Compiler.h
+index ead844f..e62cfd4 100644
+--- a/Source/WTF/wtf/Compiler.h
++++ b/Source/WTF/wtf/Compiler.h
+@@ -61,6 +61,7 @@
+ #define WTF_COMPILER_SUPPORTS_HAS_TRIVIAL_DESTRUCTOR __has_feature(has_trivial_destructor)
+ #define WTF_COMPILER_SUPPORTS_CXX_STRONG_ENUMS __has_feature(cxx_strong_enums)
+ #define WTF_COMPILER_SUPPORTS_CXX_REFERENCE_QUALIFIED_FUNCTIONS __has_feature(cxx_reference_qualified_functions)
++#define WTF_COMPILER_SUPPORTS_CXX_NEW_CHAR_TYPES !defined(_LIBCPP_HAS_NO_UNICODE_CHARS)
+ 
+ #endif
+ 
+@@ -142,6 +143,7 @@
+ #define WTF_COMPILER_SUPPORTS_CXX_DELETED_FUNCTIONS 1
+ #endif
+ #if GCC_VERSION_AT_LEAST(4, 5, 0)
++#define WTF_COMPILER_SUPPORTS_CXX_NEW_CHAR_TYPES 1
+ #define WTF_COMPILER_SUPPORTS_CXX_EXPLICIT_CONVERSIONS 1
+ #endif
+ #if GCC_VERSION_AT_LEAST(4, 6, 0)
+diff --git a/Source/WTF/wtf/TypeTraits.h b/Source/WTF/wtf/TypeTraits.h
+index b9e46bc..876fa45 100644
+--- a/Source/WTF/wtf/TypeTraits.h
++++ b/Source/WTF/wtf/TypeTraits.h
+@@ -75,6 +75,10 @@ namespace WTF {
+ #if !COMPILER(MSVC) || defined(_NATIVE_WCHAR_T_DEFINED)
+     template<> struct IsInteger<wchar_t>            { static const bool value = true; };
+ #endif
++#if COMPILER_SUPPORTS(CXX_NEW_CHAR_TYPES)
++    template<> struct IsInteger<char16_t>           { static const bool value = true; };
++    template<> struct IsInteger<char32_t>           { static const bool value = true; };
++#endif
+ 
+     template<typename T> struct IsFloatingPoint     { static const bool value = false; };
+     template<> struct IsFloatingPoint<float>        { static const bool value = true; };
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/phantomjs.git/commitdiff/310b97643ebdea85e78c1b69b38aa6930a3164a2



More information about the pld-cvs-commit mailing list