From 531dcb95bc067707466c01c6081cf739fb086034 Mon Sep 17 00:00:00 2001 From: Chongyun Lee <45286352+licy183@users.noreply.github.com> Date: Mon, 22 Apr 2024 03:39:32 +0800 Subject: [PATCH] libicu: revbump revdeps (8) * qt5-qtwebkit: revbump to rebuild --- x11-packages/qt5-qtwebkit/build.sh | 2 +- .../qt5-qtwebkit/icu-75-use-cxx-17.patch | 15 ++++++ x11-packages/qt5-qtwebkit/libxml2-2.12.patch | 28 +++++++++++ .../qt5-qtwebkit/remove-random_shuffle.patch | 50 +++++++++++++++++++ .../remove-self-defined-cxx14-stuffs.patch | 20 ++++++++ 5 files changed, 114 insertions(+), 1 deletion(-) create mode 100644 x11-packages/qt5-qtwebkit/icu-75-use-cxx-17.patch create mode 100644 x11-packages/qt5-qtwebkit/libxml2-2.12.patch create mode 100644 x11-packages/qt5-qtwebkit/remove-random_shuffle.patch create mode 100644 x11-packages/qt5-qtwebkit/remove-self-defined-cxx14-stuffs.patch diff --git a/x11-packages/qt5-qtwebkit/build.sh b/x11-packages/qt5-qtwebkit/build.sh index 8b98687802..582a3f9ee4 100644 --- a/x11-packages/qt5-qtwebkit/build.sh +++ b/x11-packages/qt5-qtwebkit/build.sh @@ -3,7 +3,7 @@ TERMUX_PKG_DESCRIPTION="Qt 5 WebKit Library" TERMUX_PKG_LICENSE="LGPL-2.1" TERMUX_PKG_MAINTAINER="Simeon Huang " TERMUX_PKG_VERSION="5.212.0-alpha4" -TERMUX_PKG_REVISION=15 +TERMUX_PKG_REVISION=16 TERMUX_PKG_SRCURL="https://github.com/qtwebkit/qtwebkit/releases/download/qtwebkit-${TERMUX_PKG_VERSION}/qtwebkit-${TERMUX_PKG_VERSION}.tar.xz" TERMUX_PKG_SHA256=9ca126da9273664dd23a3ccd0c9bebceb7bb534bddd743db31caf6a5a6d4a9e6 TERMUX_PKG_DEPENDS="libc++, libhyphen, libicu, libjpeg-turbo, libpng, libsqlite, libwebp, libx11, libxml2, libxslt, qt5-qtbase, qt5-qtdeclarative, qt5-qtlocation, qt5-qtmultimedia, qt5-qtsensors, zlib" diff --git a/x11-packages/qt5-qtwebkit/icu-75-use-cxx-17.patch b/x11-packages/qt5-qtwebkit/icu-75-use-cxx-17.patch new file mode 100644 index 0000000000..ac0f9aafc2 --- /dev/null +++ b/x11-packages/qt5-qtwebkit/icu-75-use-cxx-17.patch @@ -0,0 +1,15 @@ +Since ICU 75, ICU C++ headers need at least C++17 to compile as it +uses `std::enable_if_t` (introduced in C++14) and `std::is_same_v` +(introduced in C++17). + +--- a/Source/cmake/OptionsCommon.cmake ++++ b/Source/cmake/OptionsCommon.cmake +@@ -31,7 +31,7 @@ + if (COMPILER_IS_GCC_OR_CLANG) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-exceptions -fno-strict-aliasing") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -fno-strict-aliasing -fno-rtti") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17") + endif () + + if (COMPILER_IS_CLANG AND CMAKE_GENERATOR STREQUAL "Ninja") diff --git a/x11-packages/qt5-qtwebkit/libxml2-2.12.patch b/x11-packages/qt5-qtwebkit/libxml2-2.12.patch new file mode 100644 index 0000000000..50a55e6c1d --- /dev/null +++ b/x11-packages/qt5-qtwebkit/libxml2-2.12.patch @@ -0,0 +1,28 @@ +--- a/Source/WebCore/xml/XSLTProcessor.h ++++ b/Source/WebCore/xml/XSLTProcessor.h +@@ -64,7 +64,11 @@ + + void reset(); + ++#if LIBXML_VERSION >= 21200 ++ static void parseErrorFunc(void* userData, const xmlError*); ++#else + static void parseErrorFunc(void* userData, xmlError*); ++#endif + static void genericErrorFunc(void* userData, const char* msg, ...); + + // Only for libXSLT callbacks +--- a/Source/WebCore/xml/XSLTProcessorLibxslt.cpp ++++ b/Source/WebCore/xml/XSLTProcessorLibxslt.cpp +@@ -78,7 +78,11 @@ + // It would be nice to do something with this error message. + } + ++#if LIBXML_VERSION >= 21200 ++void XSLTProcessor::parseErrorFunc(void* userData, const xmlError* error) ++#else + void XSLTProcessor::parseErrorFunc(void* userData, xmlError* error) ++#endif + { + PageConsoleClient* console = static_cast(userData); + if (!console) diff --git a/x11-packages/qt5-qtwebkit/remove-random_shuffle.patch b/x11-packages/qt5-qtwebkit/remove-random_shuffle.patch new file mode 100644 index 0000000000..4797c476a5 --- /dev/null +++ b/x11-packages/qt5-qtwebkit/remove-random_shuffle.patch @@ -0,0 +1,50 @@ +Remove `std::random_shuffle` usage (removed in C++17) + +https://github.com/WebKit/WebKit/commit/0fbd42d50de66ad019249e8727dd3bd24dedf7cb + +--- a/Source/JavaScriptCore/jit/BinarySwitch.cpp ++++ b/Source/JavaScriptCore/jit/BinarySwitch.cpp +@@ -137,6 +137,27 @@ bool BinarySwitch::advance(MacroAssembler& jit) + } + } + ++class RandomNumberGenerator { ++public: ++ using result_type = uint32_t; ++ ++ RandomNumberGenerator(WeakRandom& weakRandom) ++ : m_weakRandom(weakRandom) ++ { ++ } ++ ++ uint32_t operator()() ++ { ++ return m_weakRandom.getUint32(); ++ } ++ ++ static constexpr uint32_t min() { return std::numeric_limits::min(); } ++ static constexpr uint32_t max() { return std::numeric_limits::max(); } ++ ++private: ++ WeakRandom& m_weakRandom; ++}; ++ + void BinarySwitch::build(unsigned start, bool hardStart, unsigned end) + { + if (BinarySwitchInternal::verbose) +@@ -195,13 +216,9 @@ void BinarySwitch::build(unsigned start, bool hardStart, unsigned end) + for (unsigned i = 0; i < size; ++i) + localCaseIndices.append(start + i); + +- std::random_shuffle( ++ std::shuffle( + localCaseIndices.begin(), localCaseIndices.end(), +- [this] (unsigned n) { +- // We use modulo to get a random number in the range we want fully knowing that +- // this introduces a tiny amount of bias, but we're fine with such tiny bias. +- return m_weakRandom.getUint32() % n; +- }); ++ RandomNumberGenerator(m_weakRandom)); + + for (unsigned i = 0; i < size - 1; ++i) { + append(BranchCode(NotEqualToPush, localCaseIndices[i])); diff --git a/x11-packages/qt5-qtwebkit/remove-self-defined-cxx14-stuffs.patch b/x11-packages/qt5-qtwebkit/remove-self-defined-cxx14-stuffs.patch new file mode 100644 index 0000000000..b5c2bd31d9 --- /dev/null +++ b/x11-packages/qt5-qtwebkit/remove-self-defined-cxx14-stuffs.patch @@ -0,0 +1,20 @@ +They are conflict with libcxx headers. + +--- a/Source/WTF/wtf/StdLibExtras.h ++++ b/Source/WTF/wtf/StdLibExtras.h +@@ -291,6 +291,7 @@ + + // This adds various C++14 features for versions of the STL that may not yet have them. + namespace std { ++#if __cplusplus < 201300 + // MSVC 2013 supports std::make_unique already. + #if !defined(_MSC_VER) || _MSC_VER < 1800 + template struct _Unique_if { +@@ -371,6 +372,7 @@ + } + } + #endif ++#endif + + template + ALWAYS_INLINE constexpr typename remove_reference::type&& move(T&& value)