1 |
commit: 07dfab4b3469b6455f543f156b66816602eaf14d |
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 17:07:12 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/qt.git/commit/?id=07dfab4b |
7 |
|
8 |
dev-qt/qtwebengine: Fix build with >=ffmpeg-5 |
9 |
|
10 |
Patch sourced from ArchLinux. |
11 |
|
12 |
Closes: https://bugs.gentoo.org/831487 |
13 |
Package-Manager: Portage-3.0.30, Repoman-3.0.3 |
14 |
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org> |
15 |
|
16 |
.../qtwebengine-5.15.3_p20220329-clang14.patch | 26 ++++ |
17 |
.../qtwebengine-5.15.3_p20220330-ffmpeg5.patch | 169 +++++++++++++++++++++ |
18 |
dev-qt/qtwebengine/metadata.xml | 12 +- |
19 |
dev-qt/qtwebengine/qtwebengine-5.15.3.9999.ebuild | 6 +- |
20 |
4 files changed, 204 insertions(+), 9 deletions(-) |
21 |
|
22 |
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 |
23 |
index ed48544f..c1a98d09 100644 |
24 |
--- a/dev-qt/qtwebengine/files/qtwebengine-5.15.3_p20220329-clang14.patch |
25 |
+++ b/dev-qt/qtwebengine/files/qtwebengine-5.15.3_p20220329-clang14.patch |
26 |
@@ -1,3 +1,29 @@ |
27 |
+From 0825e7bc64e47d87e1f1026cc80c933550f114f5 Mon Sep 17 00:00:00 2001 |
28 |
+From: Dimitry Andric <dim@×××××××.org> |
29 |
+Date: Mon, 14 Feb 2022 13:55:25 +0100 |
30 |
+Subject: www/qt5-webengine: fix build with clang 14 |
31 |
+ |
32 |
+Fixes compile error: |
33 |
+ |
34 |
+In file included from gen/third_party/blink/renderer/platform/platform_jumbo_63.cc:8: |
35 |
+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 |
36 |
+typedef struct { |
37 |
+ ^ |
38 |
+ UTextWithBuffer |
39 |
+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 |
40 |
+ DISALLOW_NEW(); |
41 |
+ ^~~~~~~~~~~~~~ |
42 |
+src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/allocator/allocator.h:40:2: note: expanded from macro 'DISALLOW_NEW' |
43 |
+ public: \ |
44 |
+ ^~~~~~~ |
45 |
+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 |
46 |
+} UTextWithBuffer; |
47 |
+ ^ |
48 |
+ |
49 |
+PR: 261949 |
50 |
+Approved by: adridg (maintainer) |
51 |
+MFH: 2022Q1 |
52 |
+ |
53 |
--- a/src/3rdparty/chromium/third_party/blink/renderer/platform/text/text_break_iterator_icu.cc |
54 |
+++ b/src/3rdparty/chromium/third_party/blink/renderer/platform/text/text_break_iterator_icu.cc |
55 |
@@ -119,11 +119,11 @@ enum TextContext { kNoContext, kPriorContext, kPrimary |
56 |
|
57 |
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 |
58 |
new file mode 100644 |
59 |
index 00000000..d85c1985 |
60 |
--- /dev/null |
61 |
+++ b/dev-qt/qtwebengine/files/qtwebengine-5.15.3_p20220330-ffmpeg5.patch |
62 |
@@ -0,0 +1,169 @@ |
63 |
+From 05f6ffbbce0a2aad01dc05d682cbe4a1ec44fad5 Mon Sep 17 00:00:00 2001 |
64 |
+From: Antonio Rojas <arojas@×××××××××.org> |
65 |
+Date: Tue, 25 Jan 2022 10:51:58 +0000 |
66 |
+Subject: [PATCH] Fix build with ffmpeg 5 |
67 |
+ |
68 |
+--- |
69 |
+ chromium/media/ffmpeg/ffmpeg_common.h | 1 + |
70 |
+ chromium/media/filters/audio_file_reader.cc | 2 +- |
71 |
+ chromium/media/filters/ffmpeg_audio_decoder.cc | 2 +- |
72 |
+ chromium/media/filters/ffmpeg_demuxer.cc | 12 ++++++------ |
73 |
+ chromium/media/filters/ffmpeg_glue.cc | 4 ---- |
74 |
+ chromium/media/filters/ffmpeg_video_decoder.cc | 2 +- |
75 |
+ chromium/media/filters/media_file_checker.cc | 2 +- |
76 |
+ .../video_coding/codecs/h264/h264_decoder_impl.cc | 2 +- |
77 |
+ 8 files changed, 12 insertions(+), 15 deletions(-) |
78 |
+ |
79 |
+diff --git a/chromium/media/ffmpeg/ffmpeg_common.h b/chromium/media/ffmpeg/ffmpeg_common.h |
80 |
+index 2734a485cbd..70b1877a43c 100644 |
81 |
+--- a/chromium/media/ffmpeg/ffmpeg_common.h |
82 |
++++ b/chromium/media/ffmpeg/ffmpeg_common.h |
83 |
+@@ -29,6 +29,7 @@ extern "C" { |
84 |
+ #include <libavformat/avformat.h> |
85 |
+ #include <libavformat/avio.h> |
86 |
+ #include <libavutil/avutil.h> |
87 |
++#include <libavutil/channel_layout.h> |
88 |
+ #include <libavutil/imgutils.h> |
89 |
+ #include <libavutil/log.h> |
90 |
+ #include <libavutil/mastering_display_metadata.h> |
91 |
+diff --git a/chromium/media/filters/audio_file_reader.cc b/chromium/media/filters/audio_file_reader.cc |
92 |
+index cb81d920def..bd73908d0ca 100644 |
93 |
+--- a/chromium/media/filters/audio_file_reader.cc |
94 |
++++ b/chromium/media/filters/audio_file_reader.cc |
95 |
+@@ -85,7 +85,7 @@ bool AudioFileReader::OpenDemuxer() { |
96 |
+ } |
97 |
+ |
98 |
+ bool AudioFileReader::OpenDecoder() { |
99 |
+- AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id); |
100 |
++ const AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id); |
101 |
+ if (codec) { |
102 |
+ // MP3 decodes to S16P which we don't support, tell it to use S16 instead. |
103 |
+ if (codec_context_->sample_fmt == AV_SAMPLE_FMT_S16P) |
104 |
+diff --git a/chromium/media/filters/ffmpeg_audio_decoder.cc b/chromium/media/filters/ffmpeg_audio_decoder.cc |
105 |
+index 0d825ed791b..72fac6167ef 100644 |
106 |
+--- a/chromium/media/filters/ffmpeg_audio_decoder.cc |
107 |
++++ b/chromium/media/filters/ffmpeg_audio_decoder.cc |
108 |
+@@ -329,7 +329,7 @@ bool FFmpegAudioDecoder::ConfigureDecoder(const AudioDecoderConfig& config) { |
109 |
+ } |
110 |
+ } |
111 |
+ |
112 |
+- AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id); |
113 |
++ const AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id); |
114 |
+ if (!codec || |
115 |
+ avcodec_open2(codec_context_.get(), codec, &codec_options) < 0) { |
116 |
+ DLOG(ERROR) << "Could not initialize audio decoder: " |
117 |
+diff --git a/chromium/media/filters/ffmpeg_demuxer.cc b/chromium/media/filters/ffmpeg_demuxer.cc |
118 |
+index d34db63f3ef..427565b00c1 100644 |
119 |
+--- a/chromium/media/filters/ffmpeg_demuxer.cc |
120 |
++++ b/chromium/media/filters/ffmpeg_demuxer.cc |
121 |
+@@ -98,12 +98,12 @@ static base::TimeDelta ExtractStartTime(AVStream* stream) { |
122 |
+ |
123 |
+ // Next try to use the first DTS value, for codecs where we know PTS == DTS |
124 |
+ // (excludes all H26x codecs). The start time must be returned in PTS. |
125 |
+- if (stream->first_dts != kNoFFmpegTimestamp && |
126 |
++ if (av_stream_get_first_dts(stream) != kNoFFmpegTimestamp && |
127 |
+ stream->codecpar->codec_id != AV_CODEC_ID_HEVC && |
128 |
+ stream->codecpar->codec_id != AV_CODEC_ID_H264 && |
129 |
+ stream->codecpar->codec_id != AV_CODEC_ID_MPEG4) { |
130 |
+ const base::TimeDelta first_pts = |
131 |
+- ConvertFromTimeBase(stream->time_base, stream->first_dts); |
132 |
++ ConvertFromTimeBase(stream->time_base, av_stream_get_first_dts(stream)); |
133 |
+ if (first_pts < start_time) |
134 |
+ start_time = first_pts; |
135 |
+ } |
136 |
+@@ -408,11 +408,11 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) { |
137 |
+ scoped_refptr<DecoderBuffer> buffer; |
138 |
+ |
139 |
+ if (type() == DemuxerStream::TEXT) { |
140 |
+- int id_size = 0; |
141 |
++ size_t id_size = 0; |
142 |
+ uint8_t* id_data = av_packet_get_side_data( |
143 |
+ packet.get(), AV_PKT_DATA_WEBVTT_IDENTIFIER, &id_size); |
144 |
+ |
145 |
+- int settings_size = 0; |
146 |
++ size_t settings_size = 0; |
147 |
+ uint8_t* settings_data = av_packet_get_side_data( |
148 |
+ packet.get(), AV_PKT_DATA_WEBVTT_SETTINGS, &settings_size); |
149 |
+ |
150 |
+@@ -424,7 +424,7 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) { |
151 |
+ buffer = DecoderBuffer::CopyFrom(packet->data, packet->size, |
152 |
+ side_data.data(), side_data.size()); |
153 |
+ } else { |
154 |
+- int side_data_size = 0; |
155 |
++ size_t side_data_size = 0; |
156 |
+ uint8_t* side_data = av_packet_get_side_data( |
157 |
+ packet.get(), AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, &side_data_size); |
158 |
+ |
159 |
+@@ -485,7 +485,7 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) { |
160 |
+ packet->size - data_offset); |
161 |
+ } |
162 |
+ |
163 |
+- int skip_samples_size = 0; |
164 |
++ size_t skip_samples_size = 0; |
165 |
+ const uint32_t* skip_samples_ptr = |
166 |
+ reinterpret_cast<const uint32_t*>(av_packet_get_side_data( |
167 |
+ packet.get(), AV_PKT_DATA_SKIP_SAMPLES, &skip_samples_size)); |
168 |
+diff --git a/chromium/media/filters/ffmpeg_glue.cc b/chromium/media/filters/ffmpeg_glue.cc |
169 |
+index 0ef3521473d..8483ecc348f 100644 |
170 |
+--- a/chromium/media/filters/ffmpeg_glue.cc |
171 |
++++ b/chromium/media/filters/ffmpeg_glue.cc |
172 |
+@@ -59,7 +59,6 @@ static int64_t AVIOSeekOperation(void* opaque, int64_t offset, int whence) { |
173 |
+ } |
174 |
+ |
175 |
+ void FFmpegGlue::InitializeFFmpeg() { |
176 |
+- av_register_all(); |
177 |
+ } |
178 |
+ |
179 |
+ static void LogContainer(bool is_local_file, |
180 |
+@@ -95,9 +94,6 @@ FFmpegGlue::FFmpegGlue(FFmpegURLProtocol* protocol) { |
181 |
+ // Enable fast, but inaccurate seeks for MP3. |
182 |
+ format_context_->flags |= AVFMT_FLAG_FAST_SEEK; |
183 |
+ |
184 |
+- // Ensures we can read out various metadata bits like vp8 alpha. |
185 |
+- format_context_->flags |= AVFMT_FLAG_KEEP_SIDE_DATA; |
186 |
+- |
187 |
+ // Ensures format parsing errors will bail out. From an audit on 11/2017, all |
188 |
+ // instances were real failures. Solves bugs like http://crbug.com/710791. |
189 |
+ format_context_->error_recognition |= AV_EF_EXPLODE; |
190 |
+diff --git a/chromium/media/filters/ffmpeg_video_decoder.cc b/chromium/media/filters/ffmpeg_video_decoder.cc |
191 |
+index ef12477ee89..7996606f5f9 100644 |
192 |
+--- a/chromium/media/filters/ffmpeg_video_decoder.cc |
193 |
++++ b/chromium/media/filters/ffmpeg_video_decoder.cc |
194 |
+@@ -391,7 +391,7 @@ bool FFmpegVideoDecoder::ConfigureDecoder(const VideoDecoderConfig& config, |
195 |
+ if (decode_nalus_) |
196 |
+ codec_context_->flags2 |= AV_CODEC_FLAG2_CHUNKS; |
197 |
+ |
198 |
+- AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id); |
199 |
++ const AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id); |
200 |
+ if (!codec || avcodec_open2(codec_context_.get(), codec, NULL) < 0) { |
201 |
+ ReleaseFFmpegResources(); |
202 |
+ return false; |
203 |
+diff --git a/chromium/media/filters/media_file_checker.cc b/chromium/media/filters/media_file_checker.cc |
204 |
+index 59c2a2fc618..1a9872c7acb 100644 |
205 |
+--- a/chromium/media/filters/media_file_checker.cc |
206 |
++++ b/chromium/media/filters/media_file_checker.cc |
207 |
+@@ -68,7 +68,7 @@ bool MediaFileChecker::Start(base::TimeDelta check_time) { |
208 |
+ auto context = AVStreamToAVCodecContext(format_context->streams[i]); |
209 |
+ if (!context) |
210 |
+ continue; |
211 |
+- AVCodec* codec = avcodec_find_decoder(cp->codec_id); |
212 |
++ const AVCodec* codec = avcodec_find_decoder(cp->codec_id); |
213 |
+ if (codec && avcodec_open2(context.get(), codec, nullptr) >= 0) { |
214 |
+ auto loop = std::make_unique<FFmpegDecodingLoop>(context.get()); |
215 |
+ stream_contexts[i] = {std::move(context), std::move(loop)}; |
216 |
+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 |
217 |
+index 9002b874611..d12fade8b63 100644 |
218 |
+--- a/chromium/third_party/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc |
219 |
++++ b/chromium/third_party/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc |
220 |
+@@ -203,7 +203,7 @@ int32_t H264DecoderImpl::InitDecode(const VideoCodec* codec_settings, |
221 |
+ // a pointer |this|. |
222 |
+ av_context_->opaque = this; |
223 |
+ |
224 |
+- AVCodec* codec = avcodec_find_decoder(av_context_->codec_id); |
225 |
++ const AVCodec* codec = avcodec_find_decoder(av_context_->codec_id); |
226 |
+ if (!codec) { |
227 |
+ // This is an indication that FFmpeg has not been initialized or it has not |
228 |
+ // been compiled/initialized with the correct set of codecs. |
229 |
+-- |
230 |
+2.35.1 |
231 |
+ |
232 |
|
233 |
diff --git a/dev-qt/qtwebengine/metadata.xml b/dev-qt/qtwebengine/metadata.xml |
234 |
index 944fcbe0..0bc98db9 100644 |
235 |
--- a/dev-qt/qtwebengine/metadata.xml |
236 |
+++ b/dev-qt/qtwebengine/metadata.xml |
237 |
@@ -11,16 +11,12 @@ |
238 |
<name>Georgy Yakovlev</name> |
239 |
</maintainer> |
240 |
<use> |
241 |
- <flag name="designer">Install the QWebEngineView plugin used to add widgets in |
242 |
- <pkg>dev-qt/designer</pkg> forms that display web pages.</flag> |
243 |
- <flag name="geolocation">Enable physical position determination |
244 |
- via <pkg>dev-qt/qtpositioning</pkg></flag> |
245 |
+ <flag name="designer">Install the QWebEngineView plugin used to add widgets in <pkg>dev-qt/designer</pkg> forms that display web pages.</flag> |
246 |
+ <flag name="geolocation">Enable physical position determination via <pkg>dev-qt/qtpositioning</pkg></flag> |
247 |
<flag name="jumbo-build">Combine source files to speed up build process.</flag> |
248 |
<flag name="pipewire">Enable PipeWire support for WebRTC.</flag> |
249 |
- <flag name="system-ffmpeg">Use the system-wide <pkg>media-video/ffmpeg</pkg> |
250 |
- instead of bundled.</flag> |
251 |
- <flag name="system-icu">Use the system-wide <pkg>dev-libs/icu</pkg> |
252 |
- instead of bundled.</flag> |
253 |
+ <flag name="system-ffmpeg">Use the system-wide <pkg>media-video/ffmpeg</pkg> instead of bundled.</flag> |
254 |
+ <flag name="system-icu">Use the system-wide <pkg>dev-libs/icu</pkg> instead of bundled.</flag> |
255 |
<flag name="widgets">Enable QtWidgets support</flag> |
256 |
</use> |
257 |
<upstream> |
258 |
|
259 |
diff --git a/dev-qt/qtwebengine/qtwebengine-5.15.3.9999.ebuild b/dev-qt/qtwebengine/qtwebengine-5.15.3.9999.ebuild |
260 |
index 53315490..b755d163 100644 |
261 |
--- a/dev-qt/qtwebengine/qtwebengine-5.15.3.9999.ebuild |
262 |
+++ b/dev-qt/qtwebengine/qtwebengine-5.15.3.9999.ebuild |
263 |
@@ -106,8 +106,8 @@ PATCHES=( |
264 |
"${FILESDIR}/${PN}-5.15.2_p20210224-chromium-87-v8-icu68.patch" # downstream, bug 757606 |
265 |
"${FILESDIR}/${PN}-5.15.2_p20210224-disable-git.patch" # downstream snapshot fix |
266 |
"${FILESDIR}/${PN}-5.15.2_p20211015-pdfium-system-lcms2.patch" # by Debian, QTBUG-61746 |
267 |
- "${WORKDIR}/${PN}-5.15.2_p20211019-jumbo-build.patch" # bug 813957 |
268 |
"${FILESDIR}/${PN}-5.15.3_p20220329-clang14.patch" # fixes build with clang 14 |
269 |
+ "${WORKDIR}/${PN}-5.15.2_p20211019-jumbo-build.patch" # bug 813957 |
270 |
) |
271 |
|
272 |
qtwebengine_check-reqs() { |
273 |
@@ -199,6 +199,10 @@ src_prepare() { |
274 |
eapply "${FILESDIR}/${PN}-5.15.2_p20210521-clang-libc++.patch" |
275 |
fi |
276 |
|
277 |
+ if use system-ffmpeg && has_version '>=media-video/ffmpeg-5'; then |
278 |
+ eapply "${FILESDIR}/${PN}-5.15.3_p20220330-ffmpeg5.patch" # by Archlinux, bug 831437 |
279 |
+ fi |
280 |
+ |
281 |
qt_use_disable_config alsa webengine-alsa src/buildtools/config/linux.pri |
282 |
qt_use_disable_config pulseaudio webengine-pulseaudio src/buildtools/config/linux.pri |