Skip to content

Commit

Permalink
qtwebkit: Fix build with gcc-14
Browse files Browse the repository at this point in the history
  • Loading branch information
MehdiChinoune committed May 18, 2024
1 parent 851f172 commit 17ecdcc
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
13 changes: 13 additions & 0 deletions mingw-w64-qtwebkit/0001-fix-build-with-gcc-14.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--- a/Source/WebCore/page/csp/ContentSecurityPolicy.cpp
+++ b/Source/WebCore/page/csp/ContentSecurityPolicy.cpp
@@ -231,8 +231,9 @@ bool isAllowedByAllWithHashFromContent(const CSPDirectiveListVector& policies, c
auto cryptoDigest = CryptoDigest::create(toCryptoDigestAlgorithm(algorithm));
cryptoDigest->addBytes(contentCString.data(), contentCString.length());
Vector<uint8_t> digest = cryptoDigest->computeHash();
+ ContentSecurityPolicyHash hash = std::make_pair(algorithm, digest);
for (auto& policy : policies) {
- if ((policy.get()->*allowed)(std::make_pair(algorithm, digest)))
+ if ((policy.get()->*allowed)(hash))
return true;
}
}
17 changes: 10 additions & 7 deletions mingw-w64-qtwebkit/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
_pkgver=5.212.0-alpha4
pkgver=${_pkgver//-/}
pkgrel=18
pkgrel=19
pkgdesc="Webkit module for Qt5 (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64')
Expand All @@ -14,10 +14,10 @@ msys2_references=(
'archlinux: qt5-webkit'
"cpe: cpe:/a:qt:qtwebkit"
)
license=(GPL3 LGPL3 FDL custom)
makedepends=("${MINGW_PACKAGE_PREFIX}-cmake"
license=(spdx:LGPL-2.0-only AND BSD-3-Clause)
makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-cmake"
"${MINGW_PACKAGE_PREFIX}-ruby"
"${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-pkgconf"
"${MINGW_PACKAGE_PREFIX}-python"
"${MINGW_PACKAGE_PREFIX}-qt5-tools"
Expand All @@ -34,8 +34,8 @@ depends=("${MINGW_PACKAGE_PREFIX}-icu"
"${MINGW_PACKAGE_PREFIX}-qt5-sensors"
"${MINGW_PACKAGE_PREFIX}-qt5-webchannel"
"${MINGW_PACKAGE_PREFIX}-woff2")
options=(!strip)
source=(https://github.com/annulen/webkit/releases/download/qtwebkit-${_pkgver}/${_realname}-${_pkgver}.tar.xz
0001-fix-build-with-gcc-14.patch
0003-qtwebkit-mfence-mingw.patch
0005-fix-icu-find.patch
0006-python-output-unix-line-endings.patch
Expand All @@ -56,6 +56,7 @@ source=(https://github.com/annulen/webkit/releases/download/qtwebkit-${_pkgver}/
4e1f209f21c3958e5a8d3a0646dccf9e429ca7e4.patch
https://github.com/movableink/webkit/commit/df49bfc4c93001970c9b9266903ee7e8804fb576.patch)
sha256sums=('9ca126da9273664dd23a3ccd0c9bebceb7bb534bddd743db31caf6a5a6d4a9e6'
'e77d528e0bd203d4c7a657ff13485d2dc33dc0f262005fc1732f084b586bd05a'
'ed80d9a31cb1f9565841e3e206d76810881b7fce30210022270bd19694a9c906'
'b9e39597d140f3fc40d07ae0f0eea0cbabd7b16d8e430d26445ae3063b8ad055'
'02d0eb76207c4c2d36a50291976f8cc141fcff030c4b77c399402cd10a789b99'
Expand Down Expand Up @@ -89,6 +90,7 @@ prepare() {
cd "${srcdir}/${_realname}-${_pkgver}"

apply_patch_with_msg \
0001-fix-build-with-gcc-14.patch \
0003-qtwebkit-mfence-mingw.patch \
0005-fix-icu-find.patch \
0006-python-output-unix-line-endings.patch \
Expand Down Expand Up @@ -131,7 +133,7 @@ build() {
if check_option "debug" "n"; then
_extra_config+=("-DCMAKE_BUILD_TYPE=Release")
else
_extra_config+=("-DCMAKE_BUILD_TYPE=Debug")
_extra_config+=("-DCMAKE_BUILD_TYPE=Debug" "-DSEPARATE_DEBUG_INFO=ON")
fi

if [[ "${CARCH}" == "x86_64" ]]; then
Expand All @@ -140,14 +142,15 @@ build() {
_extra_config+=("-DENABLE_JIT=ON")
fi

CXXFLAGS+=" -w" \
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
${MINGW_PREFIX}/bin/cmake \
-G"MSYS Makefiles" \
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
"${_extra_config[@]}" \
-DPORT=Qt \
-DUSE_QT_MULTIMEDIA=ON \
-DSEPARATE_DEBUG_INFO=ON \
-DENABLE_API_TESTS=OFF \
../${_realname}-${_pkgver}

${MINGW_PREFIX}/bin/cmake --build .
Expand Down

0 comments on commit 17ecdcc

Please sign in to comment.