Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtwebengine/, dev-qt/qtwebengine/files/
Date: Mon, 14 Jun 2021 09:25:51
Message-Id: 1623662736.34183adb0b20533e5a61c1ab863ace6108193aa7.asturm@gentoo
1 commit: 34183adb0b20533e5a61c1ab863ace6108193aa7
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jun 14 09:25:07 2021 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Mon Jun 14 09:25:36 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=34183adb
7
8 dev-qt/qtwebengine: 5.15.2_p20210224 security cleanup
9
10 Bug: https://bugs.gentoo.org/787950
11 Package-Manager: Portage-3.0.20, Repoman-3.0.3
12 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
13
14 dev-qt/qtwebengine/Manifest | 1 -
15 ...-5.15.2_p20210224-fix-crash-w-app-locales.patch | 135 ---------------
16 .../qtwebengine-5.15.2_p20210224.ebuild | 189 ---------------------
17 3 files changed, 325 deletions(-)
18
19 diff --git a/dev-qt/qtwebengine/Manifest b/dev-qt/qtwebengine/Manifest
20 index 33cfb335e2b..a189e345d82 100644
21 --- a/dev-qt/qtwebengine/Manifest
22 +++ b/dev-qt/qtwebengine/Manifest
23 @@ -1,4 +1,3 @@
24 DIST qtwebengine-5.15.2-chromium87-ppc64le.tar.xz 28536 BLAKE2B 98f8e01e7026d9df1d30ae453d4394d3c4ad04c0620a2496235d45f5f1080c2280e040826cde7f72d9771bfc80d0c3df56c9dcbe4f763cec432ad56de37d64c5 SHA512 c90a76f44a9d720624016fd082ab3036f12e13b9789e869ebaf5e4774afca7d4187faf187f365f696d1a7eda05ca75516556ee9d291cdb3408d57cc4b23e2654
25 -DIST qtwebengine-5.15.2_p20210224.tar.xz 320052028 BLAKE2B a1ebaae7cf114041576f4920de1e484bea70c715a470e83e7c47bd8ff95480fc4e408bba173990480732bd464a9eb07d304f4afdb90d943c0a8cbe1e8299df84 SHA512 939292511703f3a6d758d38f1c860ffacd003be65761b19f23e8817bf1121cb9e6351216f737126d8defb1c97ca877e1c6f352e7cfee8e9289274d0793348b51
26 DIST qtwebengine-5.15.2_p20210421.tar.xz 320142308 BLAKE2B 1ed6e3daad8e8da7336c1575f524f1474eb043a44a86eebdc2375e9a01dbb21a4bf622b01525c627ff5846bb375b19617ca78f418749d6e4ce53b376da0b8317 SHA512 3a57cc8eb1aab086ae2ef69b1b1eaac47827d1f460ff53d5954b0dcb6753cc0e5fb24db490ea186141e6659e26a59862e8096126450a9fde6ed1230c00e4ceaa
27 DIST qtwebengine-5.15.2_p20210521.tar.xz 320126348 BLAKE2B 49a910d19487a720bca751d40bb694536d2ac7002b10de5b949b9bb98baf5f86001e89f522bb05edafc5c050a55f7ac15b6689138cff0912990472735a46bfbc SHA512 f71941667abd1a797442dedb501010cb67512e2df9a818b15ff8901a49987211bddcba80e7cc2a4652db9bf56fc9d969e8fa38de1f3ad112838a1a9c9facde8f
28
29 diff --git a/dev-qt/qtwebengine/files/qtwebengine-5.15.2_p20210224-fix-crash-w-app-locales.patch b/dev-qt/qtwebengine/files/qtwebengine-5.15.2_p20210224-fix-crash-w-app-locales.patch
30 deleted file mode 100644
31 index 3a372381ebd..00000000000
32 --- a/dev-qt/qtwebengine/files/qtwebengine-5.15.2_p20210224-fix-crash-w-app-locales.patch
33 +++ /dev/null
34 @@ -1,135 +0,0 @@
35 -From 199ea00a9eea13315a652c62778738629185b059 Mon Sep 17 00:00:00 2001
36 -From: Allan Sandfeld Jensen <allan.jensen@××.io>
37 -Date: Wed, 10 Mar 2021 17:14:27 +0100
38 -Subject: Fix normalization of app locales
39 -MIME-Version: 1.0
40 -Content-Type: text/plain; charset=UTF-8
41 -Content-Transfer-Encoding: 8bit
42 -
43 -Use the internal Chromium routine to get the app locale Chromium
44 -expects.
45 -
46 -Fixes: QTBUG-91715
47 -Change-Id: I5042eb066cb6879ad69628959912f2841867b4e8
48 -Reviewed-by: Michael Brüning <michael.bruning@××.io>
49 ----
50 - src/core/content_browser_client_qt.cpp | 7 ++++++-
51 - src/core/content_browser_client_qt.h | 2 ++
52 - src/core/web_engine_library_info.cpp | 18 ++++++++--------
53 - .../widgets/qwebengineview/tst_qwebengineview.cpp | 24 ++++++++++++++++++++++
54 - 4 files changed, 40 insertions(+), 11 deletions(-)
55 -
56 -diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp
57 -index e13ecd8d1..c2c78ff8b 100644
58 ---- a/src/core/content_browser_client_qt.cpp
59 -+++ b/src/core/content_browser_client_qt.cpp
60 -@@ -471,7 +471,12 @@ std::unique_ptr<net::ClientCertStore> ContentBrowserClientQt::CreateClientCertSt
61 -
62 - std::string ContentBrowserClientQt::GetApplicationLocale()
63 - {
64 -- return WebEngineLibraryInfo::getApplicationLocale();
65 -+ std::string bcp47Name = QLocale().bcp47Name().toStdString();
66 -+ if (m_cachedQtLocale != bcp47Name) {
67 -+ m_cachedQtLocale = bcp47Name;
68 -+ m_appLocale = WebEngineLibraryInfo::getApplicationLocale();
69 -+ }
70 -+ return m_appLocale;
71 - }
72 -
73 - std::string ContentBrowserClientQt::GetAcceptLangs(content::BrowserContext *context)
74 -diff --git a/src/core/content_browser_client_qt.h b/src/core/content_browser_client_qt.h
75 -index 7c8aa3ac9..1ccd2926d 100644
76 ---- a/src/core/content_browser_client_qt.h
77 -+++ b/src/core/content_browser_client_qt.h
78 -@@ -269,6 +269,8 @@ public:
79 -
80 - private:
81 - scoped_refptr<ShareGroupQtQuick> m_shareGroupQtQuick;
82 -+ std::string m_appLocale;
83 -+ std::string m_cachedQtLocale;
84 - };
85 -
86 - } // namespace QtWebEngineCore
87 -diff --git a/src/core/web_engine_library_info.cpp b/src/core/web_engine_library_info.cpp
88 -index 2ad5b7565..09a4141b0 100644
89 ---- a/src/core/web_engine_library_info.cpp
90 -+++ b/src/core/web_engine_library_info.cpp
91 -@@ -46,6 +46,7 @@
92 - #include "components/spellcheck/spellcheck_buildflags.h"
93 - #include "content/public/common/content_paths.h"
94 - #include "sandbox/policy/switches.h"
95 -+#include "ui/base/l10n/l10n_util.h"
96 - #include "ui/base/ui_base_paths.h"
97 - #include "ui/base/ui_base_switches.h"
98 -
99 -@@ -353,18 +354,15 @@ base::string16 WebEngineLibraryInfo::getApplicationName()
100 - std::string WebEngineLibraryInfo::getApplicationLocale()
101 - {
102 - base::CommandLine *parsedCommandLine = base::CommandLine::ForCurrentProcess();
103 -- if (!parsedCommandLine->HasSwitch(switches::kLang)) {
104 -+ if (parsedCommandLine->HasSwitch(switches::kLang)) {
105 -+ return parsedCommandLine->GetSwitchValueASCII(switches::kLang);
106 -+ } else {
107 - const QString &locale = QLocale().bcp47Name();
108 --
109 -- // QLocale::bcp47Name returns "en" for American English locale. Chromium requires the "US" suffix
110 -- // to clarify the dialect and ignores the shorter version.
111 -- if (locale == "en")
112 -- return "en-US";
113 --
114 -- return locale.toStdString();
115 -+ std::string resolvedLocale;
116 -+ if (l10n_util::CheckAndResolveLocale(locale.toStdString(), &resolvedLocale))
117 -+ return resolvedLocale;
118 - }
119 --
120 -- return parsedCommandLine->GetSwitchValueASCII(switches::kLang);
121 -+ return "en-US";
122 - }
123 -
124 - #if defined(OS_WIN)
125 -diff --git a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
126 -index 021986381..bf2c28ae6 100644
127 ---- a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
128 -+++ b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
129 -@@ -123,6 +123,7 @@ private Q_SLOTS:
130 - void doNotBreakLayout();
131 -
132 - void changeLocale();
133 -+ void mixLangLocale();
134 - void inputMethodsTextFormat_data();
135 - void inputMethodsTextFormat();
136 - void keyboardEvents();
137 -@@ -1210,6 +1211,29 @@ void tst_QWebEngineView::changeLocale()
138 - QCOMPARE(errorLines.first().toUtf8(), QByteArrayLiteral("Die Website ist nicht erreichbar"));
139 - }
140 -
141 -+void tst_QWebEngineView::mixLangLocale()
142 -+{
143 -+ for (QString locale : { "en_DK", "de_CH", "eu_ES" }) {
144 -+ QLocale::setDefault(locale);
145 -+ QWebEngineView view;
146 -+ QSignalSpy loadSpy(&view, &QWebEngineView::loadFinished);
147 -+
148 -+ bool terminated = false;
149 -+ auto sc = connect(view.page(), &QWebEnginePage::renderProcessTerminated, [&] () { terminated = true; });
150 -+
151 -+ view.load(QUrl("qrc:///resources/dummy.html"));
152 -+ QTRY_VERIFY(terminated || loadSpy.count() == 1);
153 -+
154 -+ QVERIFY2(!terminated,
155 -+ qPrintable(QString("Locale [%1] terminated: %2, loaded: %3").arg(locale).arg(terminated).arg(loadSpy.count())));
156 -+ QVERIFY(loadSpy.first().first().toBool());
157 -+
158 -+ QString content = toPlainTextSync(view.page());
159 -+ QVERIFY2(!content.isEmpty() && content.contains("test content"), qPrintable(content));
160 -+ }
161 -+ QLocale::setDefault(QLocale("en"));
162 -+}
163 -+
164 - void tst_QWebEngineView::inputMethodsTextFormat_data()
165 - {
166 - QTest::addColumn<QString>("string");
167 ---
168 -cgit v1.2.1
169 -
170
171 diff --git a/dev-qt/qtwebengine/qtwebengine-5.15.2_p20210224.ebuild b/dev-qt/qtwebengine/qtwebengine-5.15.2_p20210224.ebuild
172 deleted file mode 100644
173 index 756f19123c4..00000000000
174 --- a/dev-qt/qtwebengine/qtwebengine-5.15.2_p20210224.ebuild
175 +++ /dev/null
176 @@ -1,189 +0,0 @@
177 -# Copyright 1999-2021 Gentoo Authors
178 -# Distributed under the terms of the GNU General Public License v2
179 -
180 -EAPI=7
181 -
182 -PYTHON_COMPAT=( python2_7 )
183 -QTVER=$(ver_cut 1-3)
184 -inherit multiprocessing python-any-r1 qt5-build
185 -
186 -DESCRIPTION="Library for rendering dynamic web content in Qt5 C++ and QML applications"
187 -
188 -if [[ ${QT5_BUILD_TYPE} == release ]]; then
189 - KEYWORDS="amd64 ~arm arm64 ~ppc64 x86"
190 - if [[ ${PV} == ${QTVER}_p* ]]; then
191 - SRC_URI="https://dev.gentoo.org/~asturm/distfiles/${P}.tar.xz"
192 - S="${WORKDIR}/${P}"
193 - QT5_BUILD_DIR="${S}_build"
194 - fi
195 -fi
196 -
197 -# patchset based on https://github.com/chromium-ppc64le releases
198 -SRC_URI+=" ppc64? ( https://dev.gentoo.org/~gyakovlev/distfiles/${PN}-5.15.2-chromium87-ppc64le.tar.xz )"
199 -
200 -IUSE="alsa bindist designer geolocation +jumbo-build kerberos pulseaudio +system-ffmpeg +system-icu widgets"
201 -REQUIRED_USE="designer? ( widgets )"
202 -
203 -RDEPEND="
204 - app-arch/snappy:=
205 - dev-libs/glib:2
206 - dev-libs/nspr
207 - dev-libs/nss
208 - dev-libs/expat
209 - dev-libs/libevent:=
210 - dev-libs/libxml2[icu]
211 - dev-libs/libxslt
212 - dev-libs/re2:=
213 - ~dev-qt/qtcore-${QTVER}
214 - ~dev-qt/qtdeclarative-${QTVER}
215 - ~dev-qt/qtgui-${QTVER}
216 - ~dev-qt/qtnetwork-${QTVER}
217 - ~dev-qt/qtprintsupport-${QTVER}
218 - ~dev-qt/qtwebchannel-${QTVER}[qml]
219 - media-libs/fontconfig
220 - media-libs/freetype
221 - media-libs/harfbuzz:=
222 - media-libs/lcms:2
223 - media-libs/libjpeg-turbo:=
224 - media-libs/libpng:0=
225 - >=media-libs/libvpx-1.5:=[svc(+)]
226 - media-libs/libwebp:=
227 - media-libs/mesa[egl,X(+)]
228 - media-libs/opus
229 - sys-apps/dbus
230 - sys-apps/pciutils
231 - sys-libs/zlib[minizip]
232 - virtual/libudev
233 - x11-libs/libdrm
234 - x11-libs/libX11
235 - x11-libs/libXcomposite
236 - x11-libs/libXcursor
237 - x11-libs/libXdamage
238 - x11-libs/libXext
239 - x11-libs/libXfixes
240 - x11-libs/libXi
241 - x11-libs/libXrandr
242 - x11-libs/libXrender
243 - x11-libs/libXScrnSaver
244 - x11-libs/libXtst
245 - alsa? ( media-libs/alsa-lib )
246 - designer? ( ~dev-qt/designer-${QTVER} )
247 - geolocation? ( ~dev-qt/qtpositioning-${QTVER} )
248 - kerberos? ( virtual/krb5 )
249 - pulseaudio? ( media-sound/pulseaudio:= )
250 - system-ffmpeg? ( media-video/ffmpeg:0= )
251 - system-icu? ( >=dev-libs/icu-68.2:= )
252 - widgets? (
253 - ~dev-qt/qtdeclarative-${QTVER}[widgets]
254 - ~dev-qt/qtwidgets-${QTVER}
255 - )
256 -"
257 -DEPEND="${RDEPEND}
258 - ${PYTHON_DEPS}
259 - >=app-arch/gzip-1.7
260 - dev-util/gperf
261 - dev-util/ninja
262 - dev-util/re2c
263 - net-libs/nodejs
264 - sys-devel/bison
265 - ppc64? ( >=dev-util/gn-0.1807 )
266 -"
267 -
268 -PATCHES=(
269 - "${FILESDIR}/${PN}-5.15.0-disable-fatal-warnings.patch" # bug 695446
270 - "${FILESDIR}/${P}-fix-crash-w-app-locales.patch" # bug 773919, QTBUG-91715
271 - "${FILESDIR}/${P}-chromium-87-v8-icu68.patch" # downstream, bug 757606
272 - "${FILESDIR}/${P}-disable-git.patch" # downstream snapshot fix
273 -)
274 -
275 -src_prepare() {
276 - if [[ ${PV} == ${QTVER}_p* ]]; then
277 - # This is made from git, and for some reason will fail w/o .git directories.
278 - mkdir -p .git src/3rdparty/chromium/.git || die
279 -
280 - # We need to make sure this integrates well into Qt 5.15.2 installation.
281 - # Otherwise revdeps fail w/o heavy changes. This is the simplest way to do it.
282 - sed -e "/^MODULE_VERSION/s/5.*/${QTVER}/" -i .qmake.conf || die
283 - fi
284 -
285 - # QTBUG-88657 - jumbo-build could still make trouble
286 - if ! use jumbo-build; then
287 - sed -i -e 's|use_jumbo_build=true|use_jumbo_build=false|' \
288 - src/buildtools/config/common.pri || die
289 - fi
290 -
291 - # bug 630834 - pass appropriate options to ninja when building GN
292 - sed -e "s/\['ninja'/&, '-j$(makeopts_jobs)', '-l$(makeopts_loadavg "${MAKEOPTS}" 0)', '-v'/" \
293 - -i src/3rdparty/chromium/tools/gn/bootstrap/bootstrap.py || die
294 -
295 - # bug 620444 - ensure local headers are used
296 - find "${S}" -type f -name "*.pr[fio]" | \
297 - xargs sed -i -e 's|INCLUDEPATH += |&$${QTWEBENGINE_ROOT}_build/include $${QTWEBENGINE_ROOT}/include |' || die
298 -
299 - if use system-icu; then
300 - # Sanity check to ensure that bundled copy of ICU is not used.
301 - # Whole src/3rdparty/chromium/third_party/icu directory cannot be deleted because
302 - # src/3rdparty/chromium/third_party/icu/BUILD.gn is used by build system.
303 - # If usage of headers of bundled copy of ICU occurs, then lists of shim headers in
304 - # shim_headers("icui18n_shim") and shim_headers("icuuc_shim") in
305 - # src/3rdparty/chromium/third_party/icu/BUILD.gn should be updated.
306 - local file
307 - while read file; do
308 - echo "#error This file should not be used!" > "${file}" || die
309 - done < <(find src/3rdparty/chromium/third_party/icu -type f "(" -name "*.c" -o -name "*.cpp" -o -name "*.h" ")" 2>/dev/null)
310 - fi
311 -
312 - qt_use_disable_config alsa webengine-alsa src/buildtools/config/linux.pri
313 - qt_use_disable_config pulseaudio webengine-pulseaudio src/buildtools/config/linux.pri
314 -
315 - qt_use_disable_mod designer webenginewidgets src/plugins/plugins.pro
316 -
317 - qt_use_disable_mod widgets widgets src/src.pro
318 -
319 - qt5-build_src_prepare
320 -
321 - # we need to generate ppc64 stuff because upstream does not ship it yet
322 - if use ppc64; then
323 - einfo "Patching for ppc64le and generating build files"
324 - eapply "${FILESDIR}/qtwebengine-5.15.2-enable-ppc64.patch"
325 - pushd src/3rdparty/chromium > /dev/null || die
326 - eapply -p0 "${WORKDIR}/${PN}-ppc64le"
327 - popd > /dev/null || die
328 - pushd src/3rdparty/chromium/third_party/libvpx > /dev/null || die
329 - mkdir -vp source/config/linux/ppc64 || die
330 - mkdir -p source/libvpx/test || die
331 - touch source/libvpx/test/test.mk || die
332 - ./generate_gni.sh || die
333 - popd >/dev/null || die
334 - fi
335 -}
336 -
337 -src_configure() {
338 - export NINJA_PATH=/usr/bin/ninja
339 - export NINJAFLAGS="${NINJAFLAGS:--j$(makeopts_jobs) -l$(makeopts_loadavg "${MAKEOPTS}" 0) -v}"
340 -
341 - local myqmakeargs=(
342 - --
343 - -no-build-qtpdf
344 - -printing-and-pdf
345 - -system-opus
346 - -system-webp
347 - $(usex alsa '-alsa' '-no-alsa')
348 - $(usex bindist '-no-proprietary-codecs' '-proprietary-codecs')
349 - $(usex geolocation '-webengine-geolocation' '-no-webengine-geolocation')
350 - $(usex kerberos '-webengine-kerberos' '-no-webengine-kerberos')
351 - $(usex pulseaudio '-pulseaudio' '-no-pulseaudio')
352 - $(usex system-ffmpeg '-system-ffmpeg' '-qt-ffmpeg')
353 - $(usex system-icu '-webengine-icu' '-no-webengine-icu')
354 - )
355 - qt5-build_src_configure
356 -}
357 -
358 -src_install() {
359 - qt5-build_src_install
360 -
361 - # bug 601472
362 - if [[ ! -f ${D}${QT5_LIBDIR}/libQt5WebEngine.so ]]; then
363 - die "${CATEGORY}/${PF} failed to build anything. Please report to https://bugs.gentoo.org/"
364 - fi
365 -}