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/files/, dev-qt/qtwebengine/
Date: Tue, 05 Apr 2022 16:35:19
Message-Id: 1649176428.040d7675bae6b7af62f251b8fbab4dde4df81a19.asturm@gentoo
1 commit: 040d7675bae6b7af62f251b8fbab4dde4df81a19
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Tue Apr 5 15:36:00 2022 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Tue Apr 5 16:33:48 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=040d7675
7
8 dev-qt/qtwebengine: 5.15.3_p20220330 version bump, py3
9
10 Patched with security patches up to Chromium version:
11 98.0.4758.102 plus fixes for CVE-2022-0971, CVE-2022-1096
12
13 Patches sourced from ArchLinux:
14 - Enable build with >=python-3
15 - Fix build with >=ffmpeg-5
16 - Enable screencast support using pipewire-3
17
18 Snapshotted at:
19 Branch: 5.15
20 Commit: dcdf9656f794e1903163a5533d0a325eb3dce423
21
22 Submodule qtwebengine-chromium.git:
23 Branch: 87-based
24 Commit: d13d0924c4e18ecc4b79adf0fec142ee9a9eaa14
25
26 Bug: https://bugs.gentoo.org/835761
27 Closes: https://bugs.gentoo.org/831487
28 Package-Manager: Portage-3.0.30, Repoman-3.0.3
29 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
30
31 dev-qt/qtwebengine/Manifest | 1 +
32 .../qtwebengine-5.15.3_p20220329-clang14.patch | 26 ++
33 .../qtwebengine-5.15.3_p20220330-ffmpeg5.patch | 169 +++++++++++++
34 dev-qt/qtwebengine/metadata.xml | 13 +-
35 .../qtwebengine-5.15.3_p20220330.ebuild | 272 +++++++++++++++++++++
36 5 files changed, 473 insertions(+), 8 deletions(-)
37
38 diff --git a/dev-qt/qtwebengine/Manifest b/dev-qt/qtwebengine/Manifest
39 index eedc182c4dad..8dfa38137abb 100644
40 --- a/dev-qt/qtwebengine/Manifest
41 +++ b/dev-qt/qtwebengine/Manifest
42 @@ -2,3 +2,4 @@ DIST qtwebengine-5.15.2-r1-chromium87-ppc64le.tar.xz 28784 BLAKE2B aa101d14446f3
43 DIST qtwebengine-5.15.2_p20211019-jumbo-build.patch.bz2 2930 BLAKE2B fca1d1406874d04eafb64bb4d8730512a6307ba44fb99d76f428ca1bd4a303758e0c3bd8f92a59f7bcf62e5b767c5a8ed239028bdb74ad7a8b62abf88d38c101 SHA512 61cbfbe4ff340b75ea8d356e031e932ac03fe65dd009999ff897ca4b0185d1d989490daf75ffeaaabb3e92c870c11c7ff8ad2cd6372f5363b3d774b8ecca6d89
44 DIST qtwebengine-5.15.2_p20211216.tar.xz 318953468 BLAKE2B 65b1bc5be8d08d10b75fee20f78a9a783f878874907335818cddde500e80633e91a999e92fd3de69d004c3621a8337c9bef2c949e03e552cab1d89d901e0dae2 SHA512 f72db4b6dcbdaa171bf2997ab3a77325f9845ef1d72cd994e6152f0f92d350de348ff15b1cde1140ab98b7eb10d6e2d2a3ac6b7d773ab43de37144faad37c3f3
45 DIST qtwebengine-5.15.3_p20220329.tar.xz 318910384 BLAKE2B df4e88628eed5fa2304eec986dd397cd5f51e42f9fdf2dca1bc6d84ad40be406d112701124c745d003b4c22a33d5a69b39b66747e7b9a970a7c91b46ef3943f7 SHA512 650d9056477479fc4630102d7270185c99cdf1ec855f3f407725dd74a737756b7180565a924594c1b75dcbb061d3642af2447610bf22acd9c4cb2c90c7cf842b
46 +DIST qtwebengine-5.15.3_p20220330.tar.xz 401852524 BLAKE2B 7ac18135a9c0f99085db332c1b324308cc5c5a350b978bb6944e93a203174390f31ce6addcc9b89ba40a305b6af68cc9b0516fd6d90f8ee12d0d24e60b11d0d1 SHA512 53e95548c1fb2fe37f2e63dff56306e6e34f2f1a5e8d811145600111d586528060d26c6ae9833f0a7ad4fee029d44a8275f8c5ac5d511b72fbd24fb0812f592b
47
48 diff --git a/dev-qt/qtwebengine/files/qtwebengine-5.15.3_p20220329-clang14.patch b/dev-qt/qtwebengine/files/qtwebengine-5.15.3_p20220329-clang14.patch
49 index ed48544fc36d..c1a98d0934fb 100644
50 --- a/dev-qt/qtwebengine/files/qtwebengine-5.15.3_p20220329-clang14.patch
51 +++ b/dev-qt/qtwebengine/files/qtwebengine-5.15.3_p20220329-clang14.patch
52 @@ -1,3 +1,29 @@
53 +From 0825e7bc64e47d87e1f1026cc80c933550f114f5 Mon Sep 17 00:00:00 2001
54 +From: Dimitry Andric <dim@×××××××.org>
55 +Date: Mon, 14 Feb 2022 13:55:25 +0100
56 +Subject: www/qt5-webengine: fix build with clang 14
57 +
58 +Fixes compile error:
59 +
60 +In file included from gen/third_party/blink/renderer/platform/platform_jumbo_63.cc:8:
61 +src/3rdparty/chromium/third_party/blink/renderer/platform/text/text_break_iterator_icu.cc:122:15: error: anonymous non-C-compatible type given name for linkage purposes by typedef declaration after its linkage was computed; add a tag name here to establish linkage prior to definition
62 +typedef struct {
63 + ^
64 + UTextWithBuffer
65 +src/3rdparty/chromium/third_party/blink/renderer/platform/text/text_break_iterator_icu.cc:123:3: note: type is not C-compatible due to this member declaration
66 + DISALLOW_NEW();
67 + ^~~~~~~~~~~~~~
68 +src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/allocator/allocator.h:40:2: note: expanded from macro 'DISALLOW_NEW'
69 + public: \
70 + ^~~~~~~
71 +src/3rdparty/chromium/third_party/blink/renderer/platform/text/text_break_iterator_icu.cc:126:3: note: type is given name 'UTextWithBuffer' for linkage purposes by this typedef declaration
72 +} UTextWithBuffer;
73 + ^
74 +
75 +PR: 261949
76 +Approved by: adridg (maintainer)
77 +MFH: 2022Q1
78 +
79 --- a/src/3rdparty/chromium/third_party/blink/renderer/platform/text/text_break_iterator_icu.cc
80 +++ b/src/3rdparty/chromium/third_party/blink/renderer/platform/text/text_break_iterator_icu.cc
81 @@ -119,11 +119,11 @@ enum TextContext { kNoContext, kPriorContext, kPrimary
82
83 diff --git a/dev-qt/qtwebengine/files/qtwebengine-5.15.3_p20220330-ffmpeg5.patch b/dev-qt/qtwebengine/files/qtwebengine-5.15.3_p20220330-ffmpeg5.patch
84 new file mode 100644
85 index 000000000000..d85c1985883c
86 --- /dev/null
87 +++ b/dev-qt/qtwebengine/files/qtwebengine-5.15.3_p20220330-ffmpeg5.patch
88 @@ -0,0 +1,169 @@
89 +From 05f6ffbbce0a2aad01dc05d682cbe4a1ec44fad5 Mon Sep 17 00:00:00 2001
90 +From: Antonio Rojas <arojas@×××××××××.org>
91 +Date: Tue, 25 Jan 2022 10:51:58 +0000
92 +Subject: [PATCH] Fix build with ffmpeg 5
93 +
94 +---
95 + chromium/media/ffmpeg/ffmpeg_common.h | 1 +
96 + chromium/media/filters/audio_file_reader.cc | 2 +-
97 + chromium/media/filters/ffmpeg_audio_decoder.cc | 2 +-
98 + chromium/media/filters/ffmpeg_demuxer.cc | 12 ++++++------
99 + chromium/media/filters/ffmpeg_glue.cc | 4 ----
100 + chromium/media/filters/ffmpeg_video_decoder.cc | 2 +-
101 + chromium/media/filters/media_file_checker.cc | 2 +-
102 + .../video_coding/codecs/h264/h264_decoder_impl.cc | 2 +-
103 + 8 files changed, 12 insertions(+), 15 deletions(-)
104 +
105 +diff --git a/chromium/media/ffmpeg/ffmpeg_common.h b/chromium/media/ffmpeg/ffmpeg_common.h
106 +index 2734a485cbd..70b1877a43c 100644
107 +--- a/chromium/media/ffmpeg/ffmpeg_common.h
108 ++++ b/chromium/media/ffmpeg/ffmpeg_common.h
109 +@@ -29,6 +29,7 @@ extern "C" {
110 + #include <libavformat/avformat.h>
111 + #include <libavformat/avio.h>
112 + #include <libavutil/avutil.h>
113 ++#include <libavutil/channel_layout.h>
114 + #include <libavutil/imgutils.h>
115 + #include <libavutil/log.h>
116 + #include <libavutil/mastering_display_metadata.h>
117 +diff --git a/chromium/media/filters/audio_file_reader.cc b/chromium/media/filters/audio_file_reader.cc
118 +index cb81d920def..bd73908d0ca 100644
119 +--- a/chromium/media/filters/audio_file_reader.cc
120 ++++ b/chromium/media/filters/audio_file_reader.cc
121 +@@ -85,7 +85,7 @@ bool AudioFileReader::OpenDemuxer() {
122 + }
123 +
124 + bool AudioFileReader::OpenDecoder() {
125 +- AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id);
126 ++ const AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id);
127 + if (codec) {
128 + // MP3 decodes to S16P which we don't support, tell it to use S16 instead.
129 + if (codec_context_->sample_fmt == AV_SAMPLE_FMT_S16P)
130 +diff --git a/chromium/media/filters/ffmpeg_audio_decoder.cc b/chromium/media/filters/ffmpeg_audio_decoder.cc
131 +index 0d825ed791b..72fac6167ef 100644
132 +--- a/chromium/media/filters/ffmpeg_audio_decoder.cc
133 ++++ b/chromium/media/filters/ffmpeg_audio_decoder.cc
134 +@@ -329,7 +329,7 @@ bool FFmpegAudioDecoder::ConfigureDecoder(const AudioDecoderConfig& config) {
135 + }
136 + }
137 +
138 +- AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id);
139 ++ const AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id);
140 + if (!codec ||
141 + avcodec_open2(codec_context_.get(), codec, &codec_options) < 0) {
142 + DLOG(ERROR) << "Could not initialize audio decoder: "
143 +diff --git a/chromium/media/filters/ffmpeg_demuxer.cc b/chromium/media/filters/ffmpeg_demuxer.cc
144 +index d34db63f3ef..427565b00c1 100644
145 +--- a/chromium/media/filters/ffmpeg_demuxer.cc
146 ++++ b/chromium/media/filters/ffmpeg_demuxer.cc
147 +@@ -98,12 +98,12 @@ static base::TimeDelta ExtractStartTime(AVStream* stream) {
148 +
149 + // Next try to use the first DTS value, for codecs where we know PTS == DTS
150 + // (excludes all H26x codecs). The start time must be returned in PTS.
151 +- if (stream->first_dts != kNoFFmpegTimestamp &&
152 ++ if (av_stream_get_first_dts(stream) != kNoFFmpegTimestamp &&
153 + stream->codecpar->codec_id != AV_CODEC_ID_HEVC &&
154 + stream->codecpar->codec_id != AV_CODEC_ID_H264 &&
155 + stream->codecpar->codec_id != AV_CODEC_ID_MPEG4) {
156 + const base::TimeDelta first_pts =
157 +- ConvertFromTimeBase(stream->time_base, stream->first_dts);
158 ++ ConvertFromTimeBase(stream->time_base, av_stream_get_first_dts(stream));
159 + if (first_pts < start_time)
160 + start_time = first_pts;
161 + }
162 +@@ -408,11 +408,11 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) {
163 + scoped_refptr<DecoderBuffer> buffer;
164 +
165 + if (type() == DemuxerStream::TEXT) {
166 +- int id_size = 0;
167 ++ size_t id_size = 0;
168 + uint8_t* id_data = av_packet_get_side_data(
169 + packet.get(), AV_PKT_DATA_WEBVTT_IDENTIFIER, &id_size);
170 +
171 +- int settings_size = 0;
172 ++ size_t settings_size = 0;
173 + uint8_t* settings_data = av_packet_get_side_data(
174 + packet.get(), AV_PKT_DATA_WEBVTT_SETTINGS, &settings_size);
175 +
176 +@@ -424,7 +424,7 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) {
177 + buffer = DecoderBuffer::CopyFrom(packet->data, packet->size,
178 + side_data.data(), side_data.size());
179 + } else {
180 +- int side_data_size = 0;
181 ++ size_t side_data_size = 0;
182 + uint8_t* side_data = av_packet_get_side_data(
183 + packet.get(), AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, &side_data_size);
184 +
185 +@@ -485,7 +485,7 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) {
186 + packet->size - data_offset);
187 + }
188 +
189 +- int skip_samples_size = 0;
190 ++ size_t skip_samples_size = 0;
191 + const uint32_t* skip_samples_ptr =
192 + reinterpret_cast<const uint32_t*>(av_packet_get_side_data(
193 + packet.get(), AV_PKT_DATA_SKIP_SAMPLES, &skip_samples_size));
194 +diff --git a/chromium/media/filters/ffmpeg_glue.cc b/chromium/media/filters/ffmpeg_glue.cc
195 +index 0ef3521473d..8483ecc348f 100644
196 +--- a/chromium/media/filters/ffmpeg_glue.cc
197 ++++ b/chromium/media/filters/ffmpeg_glue.cc
198 +@@ -59,7 +59,6 @@ static int64_t AVIOSeekOperation(void* opaque, int64_t offset, int whence) {
199 + }
200 +
201 + void FFmpegGlue::InitializeFFmpeg() {
202 +- av_register_all();
203 + }
204 +
205 + static void LogContainer(bool is_local_file,
206 +@@ -95,9 +94,6 @@ FFmpegGlue::FFmpegGlue(FFmpegURLProtocol* protocol) {
207 + // Enable fast, but inaccurate seeks for MP3.
208 + format_context_->flags |= AVFMT_FLAG_FAST_SEEK;
209 +
210 +- // Ensures we can read out various metadata bits like vp8 alpha.
211 +- format_context_->flags |= AVFMT_FLAG_KEEP_SIDE_DATA;
212 +-
213 + // Ensures format parsing errors will bail out. From an audit on 11/2017, all
214 + // instances were real failures. Solves bugs like http://crbug.com/710791.
215 + format_context_->error_recognition |= AV_EF_EXPLODE;
216 +diff --git a/chromium/media/filters/ffmpeg_video_decoder.cc b/chromium/media/filters/ffmpeg_video_decoder.cc
217 +index ef12477ee89..7996606f5f9 100644
218 +--- a/chromium/media/filters/ffmpeg_video_decoder.cc
219 ++++ b/chromium/media/filters/ffmpeg_video_decoder.cc
220 +@@ -391,7 +391,7 @@ bool FFmpegVideoDecoder::ConfigureDecoder(const VideoDecoderConfig& config,
221 + if (decode_nalus_)
222 + codec_context_->flags2 |= AV_CODEC_FLAG2_CHUNKS;
223 +
224 +- AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id);
225 ++ const AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id);
226 + if (!codec || avcodec_open2(codec_context_.get(), codec, NULL) < 0) {
227 + ReleaseFFmpegResources();
228 + return false;
229 +diff --git a/chromium/media/filters/media_file_checker.cc b/chromium/media/filters/media_file_checker.cc
230 +index 59c2a2fc618..1a9872c7acb 100644
231 +--- a/chromium/media/filters/media_file_checker.cc
232 ++++ b/chromium/media/filters/media_file_checker.cc
233 +@@ -68,7 +68,7 @@ bool MediaFileChecker::Start(base::TimeDelta check_time) {
234 + auto context = AVStreamToAVCodecContext(format_context->streams[i]);
235 + if (!context)
236 + continue;
237 +- AVCodec* codec = avcodec_find_decoder(cp->codec_id);
238 ++ const AVCodec* codec = avcodec_find_decoder(cp->codec_id);
239 + if (codec && avcodec_open2(context.get(), codec, nullptr) >= 0) {
240 + auto loop = std::make_unique<FFmpegDecodingLoop>(context.get());
241 + stream_contexts[i] = {std::move(context), std::move(loop)};
242 +diff --git a/chromium/third_party/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc b/chromium/third_party/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc
243 +index 9002b874611..d12fade8b63 100644
244 +--- a/chromium/third_party/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc
245 ++++ b/chromium/third_party/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc
246 +@@ -203,7 +203,7 @@ int32_t H264DecoderImpl::InitDecode(const VideoCodec* codec_settings,
247 + // a pointer |this|.
248 + av_context_->opaque = this;
249 +
250 +- AVCodec* codec = avcodec_find_decoder(av_context_->codec_id);
251 ++ const AVCodec* codec = avcodec_find_decoder(av_context_->codec_id);
252 + if (!codec) {
253 + // This is an indication that FFmpeg has not been initialized or it has not
254 + // been compiled/initialized with the correct set of codecs.
255 +--
256 +2.35.1
257 +
258
259 diff --git a/dev-qt/qtwebengine/metadata.xml b/dev-qt/qtwebengine/metadata.xml
260 index fe0b26ec2aa3..cbcf0f7a01d7 100644
261 --- a/dev-qt/qtwebengine/metadata.xml
262 +++ b/dev-qt/qtwebengine/metadata.xml
263 @@ -11,15 +11,12 @@
264 <name>Georgy Yakovlev</name>
265 </maintainer>
266 <use>
267 - <flag name="designer">Install the QWebEngineView plugin used to add widgets in
268 - <pkg>dev-qt/designer</pkg> forms that display web pages.</flag>
269 - <flag name="geolocation">Enable physical position determination
270 - via <pkg>dev-qt/qtpositioning</pkg></flag>
271 + <flag name="designer">Install the QWebEngineView plugin used to add widgets in <pkg>dev-qt/designer</pkg> forms that display web pages.</flag>
272 + <flag name="geolocation">Enable physical position determination via <pkg>dev-qt/qtpositioning</pkg></flag>
273 <flag name="jumbo-build">Combine source files to speed up build process.</flag>
274 - <flag name="system-ffmpeg">Use the system-wide <pkg>media-video/ffmpeg</pkg>
275 - instead of bundled.</flag>
276 - <flag name="system-icu">Use the system-wide <pkg>dev-libs/icu</pkg>
277 - instead of bundled.</flag>
278 + <flag name="screencast">Enable support for remote desktop and screen cast using <pkg>media-video/pipewire</pkg></flag>
279 + <flag name="system-ffmpeg">Use the system-wide <pkg>media-video/ffmpeg</pkg> instead of bundled.</flag>
280 + <flag name="system-icu">Use the system-wide <pkg>dev-libs/icu</pkg> instead of bundled.</flag>
281 <flag name="widgets">Enable QtWidgets support</flag>
282 </use>
283 <upstream>
284
285 diff --git a/dev-qt/qtwebengine/qtwebengine-5.15.3_p20220330.ebuild b/dev-qt/qtwebengine/qtwebengine-5.15.3_p20220330.ebuild
286 new file mode 100644
287 index 000000000000..cf465387eacb
288 --- /dev/null
289 +++ b/dev-qt/qtwebengine/qtwebengine-5.15.3_p20220330.ebuild
290 @@ -0,0 +1,272 @@
291 +# Copyright 1999-2022 Gentoo Authors
292 +# Distributed under the terms of the GNU General Public License v2
293 +
294 +EAPI=8
295 +
296 +PYTHON_COMPAT=( python3_{9,10} )
297 +PYTHON_REQ_USE="xml(+)"
298 +inherit check-reqs estack flag-o-matic multiprocessing python-any-r1 qt5-build toolchain-funcs
299 +
300 +DESCRIPTION="Library for rendering dynamic web content in Qt5 C++ and QML applications"
301 +HOMEPAGE="https://www.qt.io/"
302 +
303 +if [[ ${QT5_BUILD_TYPE} == release ]]; then
304 + KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
305 + if [[ ${PV} == ${QT5_PV}_p* ]]; then
306 + SRC_URI="https://dev.gentoo.org/~asturm/distfiles/${P}.tar.xz"
307 + S="${WORKDIR}/${P}"
308 + QT5_BUILD_DIR="${S}_build"
309 + fi
310 +else
311 + EGIT_BRANCH="5.15"
312 + EGIT_REPO_URI=(
313 + "https://code.qt.io/qt/${QT5_MODULE}.git"
314 + "https://github.com/qt/${QT5_MODULE}.git"
315 + )
316 + inherit git-r3
317 +fi
318 +
319 +# ppc64 patchset based on https://github.com/chromium-ppc64le releases
320 +SRC_URI+=" https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${PN}-5.15.2_p20211019-jumbo-build.patch.bz2
321 + ppc64? ( https://dev.gentoo.org/~gyakovlev/distfiles/${PN}-5.15.2-r1-chromium87-ppc64le.tar.xz )"
322 +
323 +IUSE="alsa bindist designer geolocation +jumbo-build kerberos pulseaudio screencast +system-ffmpeg +system-icu widgets"
324 +REQUIRED_USE="designer? ( widgets )"
325 +
326 +RDEPEND="
327 + app-arch/snappy:=
328 + dev-libs/glib:2
329 + dev-libs/nspr
330 + dev-libs/nss
331 + dev-libs/expat
332 + dev-libs/libevent:=
333 + dev-libs/libxml2[icu]
334 + dev-libs/libxslt
335 + dev-libs/re2:=
336 + =dev-qt/qtcore-${QT5_PV}*
337 + =dev-qt/qtdeclarative-${QT5_PV}*
338 + =dev-qt/qtgui-${QT5_PV}*
339 + =dev-qt/qtnetwork-${QT5_PV}*
340 + =dev-qt/qtprintsupport-${QT5_PV}*
341 + =dev-qt/qtwebchannel-${QT5_PV}*[qml]
342 + media-libs/fontconfig
343 + media-libs/freetype
344 + media-libs/harfbuzz:=
345 + media-libs/lcms:2
346 + media-libs/libjpeg-turbo:=
347 + media-libs/libpng:0=
348 + >=media-libs/libvpx-1.5:=[svc(+)]
349 + media-libs/libwebp:=
350 + media-libs/opus
351 + sys-apps/dbus
352 + sys-apps/pciutils
353 + sys-libs/zlib[minizip]
354 + virtual/libudev
355 + x11-libs/libdrm
356 + x11-libs/libX11
357 + x11-libs/libXcomposite
358 + x11-libs/libXcursor
359 + x11-libs/libXdamage
360 + x11-libs/libXext
361 + x11-libs/libXfixes
362 + x11-libs/libXi
363 + x11-libs/libxkbfile
364 + x11-libs/libXrandr
365 + x11-libs/libXrender
366 + x11-libs/libXScrnSaver
367 + x11-libs/libXtst
368 + alsa? ( media-libs/alsa-lib )
369 + designer? ( =dev-qt/designer-${QT5_PV}* )
370 + geolocation? ( =dev-qt/qtpositioning-${QT5_PV}* )
371 + kerberos? ( virtual/krb5 )
372 + pulseaudio? ( media-sound/pulseaudio:= )
373 + screencast? ( media-video/pipewire:= )
374 + system-ffmpeg? ( media-video/ffmpeg:0= )
375 + system-icu? ( >=dev-libs/icu-69.1:= )
376 + widgets? (
377 + =dev-qt/qtdeclarative-${QT5_PV}*[widgets]
378 + =dev-qt/qtwidgets-${QT5_PV}*
379 + )
380 +"
381 +DEPEND="${RDEPEND}
382 + media-libs/libglvnd
383 +"
384 +BDEPEND="${PYTHON_DEPS}
385 + dev-util/gperf
386 + dev-util/ninja
387 + dev-util/re2c
388 + net-libs/nodejs[ssl]
389 + sys-devel/bison
390 + sys-devel/flex
391 + ppc64? ( >=dev-util/gn-0.1807 )
392 +"
393 +
394 +PATCHES=(
395 + "${FILESDIR}/${PN}-5.15.2-disable-fatal-warnings.patch" # downstream, bug 695446
396 + "${FILESDIR}/${PN}-5.15.2-extra_gn.patch" # downstream, bug 774186
397 + "${FILESDIR}/${PN}-5.15.2_p20210224-chromium-87-v8-icu68.patch" # downstream, bug 757606
398 + "${FILESDIR}/${PN}-5.15.2_p20210224-disable-git.patch" # downstream snapshot fix
399 + "${FILESDIR}/${PN}-5.15.2_p20211015-pdfium-system-lcms2.patch" # by Debian, QTBUG-61746
400 + "${FILESDIR}/${PN}-5.15.3_p20220329-clang14.patch" # by FreeBSD, bug 836604
401 + "${WORKDIR}/${PN}-5.15.2_p20211019-jumbo-build.patch" # bug 813957
402 +)
403 +
404 +qtwebengine_check-reqs() {
405 + # bug #307861
406 + eshopts_push -s extglob
407 + if is-flagq '-g?(gdb)?([1-9])'; then
408 + ewarn "You have enabled debug info (probably have -g or -ggdb in your CFLAGS/CXXFLAGS)."
409 + ewarn "You may experience really long compilation times and/or increased memory usage."
410 + ewarn "If compilation fails, please try removing -g/-ggdb before reporting a bug."
411 + fi
412 + eshopts_pop
413 +
414 + [[ ${MERGE_TYPE} == binary ]] && return
415 +
416 + # (check-reqs added for bug #570534)
417 + #
418 + # Estimate the amount of RAM required
419 + # Multiplier is *10 because Bash doesn't do floating point maths.
420 + # Let's crudely assume ~2GB per compiler job for GCC.
421 + local multiplier=20
422 +
423 + # And call it ~1.5GB for Clang.
424 + if tc-is-clang ; then
425 + multiplier=15
426 + fi
427 +
428 + local CHECKREQS_DISK_BUILD="7G"
429 + local CHECKREQS_DISK_USR="150M"
430 + if ! has "distcc" ${FEATURES} ; then
431 + # bug #830661
432 + # Not super realistic to come up with good estimates for distcc right now
433 + local CHECKREQS_MEMORY=$(($(makeopts_jobs)*multiplier/10))G
434 + fi
435 +
436 + check-reqs_${EBUILD_PHASE_FUNC}
437 +}
438 +
439 +pkg_pretend() {
440 + qtwebengine_check-reqs
441 +}
442 +
443 +pkg_setup() {
444 + qtwebengine_check-reqs
445 + python-any-r1_pkg_setup
446 +}
447 +
448 +src_unpack() {
449 + case ${QT5_BUILD_TYPE} in
450 + live) git-r3_src_unpack ;&
451 + release) default ;;
452 + esac
453 +}
454 +
455 +src_prepare() {
456 + if [[ ${PV} == ${QT5_PV}_p* ]]; then
457 + # This is made from git, and for some reason will fail w/o .git directories.
458 + mkdir -p .git src/3rdparty/chromium/.git || die
459 + fi
460 + # We need to make sure this integrates well into Qt 5.15.2 installation.
461 + # Otherwise revdeps fail w/o heavy changes. This is the simplest way to do it.
462 + # See also: https://www.qt.io/blog/building-qt-webengine-against-other-qt-versions
463 + sed -e "/^MODULE_VERSION/s/5\.15\.[3456789]/${QT5_PV}/" -i .qmake.conf || die
464 +
465 + # QTBUG-88657 - jumbo-build could still make trouble
466 + if ! use jumbo-build; then
467 + sed -i -e 's|use_jumbo_build=true|use_jumbo_build=false|' \
468 + src/buildtools/config/common.pri || die
469 + fi
470 +
471 + # bug 620444 - ensure local headers are used
472 + find "${S}" -type f -name "*.pr[fio]" | \
473 + xargs sed -i -e 's|INCLUDEPATH += |&$${QTWEBENGINE_ROOT}_build/include $${QTWEBENGINE_ROOT}/include |' || die
474 +
475 + if use system-icu; then
476 + # Sanity check to ensure that bundled copy of ICU is not used.
477 + # Whole src/3rdparty/chromium/third_party/icu directory cannot be deleted because
478 + # src/3rdparty/chromium/third_party/icu/BUILD.gn is used by build system.
479 + # If usage of headers of bundled copy of ICU occurs, then lists of shim headers in
480 + # shim_headers("icui18n_shim") and shim_headers("icuuc_shim") in
481 + # src/3rdparty/chromium/third_party/icu/BUILD.gn should be updated.
482 + local file
483 + while read file; do
484 + echo "#error This file should not be used!" > "${file}" || die
485 + done < <(find src/3rdparty/chromium/third_party/icu -type f "(" -name "*.c" -o -name "*.cpp" -o -name "*.h" ")" 2>/dev/null)
486 + fi
487 +
488 + # src/3rdparty/gn fails with libc++ due to passing of `-static-libstdc++`
489 + if tc-is-clang && has_version 'sys-devel/clang[default-libcxx]'; then
490 + eapply "${FILESDIR}/${PN}-5.15.2_p20210521-clang-libc++.patch"
491 + fi
492 +
493 + if use system-ffmpeg && has_version '>=media-video/ffmpeg-5'; then
494 + eapply "${FILESDIR}/${PN}-5.15.3_p20220330-ffmpeg5.patch" # by Archlinux, bug 831437
495 + fi
496 +
497 + qt_use_disable_config alsa webengine-alsa src/buildtools/config/linux.pri
498 + qt_use_disable_config pulseaudio webengine-pulseaudio src/buildtools/config/linux.pri
499 +
500 + qt_use_disable_mod designer webenginewidgets src/plugins/plugins.pro
501 +
502 + qt_use_disable_mod widgets widgets src/src.pro
503 +
504 + qt5-build_src_prepare
505 +
506 + # we need to generate ppc64 stuff because upstream does not ship it yet
507 + if use ppc64; then
508 + einfo "Patching for ppc64le and generating build files"
509 + eapply "${FILESDIR}/qtwebengine-5.15.2-enable-ppc64.patch"
510 + pushd src/3rdparty/chromium > /dev/null || die
511 + eapply -p0 "${WORKDIR}/${PN}-ppc64le"
512 + popd > /dev/null || die
513 + pushd src/3rdparty/chromium/third_party/libvpx > /dev/null || die
514 + mkdir -vp source/config/linux/ppc64 || die
515 + mkdir -p source/libvpx/test || die
516 + touch source/libvpx/test/test.mk || die
517 + ./generate_gni.sh || die
518 + popd >/dev/null || die
519 + fi
520 +}
521 +
522 +src_configure() {
523 + export NINJA_PATH=/usr/bin/ninja
524 + export NINJAFLAGS="${NINJAFLAGS:--j$(makeopts_jobs) -l$(makeopts_loadavg "${MAKEOPTS}" 0) -v}"
525 +
526 + local myqmakeargs=(
527 + --
528 + -no-build-qtpdf
529 + -printing-and-pdf
530 + -system-opus
531 + -system-webp
532 + $(qt_use alsa)
533 + $(qt_use !bindist proprietary-codecs)
534 + $(qt_use geolocation webengine-geolocation)
535 + $(qt_use kerberos webengine-kerberos)
536 + $(qt_use pulseaudio)
537 + $(usex system-ffmpeg -system-ffmpeg -qt-ffmpeg)
538 + $(qt_use system-icu webengine-icu)
539 + $(usex screencast -webengine-webrtc-pipewire '')
540 + )
541 + qt5-build_src_configure
542 +}
543 +
544 +src_install() {
545 + qt5-build_src_install
546 +
547 + # bug 601472
548 + if [[ ! -f ${D}${QT5_LIBDIR}/libQt5WebEngine.so ]]; then
549 + die "${CATEGORY}/${PF} failed to build anything. Please report to https://bugs.gentoo.org/"
550 + fi
551 +}
552 +
553 +pkg_preinst() {
554 + elog "This version of Qt WebEngine is based on Chromium version 87.0.4280, with"
555 + elog "additional security fixes from newer versions. Extensive as it is, the"
556 + elog "list of backports is impossible to evaluate, but always bound to be behind"
557 + elog "Chromium's release schedule."
558 + elog "In addition, various online services may deny service based on an outdated"
559 + elog "user agent version (and/or other checks). Google is already known to do so."
560 + elog
561 + elog "tldr: Your web browsing experience will be compromised."
562 +}