diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000000000000000000000000000000000..05a0e946187b8160d0c54c23a9f8100f44e0f43b --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.xz filter=lfs diff=lfs merge=lfs -text diff --git a/.lfsconfig b/.lfsconfig new file mode 100644 index 0000000000000000000000000000000000000000..71ceafd5837ef21c386830648da78c85ee899849 --- /dev/null +++ b/.lfsconfig @@ -0,0 +1,2 @@ +[lfs] + url = https://artlfs.openeuler.openatom.cn/src-openEuler/webkit2gtk3 diff --git a/_multibuild b/_multibuild index b38bbabb88d8013a9b1983c78d41e7f160a9a8f4..d3c3cd2c8dcba6b10028c9ef99c1298251d601cc 100644 --- a/_multibuild +++ b/_multibuild @@ -1,4 +1,4 @@ - - webkit2gtk4_1 - webkit2gtk5_0 - \ No newline at end of file + + webkit2gtk4_1 + webkitgtk6_0 + diff --git a/backport-CVE-2023-28204.patch b/backport-CVE-2023-28204.patch deleted file mode 100644 index 17d4a96324a0575a9eea8c21bf5ff3dea8194989..0000000000000000000000000000000000000000 --- a/backport-CVE-2023-28204.patch +++ /dev/null @@ -1,102 +0,0 @@ -From e34edaa74575ee13efcebdb7672b949a743ab32a Mon Sep 17 00:00:00 2001 -From: Michael Saboff -Date: Mon, 3 Apr 2023 20:25:08 -0700 -Subject: [PATCH] [JSC] RegExpGlobalData::performMatch issue leading to OOB - read https://bugs.webkit.org/show_bug.cgi?id=254930 rdar://107436732 - -Reviewed by Alexey Shvayka. - -Fixed two issues: -1) In YarrInterpreter.cpp::matchAssertionBOL() we were advancing the string position for non-BMP - characters. Since it is an assertion, we shouldn't advance the character position. - Made the same fix to matchAssertionEOL(). -2) In StringPrototype.cpp::replaceUsingRegExpSearch(), we need to advance past both elements of - a non-BMP character for the case where the RegExp match is empty. - -* JSTests/stress/string-replace-regexp-matchBOL-correct-advancing.js: New test. -* Source/JavaScriptCore/runtime/StringPrototype.cpp: -(JSC::replaceUsingRegExpSearch): -* Source/JavaScriptCore/yarr/YarrInterpreter.cpp: -(JSC::Yarr::Interpreter::InputStream::readCheckedDontAdvance): -(JSC::Yarr::Interpreter::matchAssertionBOL): -(JSC::Yarr::Interpreter::matchAssertionEOL): - -Canonical link: https://commits.webkit.org/259548.551@safari-7615-branch ---- - .../runtime/StringPrototype.cpp | 10 ++++++++++ - .../JavaScriptCore/yarr/YarrInterpreter.cpp | 19 +++++++++++++++++-- - 2 files changed, 27 insertions(+), 2 deletions(-) - -diff --git a/Source/JavaScriptCore/runtime/StringPrototype.cpp b/Source/JavaScriptCore/runtime/StringPrototype.cpp -index 08104b1d..459295f7 100644 ---- a/Source/JavaScriptCore/runtime/StringPrototype.cpp -+++ b/Source/JavaScriptCore/runtime/StringPrototype.cpp -@@ -603,6 +603,11 @@ static ALWAYS_INLINE JSString* replaceUsingRegExpSearch( - startPosition++; - if (startPosition > sourceLen) - break; -+ if (U16_IS_LEAD(source[startPosition - 1]) && U16_IS_TRAIL(source[startPosition])) { -+ startPosition++; -+ if (startPosition > sourceLen) -+ break; -+ } - } - } - } else { -@@ -682,6 +687,11 @@ static ALWAYS_INLINE JSString* replaceUsingRegExpSearch( - startPosition++; - if (startPosition > sourceLen) - break; -+ if (U16_IS_LEAD(source[startPosition - 1]) && U16_IS_TRAIL(source[startPosition])) { -+ startPosition++; -+ if (startPosition > sourceLen) -+ break; -+ } - } - } while (global); - } -diff --git a/Source/JavaScriptCore/yarr/YarrInterpreter.cpp b/Source/JavaScriptCore/yarr/YarrInterpreter.cpp -index 95a848a1..d222e620 100644 ---- a/Source/JavaScriptCore/yarr/YarrInterpreter.cpp -+++ b/Source/JavaScriptCore/yarr/YarrInterpreter.cpp -@@ -209,6 +209,21 @@ public: - } - return result; - } -+ -+ int readCheckedDontAdvance(unsigned negativePositionOffest) -+ { -+ RELEASE_ASSERT(pos >= negativePositionOffest); -+ unsigned p = pos - negativePositionOffest; -+ ASSERT(p < length); -+ int result = input[p]; -+ if (U16_IS_LEAD(result) && decodeSurrogatePairs && p + 1 < length && U16_IS_TRAIL(input[p + 1])) { -+ if (atEnd()) -+ return -1; -+ -+ result = U16_GET_SUPPLEMENTARY(result, input[p + 1]); -+ } -+ return result; -+ } - - int readSurrogatePairChecked(unsigned negativePositionOffset) - { -@@ -482,13 +497,13 @@ public: - - bool matchAssertionBOL(ByteTerm& term) - { -- return (input.atStart(term.inputPosition)) || (pattern->multiline() && testCharacterClass(pattern->newlineCharacterClass, input.readChecked(term.inputPosition + 1))); -+ return (input.atStart(term.inputPosition)) || (pattern->multiline() && testCharacterClass(pattern->newlineCharacterClass, input.readCheckedDontAdvance(term.inputPosition + 1))); - } - - bool matchAssertionEOL(ByteTerm& term) - { - if (term.inputPosition) -- return (input.atEnd(term.inputPosition)) || (pattern->multiline() && testCharacterClass(pattern->newlineCharacterClass, input.readChecked(term.inputPosition))); -+ return (input.atEnd(term.inputPosition)) || (pattern->multiline() && testCharacterClass(pattern->newlineCharacterClass, input.readCheckedDontAdvance(term.inputPosition))); - - return (input.atEnd()) || (pattern->multiline() && testCharacterClass(pattern->newlineCharacterClass, input.read())); - } --- -2.33.0 - diff --git a/backport-CVE-2023-32373.patch b/backport-CVE-2023-32373.patch deleted file mode 100644 index 83d6bdd7ddaf64ce0d5d22f7979ece4cfff4f5a5..0000000000000000000000000000000000000000 --- a/backport-CVE-2023-32373.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 85fd2302d16a09a82d9a6e81eb286babb23c4b3c Mon Sep 17 00:00:00 2001 -From: Antoine Quint -Date: Mon, 22 May 2023 13:37:32 -0700 -Subject: [PATCH] Potential use-after-free in WebAnimation::commitStyles - https://bugs.webkit.org/show_bug.cgi?id=254840 rdar://107444873 - -Reviewed by Dean Jackson and Darin Adler. - -Ensure that the animation's effect and target are kept alive for the duration of this method -since it is possible that calling updateStyleIfNeeded() could call into JavaScript and thus -these two pointers could be changed to a null value using the Web Animations API. - -* Source/WebCore/animation/WebAnimation.cpp: -(WebCore::WebAnimation::commitStyles): - -Originally-landed-as: 259548.532@safari-7615-branch (1d6fe184ea53). rdar://107444873 -Canonical link: https://commits.webkit.org/264363@main ---- - Source/WebCore/animation/WebAnimation.cpp | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/Source/WebCore/animation/WebAnimation.cpp b/Source/WebCore/animation/WebAnimation.cpp -index 68ea47985807..ae20c79c36cf 100644 ---- a/Source/WebCore/animation/WebAnimation.cpp -+++ b/Source/WebCore/animation/WebAnimation.cpp -@@ -1531,8 +1531,8 @@ ExceptionOr WebAnimation::commitStyles() - // https://drafts.csswg.org/web-animations-1/#commit-computed-styles - - // 1. Let targets be the set of all effect targets for animation effects associated with animation. -- auto* effect = dynamicDowncast(m_effect.get()); -- auto* target = effect ? effect->target() : nullptr; -+ RefPtr effect = dynamicDowncast(m_effect.get()); -+ RefPtr target = effect ? effect->target() : nullptr; - - // 2. For each target in targets: - // diff --git a/backport-CVE-2023-32409.patch b/backport-CVE-2023-32409.patch deleted file mode 100644 index f7847246daa656bb6ec8ab013bbda926d959f0e6..0000000000000000000000000000000000000000 --- a/backport-CVE-2023-32409.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 54408f5746f2401721bd56d71de132a22b6f9856 Mon Sep 17 00:00:00 2001 -From: Mike Wyrzykowski -Date: Wed, 12 Apr 2023 17:30:56 -0700 -Subject: [PATCH] [WebGPU] RemoteBuffer unmap should check the input vector - https://bugs.webkit.org/show_bug.cgi?id=255350 - -Reviewed by Myles C. Maxfield. - -Ensure data vector passed to unmap is valid for the currently -mapped buffer. - -* Source/WebKit/GPUProcess/graphics/WebGPU/RemoteBuffer.cpp: -(WebKit::RemoteBuffer::unmap): - -Canonical link: https://commits.webkit.org/262895@main ---- - Source/WebKit/GPUProcess/graphics/WebGPU/RemoteBuffer.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Source/WebKit/GPUProcess/graphics/WebGPU/RemoteBuffer.cpp b/Source/WebKit/GPUProcess/graphics/WebGPU/RemoteBuffer.cpp -index f533f5c30c32b..ec12ea2ac171b 100644 ---- a/Source/WebKit/GPUProcess/graphics/WebGPU/RemoteBuffer.cpp -+++ b/Source/WebKit/GPUProcess/graphics/WebGPU/RemoteBuffer.cpp -@@ -79,7 +79,7 @@ void RemoteBuffer::getMappedRange(PAL::WebGPU::Size64 offset, std::optional&& data) - { -- if (!m_mappedRange) -+ if (!m_mappedRange || m_mappedRange->byteLength < data.size()) - return; - ASSERT(m_isMapped); - diff --git a/backport-CVE-2023-39928.patch b/backport-CVE-2023-39928.patch deleted file mode 100644 index 5bc4dd17651511c9611f4ec67f51b63df28793dd..0000000000000000000000000000000000000000 --- a/backport-CVE-2023-39928.patch +++ /dev/null @@ -1,511 +0,0 @@ -From 37bc7427407685a224044ddc3df4b81c41d6fd38 Mon Sep 17 00:00:00 2001 -From: Philippe Normand -Date: Mon, 28 Aug 2023 01:34:28 -0700 -Subject: [PATCH] [GStreamer] Prevent a crash when fetching data on stopped - MediaRecorder https://bugs.webkit.org/show_bug.cgi?id=260649 - rdar://problem/114370120 - -Reviewed by Xabier Rodriguez-Calvar. - -The backend (GStreamer transcoder) is now clearly separated from the MediaRecorderPrivate, so that -fetchData() can create a weak pointer to be used from the main thread. If the backend was destroyed -in-flight no unsafe memory access is performed. - -Test: http/wpt/mediarecorder/MediaRecorder-start-stop-crash.html -Canonical link: https://commits.webkit.org/267345@main ---- - .../graphics/gstreamer/GRefPtrGStreamer.cpp | 52 +++++++ - .../graphics/gstreamer/GRefPtrGStreamer.h | 15 ++ - .../MediaRecorderPrivateGStreamer.cpp | 140 ++++++++++++------ - .../MediaRecorderPrivateGStreamer.h | 57 +++++-- - 4 files changed, 206 insertions(+), 62 deletions(-) - -diff --git a/Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.cpp -index cc0afa79..822f5aaa 100644 ---- a/Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.cpp -+++ b/Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.cpp -@@ -34,6 +34,10 @@ - #undef GST_USE_UNSTABLE_API - #endif - -+#if USE(GSTREAMER_TRANSCODER) -+#include -+#endif -+ - namespace WTF { - - template<> GRefPtr adoptGRef(GstMiniObject* ptr) -@@ -754,6 +758,54 @@ template<> void derefGPtr(GstRTPHeaderExtension* ptr) - - #endif // USE(GSTREAMER_WEBRTC) - -+#if USE(GSTREAMER_TRANSCODER) -+ -+template<> -+GRefPtr adoptGRef(GstTranscoder* ptr) -+{ -+ return GRefPtr(ptr, GRefPtrAdopt); -+} -+ -+template<> -+GstTranscoder* refGPtr(GstTranscoder* ptr) -+{ -+ if (ptr) -+ gst_object_ref(GST_OBJECT_CAST(ptr)); -+ -+ return ptr; -+} -+ -+template<> -+void derefGPtr(GstTranscoder* ptr) -+{ -+ if (ptr) -+ gst_object_unref(ptr); -+} -+ -+template<> -+GRefPtr adoptGRef(GstTranscoderSignalAdapter* ptr) -+{ -+ return GRefPtr(ptr, GRefPtrAdopt); -+} -+ -+template<> -+GstTranscoderSignalAdapter* refGPtr(GstTranscoderSignalAdapter* ptr) -+{ -+ if (ptr) -+ g_object_ref(G_OBJECT(ptr)); -+ -+ return ptr; -+} -+ -+template<> -+void derefGPtr(GstTranscoderSignalAdapter* ptr) -+{ -+ if (ptr) -+ g_object_unref(ptr); -+} -+ -+#endif // USE(GSTREAMER_TRANSCODER) -+ - } // namespace WTF - - #endif // USE(GSTREAMER) -diff --git a/Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.h b/Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.h -index 57c93254..5ddbeec1 100644 ---- a/Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.h -+++ b/Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.h -@@ -45,6 +45,11 @@ typedef struct _GstWebRTCRTPTransceiver GstWebRTCRTPTransceiver; - typedef struct _GstRTPHeaderExtension GstRTPHeaderExtension; - #endif - -+#if USE(GSTREAMER_TRANSCODER) -+typedef struct _GstTranscoder GstTranscoder; -+typedef struct _GstTranscoderSignalAdapter GstTranscoderSignalAdapter; -+#endif -+ - namespace WTF { - - template<> GRefPtr adoptGRef(GstPlugin* ptr); -@@ -197,6 +202,16 @@ template<> void derefGPtr(GstRTPHeaderExtension*); - - #endif - -+#if USE(GSTREAMER_TRANSCODER) -+template<> GRefPtr adoptGRef(GstTranscoder*); -+template<> GstTranscoder* refGPtr(GstTranscoder*); -+template<> void derefGPtr(GstTranscoder*); -+ -+template<> GRefPtr adoptGRef(GstTranscoderSignalAdapter*); -+template<> GstTranscoderSignalAdapter* refGPtr(GstTranscoderSignalAdapter*); -+template<> void derefGPtr(GstTranscoderSignalAdapter*); -+#endif // USE(GSTREAMER_TRANSCODER) -+ - } // namespace WTF - - #endif // USE(GSTREAMER) -diff --git a/Source/WebCore/platform/mediarecorder/MediaRecorderPrivateGStreamer.cpp b/Source/WebCore/platform/mediarecorder/MediaRecorderPrivateGStreamer.cpp -index 835e357b..968eee75 100644 ---- a/Source/WebCore/platform/mediarecorder/MediaRecorderPrivateGStreamer.cpp -+++ b/Source/WebCore/platform/mediarecorder/MediaRecorderPrivateGStreamer.cpp -@@ -30,6 +30,7 @@ - #include "MediaRecorderPrivateOptions.h" - #include "MediaStreamPrivate.h" - #include -+#include - #include - - namespace WebCore { -@@ -46,21 +47,73 @@ std::unique_ptr MediaRecorderPrivateGStreamer::cr - GST_DEBUG_CATEGORY_INIT(webkit_media_recorder_debug, "webkitmediarecorder", 0, "WebKit MediaStream recorder"); - }); - -- auto recorder = makeUnique(stream, options); -+ auto recorder = MediaRecorderPrivateBackend::create(stream, options); - if (!recorder->preparePipeline()) - return nullptr; - -- return recorder; -+ return makeUnique(recorder.releaseNonNull()); - } - --MediaRecorderPrivateGStreamer::MediaRecorderPrivateGStreamer(MediaStreamPrivate& stream, const MediaRecorderPrivateOptions& options) -+MediaRecorderPrivateGStreamer::MediaRecorderPrivateGStreamer(Ref&& recorder) -+ : m_recorder(WTFMove(recorder)) -+{ -+ m_recorder->setSelectTracksCallback([this](auto selectedTracks) { -+ if (selectedTracks.audioTrack) { -+ setAudioSource(&selectedTracks.audioTrack->source()); -+ checkTrackState(*selectedTracks.audioTrack); -+ } -+ if (selectedTracks.videoTrack) { -+ setVideoSource(&selectedTracks.videoTrack->source()); -+ checkTrackState(*selectedTracks.videoTrack); -+ } -+ }); -+} -+ -+void MediaRecorderPrivateGStreamer::startRecording(StartRecordingCallback&& callback) -+{ -+ m_recorder->startRecording(WTFMove(callback)); -+} -+ -+void MediaRecorderPrivateGStreamer::stopRecording(CompletionHandler&& completionHandler) -+{ -+ m_recorder->stopRecording(WTFMove(completionHandler)); -+} -+ -+void MediaRecorderPrivateGStreamer::fetchData(FetchDataCallback&& completionHandler) -+{ -+ m_recorder->fetchData(WTFMove(completionHandler)); -+} -+ -+void MediaRecorderPrivateGStreamer::pauseRecording(CompletionHandler&& completionHandler) -+{ -+ m_recorder->pauseRecording(WTFMove(completionHandler)); -+} -+ -+void MediaRecorderPrivateGStreamer::resumeRecording(CompletionHandler&& completionHandler) -+{ -+ m_recorder->resumeRecording(WTFMove(completionHandler)); -+} -+ -+const String& MediaRecorderPrivateGStreamer::mimeType() const -+{ -+ return m_recorder->mimeType(); -+} -+ -+bool MediaRecorderPrivateGStreamer::isTypeSupported(const ContentType& contentType) -+{ -+ auto& scanner = GStreamerRegistryScanner::singleton(); -+ return scanner.isContentTypeSupported(GStreamerRegistryScanner::Configuration::Encoding, contentType, { }) > MediaPlayerEnums::SupportsType::IsNotSupported; -+} -+ -+MediaRecorderPrivateBackend::MediaRecorderPrivateBackend(MediaStreamPrivate& stream, const MediaRecorderPrivateOptions& options) - : m_stream(stream) - , m_options(options) - { - } - --MediaRecorderPrivateGStreamer::~MediaRecorderPrivateGStreamer() -+MediaRecorderPrivateBackend::~MediaRecorderPrivateBackend() - { -+ m_selectTracksCallback.reset(); - if (m_src) - webkitMediaStreamSrcSignalEndOfStream(WEBKIT_MEDIA_STREAM_SRC(m_src.get())); - if (m_transcoder) { -@@ -69,7 +122,7 @@ MediaRecorderPrivateGStreamer::~MediaRecorderPrivateGStreamer() - } - } - --void MediaRecorderPrivateGStreamer::startRecording(StartRecordingCallback&& callback) -+void MediaRecorderPrivateBackend::startRecording(MediaRecorderPrivate::StartRecordingCallback&& callback) - { - if (!m_pipeline) - preparePipeline(); -@@ -78,7 +131,7 @@ void MediaRecorderPrivateGStreamer::startRecording(StartRecordingCallback&& call - gst_transcoder_run_async(m_transcoder.get()); - } - --void MediaRecorderPrivateGStreamer::stopRecording(CompletionHandler&& completionHandler) -+void MediaRecorderPrivateBackend::stopRecording(CompletionHandler&& completionHandler) - { - GST_DEBUG_OBJECT(m_transcoder.get(), "Stop requested, pushing EOS event"); - -@@ -99,24 +152,31 @@ void MediaRecorderPrivateGStreamer::stopRecording(CompletionHandler&& co - bool isEOS = false; - while (!isEOS) { - LockHolder lock(m_eosLock); -- m_eosCondition.waitFor(m_eosLock, 200_ms, [weakThis = WeakPtr { this }]() -> bool { -- if (!weakThis) -- return true; -- return weakThis->m_eos; -+ m_eosCondition.waitFor(m_eosLock, 200_ms, [weakThis = ThreadSafeWeakPtr { *this }]() -> bool { -+ if (auto strongThis = weakThis.get()) -+ return strongThis->m_eos; -+ return true; - }); - isEOS = m_eos; - } - } - --void MediaRecorderPrivateGStreamer::fetchData(FetchDataCallback&& completionHandler) -+void MediaRecorderPrivateBackend::fetchData(MediaRecorderPrivate::FetchDataCallback&& completionHandler) - { -- Locker locker { m_dataLock }; -- GST_DEBUG_OBJECT(m_transcoder.get(), "Transfering %zu encoded bytes", m_data.size()); -- auto buffer = m_data.take(); -- completionHandler(WTFMove(buffer), mimeType(), m_position); -+ callOnMainThread([this, weakThis = ThreadSafeWeakPtr { *this }, completionHandler = WTFMove(completionHandler)]() mutable { -+ auto strongThis = weakThis.get(); -+ if (!strongThis) { -+ completionHandler(nullptr, mimeType(), 0); -+ return; -+ } -+ Locker locker { m_dataLock }; -+ GST_DEBUG_OBJECT(m_transcoder.get(), "Transfering %zu encoded bytes", m_data.size()); -+ auto buffer = m_data.take(); -+ completionHandler(WTFMove(buffer), mimeType(), m_position); -+ }); - } - --void MediaRecorderPrivateGStreamer::pauseRecording(CompletionHandler&& completionHandler) -+void MediaRecorderPrivateBackend::pauseRecording(CompletionHandler&& completionHandler) - { - GST_INFO_OBJECT(m_transcoder.get(), "Pausing"); - if (m_pipeline) -@@ -130,7 +190,7 @@ void MediaRecorderPrivateGStreamer::pauseRecording(CompletionHandler&& c - completionHandler(); - } - --void MediaRecorderPrivateGStreamer::resumeRecording(CompletionHandler&& completionHandler) -+void MediaRecorderPrivateBackend::resumeRecording(CompletionHandler&& completionHandler) - { - GST_INFO_OBJECT(m_transcoder.get(), "Resuming"); - auto selectedTracks = MediaRecorderPrivate::selectTracks(stream()); -@@ -143,7 +203,7 @@ void MediaRecorderPrivateGStreamer::resumeRecording(CompletionHandler&& - completionHandler(); - } - --const String& MediaRecorderPrivateGStreamer::mimeType() const -+const String& MediaRecorderPrivateBackend::mimeType() const - { - static NeverDestroyed MP4AUDIOMIMETYPE(MAKE_STATIC_STRING_IMPL("audio/mp4")); - static NeverDestroyed MP4VIDEOMIMETYPE(MAKE_STATIC_STRING_IMPL("video/mp4")); -@@ -152,13 +212,7 @@ const String& MediaRecorderPrivateGStreamer::mimeType() const - return selectedTracks.videoTrack ? MP4VIDEOMIMETYPE : MP4AUDIOMIMETYPE; - } - --bool MediaRecorderPrivateGStreamer::isTypeSupported(const ContentType& contentType) --{ -- auto& scanner = GStreamerRegistryScanner::singleton(); -- return scanner.isContentTypeSupported(GStreamerRegistryScanner::Configuration::Encoding, contentType, { }) > MediaPlayerEnums::SupportsType::IsNotSupported; --} -- --GRefPtr MediaRecorderPrivateGStreamer::containerProfile() -+GRefPtr MediaRecorderPrivateBackend::containerProfile() - { - auto selectedTracks = MediaRecorderPrivate::selectTracks(m_stream); - auto mimeType = this->mimeType(); -@@ -239,38 +293,36 @@ GRefPtr MediaRecorderPrivateGStreamer::containerPro - return profile; - } - --void MediaRecorderPrivateGStreamer::setSource(GstElement* element) -+void MediaRecorderPrivateBackend::setSource(GstElement* element) - { - auto selectedTracks = MediaRecorderPrivate::selectTracks(stream()); - bool onlyTrack = (selectedTracks.audioTrack && !selectedTracks.videoTrack) || (selectedTracks.videoTrack && !selectedTracks.audioTrack); - auto* src = WEBKIT_MEDIA_STREAM_SRC(element); -- if (selectedTracks.audioTrack) { -+ if (selectedTracks.audioTrack) - webkitMediaStreamSrcAddTrack(src, selectedTracks.audioTrack, onlyTrack); -- setAudioSource(&selectedTracks.audioTrack->source()); -- checkTrackState(*selectedTracks.audioTrack); -- } -- if (selectedTracks.videoTrack) { -+ if (selectedTracks.videoTrack) - webkitMediaStreamSrcAddTrack(src, selectedTracks.videoTrack, onlyTrack); -- setVideoSource(&selectedTracks.videoTrack->source()); -- checkTrackState(*selectedTracks.videoTrack); -+ if (m_selectTracksCallback) { -+ auto& callback = *m_selectTracksCallback; -+ callback(selectedTracks); - } - m_src = element; - } - --void MediaRecorderPrivateGStreamer::setSink(GstElement* element) -+void MediaRecorderPrivateBackend::setSink(GstElement* element) - { - static GstAppSinkCallbacks callbacks = { - nullptr, - [](GstAppSink* sink, gpointer userData) -> GstFlowReturn { - auto sample = adoptGRef(gst_app_sink_pull_preroll(sink)); - if (sample) -- static_cast(userData)->processSample(WTFMove(sample)); -+ static_cast(userData)->processSample(WTFMove(sample)); - return gst_app_sink_is_eos(sink) ? GST_FLOW_EOS : GST_FLOW_OK; - }, - [](GstAppSink* sink, gpointer userData) -> GstFlowReturn { - auto sample = adoptGRef(gst_app_sink_pull_sample(sink)); - if (sample) -- static_cast(userData)->processSample(WTFMove(sample)); -+ static_cast(userData)->processSample(WTFMove(sample)); - return gst_app_sink_is_eos(sink) ? GST_FLOW_EOS : GST_FLOW_OK; - }, - // new_event -@@ -282,7 +334,7 @@ void MediaRecorderPrivateGStreamer::setSink(GstElement* element) - m_sink = element; - } - --void MediaRecorderPrivateGStreamer::configureVideoEncoder(GstElement* element) -+void MediaRecorderPrivateBackend::configureVideoEncoder(GstElement* element) - { - auto format = adoptGRef(gst_encoding_profile_get_format(GST_ENCODING_PROFILE(m_videoEncodingProfile.get()))); - g_object_set(element, "format", format.get(), nullptr); -@@ -299,7 +351,7 @@ void MediaRecorderPrivateGStreamer::configureVideoEncoder(GstElement* element) - g_object_set(element, "bitrate", bitrate / 1024, nullptr); - } - --bool MediaRecorderPrivateGStreamer::preparePipeline() -+bool MediaRecorderPrivateBackend::preparePipeline() - { - auto profile = containerProfile(); - if (!profile) -@@ -309,11 +361,11 @@ bool MediaRecorderPrivateGStreamer::preparePipeline() - gst_transcoder_set_avoid_reencoding(m_transcoder.get(), true); - m_pipeline = gst_transcoder_get_pipeline(m_transcoder.get()); - -- g_signal_connect_swapped(m_pipeline.get(), "source-setup", G_CALLBACK(+[](MediaRecorderPrivateGStreamer* recorder, GstElement* sourceElement) { -+ g_signal_connect_swapped(m_pipeline.get(), "source-setup", G_CALLBACK(+[](MediaRecorderPrivateBackend* recorder, GstElement* sourceElement) { - recorder->setSource(sourceElement); - }), this); - -- g_signal_connect_swapped(m_pipeline.get(), "element-setup", G_CALLBACK(+[](MediaRecorderPrivateGStreamer* recorder, GstElement* element) { -+ g_signal_connect_swapped(m_pipeline.get(), "element-setup", G_CALLBACK(+[](MediaRecorderPrivateBackend* recorder, GstElement* element) { - if (WEBKIT_IS_WEBRTC_VIDEO_ENCODER(element)) { - recorder->configureVideoEncoder(element); - return; -@@ -330,18 +382,18 @@ bool MediaRecorderPrivateGStreamer::preparePipeline() - GST_WARNING("%s details: %" GST_PTR_FORMAT, error->message, details); - }), nullptr); - -- g_signal_connect_swapped(m_signalAdapter.get(), "done", G_CALLBACK(+[](MediaRecorderPrivateGStreamer* recorder) { -+ g_signal_connect_swapped(m_signalAdapter.get(), "done", G_CALLBACK(+[](MediaRecorderPrivateBackend* recorder) { - recorder->notifyEOS(); - }), this); - -- g_signal_connect_swapped(m_signalAdapter.get(), "position-updated", G_CALLBACK(+[](MediaRecorderPrivateGStreamer* recorder, GstClockTime position) { -+ g_signal_connect_swapped(m_signalAdapter.get(), "position-updated", G_CALLBACK(+[](MediaRecorderPrivateBackend* recorder, GstClockTime position) { - recorder->notifyPosition(position); - }), this); - - return true; - } - --void MediaRecorderPrivateGStreamer::processSample(GRefPtr&& sample) -+void MediaRecorderPrivateBackend::processSample(GRefPtr&& sample) - { - auto* sampleBuffer = gst_sample_get_buffer(sample.get()); - GstMappedBuffer buffer(sampleBuffer, GST_MAP_READ); -@@ -351,7 +403,7 @@ void MediaRecorderPrivateGStreamer::processSample(GRefPtr&& sample) - m_data.append(buffer.data(), buffer.size()); - } - --void MediaRecorderPrivateGStreamer::notifyEOS() -+void MediaRecorderPrivateBackend::notifyEOS() - { - GST_DEBUG("EOS received"); - LockHolder lock(m_eosLock); -diff --git a/Source/WebCore/platform/mediarecorder/MediaRecorderPrivateGStreamer.h b/Source/WebCore/platform/mediarecorder/MediaRecorderPrivateGStreamer.h -index b15c7be4..d8379055 100644 ---- a/Source/WebCore/platform/mediarecorder/MediaRecorderPrivateGStreamer.h -+++ b/Source/WebCore/platform/mediarecorder/MediaRecorderPrivateGStreamer.h -@@ -24,7 +24,6 @@ - #include "GRefPtrGStreamer.h" - #include "MediaRecorderPrivate.h" - #include "SharedBuffer.h" --#include - #include - #include - #include -@@ -37,29 +36,31 @@ class ContentType; - class MediaStreamTrackPrivate; - struct MediaRecorderPrivateOptions; - --class MediaRecorderPrivateGStreamer final : public MediaRecorderPrivate, public CanMakeWeakPtr { -+class MediaRecorderPrivateBackend : public ThreadSafeRefCountedAndCanMakeThreadSafeWeakPtr { - WTF_MAKE_FAST_ALLOCATED; - - public: -- static std::unique_ptr create(MediaStreamPrivate&, const MediaRecorderPrivateOptions&); -- explicit MediaRecorderPrivateGStreamer(MediaStreamPrivate&, const MediaRecorderPrivateOptions&); -- ~MediaRecorderPrivateGStreamer(); -+ using SelectTracksCallback = Function; -+ static RefPtr create(MediaStreamPrivate& stream, const MediaRecorderPrivateOptions& options) -+ { -+ return adoptRef(*new MediaRecorderPrivateBackend(stream, options)); -+ } - -- static bool isTypeSupported(const ContentType&); -+ ~MediaRecorderPrivateBackend(); - --protected: - bool preparePipeline(); - --private: -- void videoFrameAvailable(VideoFrame&, VideoFrameTimeMetadata) final { }; -- void audioSamplesAvailable(const WTF::MediaTime&, const PlatformAudioData&, const AudioStreamDescription&, size_t) final { }; -+ void fetchData(MediaRecorderPrivate::FetchDataCallback&&); -+ void startRecording(MediaRecorderPrivate::StartRecordingCallback&&); -+ void stopRecording(CompletionHandler&&); -+ void pauseRecording(CompletionHandler&&); -+ void resumeRecording(CompletionHandler&&); -+ const String& mimeType() const; - -- void fetchData(FetchDataCallback&&) final; -- void startRecording(StartRecordingCallback&&) final; -- void stopRecording(CompletionHandler&&) final; -- void pauseRecording(CompletionHandler&&) final; -- void resumeRecording(CompletionHandler&&) final; -- const String& mimeType() const final; -+ void setSelectTracksCallback(SelectTracksCallback&& callback) { m_selectTracksCallback = WTFMove(callback); } -+ -+private: -+ MediaRecorderPrivateBackend(MediaStreamPrivate&, const MediaRecorderPrivateOptions&); - - void setSource(GstElement*); - void setSink(GstElement*); -@@ -88,6 +89,30 @@ private: - - MediaStreamPrivate& m_stream; - const MediaRecorderPrivateOptions& m_options; -+ std::optional m_selectTracksCallback; -+}; -+ -+class MediaRecorderPrivateGStreamer final : public MediaRecorderPrivate { -+ WTF_MAKE_FAST_ALLOCATED; -+public: -+ static std::unique_ptr create(MediaStreamPrivate&, const MediaRecorderPrivateOptions&); -+ explicit MediaRecorderPrivateGStreamer(Ref&&); -+ ~MediaRecorderPrivateGStreamer() = default; -+ -+ static bool isTypeSupported(const ContentType&); -+ -+private: -+ void videoFrameAvailable(VideoFrame&, VideoFrameTimeMetadata) final { }; -+ void audioSamplesAvailable(const WTF::MediaTime&, const PlatformAudioData&, const AudioStreamDescription&, size_t) final { }; -+ -+ void fetchData(FetchDataCallback&&) final; -+ void startRecording(StartRecordingCallback&&) final; -+ void stopRecording(CompletionHandler&&) final; -+ void pauseRecording(CompletionHandler&&) final; -+ void resumeRecording(CompletionHandler&&) final; -+ const String& mimeType() const final; -+ -+ Ref m_recorder; - }; - - } // namespace WebCore --- -2.33.0 diff --git a/backport-CVE-2024-40779.patch b/backport-CVE-2024-40779.patch deleted file mode 100644 index d6421922a635d901e2555a365cae2320f6e7bd1c..0000000000000000000000000000000000000000 --- a/backport-CVE-2024-40779.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 2fe5ae29a5f6434ef456afe9673a4f400ec63848 Mon Sep 17 00:00:00 2001 -From: Jean-Yves Avenard -Date: Fri, 14 Jun 2024 16:08:19 -0700 -Subject: [PATCH] Cherry-pick 272448.1085@safari-7618.3.10-branch - (ff52ff7cb64e). https://bugs.webkit.org/show_bug.cgi?id=275431 - -HeapBufferOverflow in computeSampleUsingLinearInterpolation -https://bugs.webkit.org/show_bug.cgi?id=275431 -rdar://125617812 - -Reviewed by Youenn Fablet. - -Add boundary check. -This is a copy of blink code for that same function. -https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/modules/webaudio/audio_buffer_source_handler.cc;l=336-341 - -* Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp: -(WebCore::AudioBufferSourceNode::renderFromBuffer): - -Canonical link: https://commits.webkit.org/274313.347@webkitglib/2.44 ---- - .../webaudio/AudioBufferSourceNode.cpp | 6 +++++ - 1 file changed, 6 insertions(+) - -diff --git a/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp b/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp -index 298bd48cdff5..740b793e0ec5 100644 ---- a/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp -+++ b/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp -@@ -350,6 +350,12 @@ bool AudioBufferSourceNode::renderFromBuffer(AudioBus* bus, unsigned destination - if (readIndex2 >= maxFrame) - readIndex2 = m_isLooping ? minFrame : readIndex; - -+ // Final sanity check on buffer access. -+ // FIXME: as an optimization, try to get rid of this inner-loop check and -+ // put assertions and guards before the loop. -+ if (readIndex >= bufferLength || readIndex2 >= bufferLength) -+ break; -+ - // Linear interpolation. - for (unsigned i = 0; i < numberOfChannels; ++i) { - float* destination = destinationChannels[i]; diff --git a/backport-CVE-2024-40780.patch b/backport-CVE-2024-40780.patch deleted file mode 100644 index 9157ff2cae9e760f7714058b5dde7d833aa4844e..0000000000000000000000000000000000000000 --- a/backport-CVE-2024-40780.patch +++ /dev/null @@ -1,41 +0,0 @@ -From e83e4c7460972898dc06a5f5ab36eed7c6b101b5 Mon Sep 17 00:00:00 2001 -From: Jer Noble -Date: Tue, 11 Jun 2024 11:54:06 -0700 -Subject: [PATCH] Cherry-pick 272448.1080@safari-7618.3.10-branch - (64c9479d6f29). https://bugs.webkit.org/show_bug.cgi?id=275273 - -Add check in AudioBufferSourceNode::renderFromBuffer() when detune is set to large negative value -https://bugs.webkit.org/show_bug.cgi?id=275273 -rdar://125617842 - -Reviewed by Eric Carlson. - -* Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp: -(WebCore::AudioBufferSourceNode::renderFromBuffer): - -Canonical link: https://commits.webkit.org/274313.345@webkitglib/2.44 ---- - .../webaudio/AudioBufferSourceNode.cpp | 7 +++++ - 1 file changed, 7 insertions(+) - -diff --git a/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp b/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp -index f86bffb9b507..298bd48cdff5 100644 ---- a/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp -+++ b/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp -@@ -328,9 +328,16 @@ bool AudioBufferSourceNode::renderFromBuffer(AudioBus* bus, unsigned destination - virtualReadIndex = readIndex; - } else if (!pitchRate) { - unsigned readIndex = static_cast(virtualReadIndex); -+ int deltaFrames = static_cast(virtualDeltaFrames); -+ maxFrame = static_cast(virtualMaxFrame); -+ -+ if (readIndex >= maxFrame) -+ readIndex -= deltaFrames; - - for (unsigned i = 0; i < numberOfChannels; ++i) - std::fill_n(destinationChannels[i] + writeIndex, framesToProcess, sourceChannels[i][readIndex]); -+ -+ virtualReadIndex = readIndex; - } else if (reverse) { - unsigned maxFrame = static_cast(virtualMaxFrame); - unsigned minFrame = static_cast(floorf(virtualMinFrame)); diff --git a/backport-CVE-2024-4558.patch b/backport-CVE-2024-4558.patch deleted file mode 100644 index d5f28690c579c74dea8173cc5a3ae9de416c8f3a..0000000000000000000000000000000000000000 --- a/backport-CVE-2024-4558.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 9d7ec80f78039e6646fcfc455ab4c05aa393f34c Mon Sep 17 00:00:00 2001 -From: Kimmo Kinnunen -Date: Tue, 14 May 2024 22:37:29 -0700 -Subject: [PATCH] Cherry-pick ANGLE. - https://bugs.webkit.org/show_bug.cgi?id=274165 - -https://bugs.webkit.org/show_bug.cgi?id=274165 -rdar://127764804 - -Reviewed by Dan Glastonbury. - -Cherry-pick ANGLE upstream commit 1bb1ee061fe0bce322fb93b447a72e72c993a1f2: - -GL: Sync unpack state for glCompressedTexSubImage3D - -Unpack state is supposed to be ignored for compressed tex image calls -but some drivers use it anyways and read incorrect data. - -Texture3DTestES3.PixelUnpackStateTexSubImage covers this case. - -Bug: chromium:337766133 -Change-Id: Ic11a056113b1850bd5b4d6840527164a12849a22 -Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5498735 -Commit-Queue: Shahbaz Youssefi -Reviewed-by: Shahbaz Youssefi -Canonical link: https://commits.webkit.org/274313.341@webkitglib/2.44 ---- - Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/TextureGL.cpp | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/TextureGL.cpp b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/TextureGL.cpp -index c659aacb9e48..f96eefe53f11 100644 ---- a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/TextureGL.cpp -+++ b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/TextureGL.cpp -@@ -664,6 +664,7 @@ angle::Result TextureGL::setCompressedSubImage(const gl::Context *context, - nativegl::GetCompressedSubTexImageFormat(functions, features, format); - - stateManager->bindTexture(getType(), mTextureID); -+ ANGLE_TRY(stateManager->setPixelUnpackState(context, unpack)); - if (nativegl::UseTexImage2D(getType())) - { - ASSERT(area.z == 0 && area.depth == 1); diff --git a/backport-Fix-build-with-Ruby-3.2.patch b/backport-Fix-build-with-Ruby-3.2.patch deleted file mode 100644 index 5f457f9624a7ef2a6959010c54bc5c37a576d8ea..0000000000000000000000000000000000000000 --- a/backport-Fix-build-with-Ruby-3.2.patch +++ /dev/null @@ -1,82 +0,0 @@ -From b7ac5d0ccc7ca3ed6bf4f2d40fde60247ce87d3c Mon Sep 17 00:00:00 2001 -From: Dominique Leuenberger -Date: Mon, 12 Dec 2022 21:24:11 -0800 -Subject: [PATCH] Fix build with Ruby 3.2 - https://bugs.webkit.org/show_bug.cgi?id=246743 - -Reviewed by Ross Kirsling. - -File.exists has been declared deprecated since Ruby 2.1 (2013) and with Ruby 3.2 gets removed for good. - -* Source/JavaScriptCore/offlineasm/config.rb: -* Source/JavaScriptCore/offlineasm/parser.rb: -* Source/WebInspectorUI/Scripts/update-LegacyInspectorBackendCommands.rb: - -Canonical link: https://commits.webkit.org/257775@main ---- - Source/JavaScriptCore/offlineasm/config.rb | 4 ++-- - Source/JavaScriptCore/offlineasm/parser.rb | 8 ++++---- - .../Scripts/update-LegacyInspectorBackendCommands.rb | 2 +- - 3 files changed, 7 insertions(+), 7 deletions(-) - -diff --git a/Source/JavaScriptCore/offlineasm/config.rb b/Source/JavaScriptCore/offlineasm/config.rb -index ba0043119f32c..7811626db5e5b 100644 ---- a/Source/JavaScriptCore/offlineasm/config.rb -+++ b/Source/JavaScriptCore/offlineasm/config.rb -@@ -23,11 +23,11 @@ - - buildProductsDirectory = ENV['BUILT_PRODUCTS_DIR']; - headersFolderPath = ENV['WK_LIBRARY_HEADERS_FOLDER_PATH']; --if buildProductsDirectory and File.exists?(buildProductsDirectory) -+if buildProductsDirectory and File.exist?(buildProductsDirectory) - $: << "#{buildProductsDirectory}#{headersFolderPath}/WebKitAdditions/Scripts" - end - sdkRootDirectory = ENV['SDKROOT']; --if sdkRootDirectory and File.exists?(sdkRootDirectory) -+if sdkRootDirectory and File.exist?(sdkRootDirectory) - $: << "#{sdkRootDirectory}#{headersFolderPath}/WebKitAdditions/Scripts" - end - -diff --git a/Source/JavaScriptCore/offlineasm/parser.rb b/Source/JavaScriptCore/offlineasm/parser.rb -index 12a22b5cc819e..07e38b63972be 100644 ---- a/Source/JavaScriptCore/offlineasm/parser.rb -+++ b/Source/JavaScriptCore/offlineasm/parser.rb -@@ -840,10 +840,10 @@ def parseSequence(final, comment) - additionsDirectoryName = "#{@buildProductsDirectory}#{@headersFolderPath}/WebKitAdditions/" - end - fileName = IncludeFile.new(moduleName, additionsDirectoryName).fileName -- if not File.exists?(fileName) -+ if not File.exist?(fileName) - fileName = IncludeFile.new(moduleName, @tokens[@idx].codeOrigin.fileName.dirname).fileName - end -- fileExists = File.exists?(fileName) -+ fileExists = File.exist?(fileName) - raise "File not found: #{fileName}" if not fileExists and not isOptional - list << parse(fileName, @options, @sources) if fileExists - else -@@ -876,10 +876,10 @@ def parseIncludes(final, comment, options) - additionsDirectoryName = "#{@buildProductsDirectory}#{@headersFolderPath}/WebKitAdditions/" - end - fileName = IncludeFile.new(moduleName, additionsDirectoryName).fileName -- if not File.exists?(fileName) -+ if not File.exist?(fileName) - fileName = IncludeFile.new(moduleName, @tokens[@idx].codeOrigin.fileName.dirname).fileName - end -- fileExists = File.exists?(fileName) -+ fileExists = File.exist?(fileName) - raise "File not found: #{fileName}" if not fileExists and not isOptional - if fileExists - parser = Parser.new(readTextFile(fileName), SourceFile.new(fileName), options) -diff --git a/Source/WebInspectorUI/Scripts/update-LegacyInspectorBackendCommands.rb b/Source/WebInspectorUI/Scripts/update-LegacyInspectorBackendCommands.rb -index 680dee7406d1e..40737afaa4c51 100755 ---- a/Source/WebInspectorUI/Scripts/update-LegacyInspectorBackendCommands.rb -+++ b/Source/WebInspectorUI/Scripts/update-LegacyInspectorBackendCommands.rb -@@ -36,7 +36,7 @@ def run - end - - generated_path = File.join tmpdir, output_filename -- if !File.exists?(generated_path) -+ if !File.exist?(generated_path) - puts "ERROR: Generated file does not exist at expected path." - exit 1 - end diff --git a/webkit2gtk3.spec b/webkit2gtk3.spec index cb500cabe34f88fac9da8733fddc9594b5e04577..a66d551d0a131a6a1232a35a99fb491b35bf62df 100644 --- a/webkit2gtk3.spec +++ b/webkit2gtk3.spec @@ -1,43 +1,42 @@ # Filter out provides for private libraries -%global __provides_exclude_from ^(%{_libdir}/webkit2gtk-4\\.0/.*\\.so|%{_libdir}/webkit2gtk-4\\.1/.*\\.so|%{_libdir}/webkit2gtk-5\\.0/.*\\.so)$ +%global __provides_exclude_from ^(%{_libdir}/webkit2gtk-4\\.0/.*\\.so)$ +# Run dwz to reduce debuginfo package size %global _dwz_max_die_limit 250000000 -%global _dwz_max_die_limit_x86_64 250000000 +%global _find_debuginfo_dwz_opts --run-dwz\\\ + --dwz-max-die-limit %{_dwz_max_die_limit} %global add_to_license_files() \ mkdir -p _license_files ; \ cp -p %1 _license_files/$(echo '%1' | sed -e 's!/!.!g') -%ifarch aarch64 +# Clang is preferred by skia +%global toolchain clang + +# Build document by default %bcond_without docs -%endif + +# Not support GamePad by default +%bcond_with gamepad Name: webkit2gtk3 -Version: 2.38.2 -Release: 10 +Version: 2.48.1 +Release: 1 Summary: GTK web content engine library -License: LGPLv2 +License: BSD-3-Clause AND LGPL-2.0-or-later URL: https://www.webkitgtk.org/ Source0: https://webkitgtk.org/releases/webkitgtk-%{version}.tar.xz -Source1: https://webkitgtk.org/releases/webkitgtk-%{version}.tar.xz.asc Patch1000: webkitgtk-add-loongarch-and-sw.patch - -Patch6000: backport-CVE-2023-28204.patch -Patch6001: backport-CVE-2023-32373.patch -Patch6002: backport-CVE-2023-32409.patch -Patch6003: backport-Fix-build-with-Ruby-3.2.patch -Patch6004: backport-CVE-2023-39928.patch -Patch6005: backport-CVE-2024-4558.patch -Patch6006: backport-CVE-2024-40779.patch -Patch6007: backport-CVE-2024-40780.patch +# clang 17 has bug on Wunsafe-buffer-usage, disable it for now +Patch1001: webkitgtk-2.48.1-drop-Wunsafe-buffer-usage.patch #Dependency BuildRequires: bison BuildRequires: bubblewrap +BuildRequires: clang BuildRequires: cmake BuildRequires: flex -BuildRequires: gcc-c++ BuildRequires: gettext BuildRequires: gi-docgen BuildRequires: git @@ -45,7 +44,9 @@ BuildRequires: gnupg2 BuildRequires: gperf BuildRequires: hyphen-devel BuildRequires: libatomic +BuildRequires: openssl-devel BuildRequires: ninja-build +BuildRequires: perl(bigint) BuildRequires: perl(English) BuildRequires: perl(FindBin) BuildRequires: perl(JSON::PP) @@ -53,53 +54,53 @@ BuildRequires: python3 BuildRequires: ruby BuildRequires: rubygems BuildRequires: rubygem-json +BuildRequires: unifdef BuildRequires: xdg-dbus-proxy BuildRequires: pkgconfig(atspi-2) BuildRequires: pkgconfig(cairo) BuildRequires: pkgconfig(egl) BuildRequires: pkgconfig(enchant-2) +BuildRequires: pkgconfig(epoxy) BuildRequires: pkgconfig(fontconfig) BuildRequires: pkgconfig(freetype2) -BuildRequires: pkgconfig(gl) +BuildRequires: pkgconfig(gbm) BuildRequires: pkgconfig(glib-2.0) -BuildRequires: pkgconfig(glesv2) BuildRequires: pkgconfig(gobject-introspection-1.0) BuildRequires: pkgconfig(gstreamer-1.0) BuildRequires: pkgconfig(gstreamer-plugins-base-1.0) BuildRequires: pkgconfig(gtk+-3.0) -BuildRequires: pkgconfig(gtk4) BuildRequires: pkgconfig(harfbuzz) BuildRequires: pkgconfig(icu-uc) BuildRequires: pkgconfig(lcms2) +BuildRequires: pkgconfig(libdrm) BuildRequires: pkgconfig(libgcrypt) BuildRequires: pkgconfig(libjpeg) BuildRequires: pkgconfig(libnotify) -BuildRequires: pkgconfig(libopenjp2) -BuildRequires: pkgconfig(libpcre) BuildRequires: pkgconfig(libpng) BuildRequires: pkgconfig(libseccomp) BuildRequires: pkgconfig(libsecret-1) BuildRequires: pkgconfig(libsoup-2.4) -BuildRequires: pkgconfig(libsoup-3.0) BuildRequires: pkgconfig(libsystemd) BuildRequires: pkgconfig(libtasn1) BuildRequires: pkgconfig(libwebp) BuildRequires: pkgconfig(libwoff2dec) BuildRequires: pkgconfig(libxslt) -#BuildRequires: pkgconfig(manette-0.2) +%if %{with gamepad} +BuildRequires: pkgconfig(manette-0.2) +%endif BuildRequires: pkgconfig(sqlite3) +BuildRequires: pkgconfig(sysprof-capture-4) BuildRequires: pkgconfig(upower-glib) BuildRequires: pkgconfig(wayland-client) BuildRequires: pkgconfig(wayland-egl) BuildRequires: pkgconfig(wayland-protocols) BuildRequires: pkgconfig(wayland-server) -BuildRequires: pkgconfig(wpe-1.0) -BuildRequires: pkgconfig(wpebackend-fdo-1.0) BuildRequires: pkgconfig(xt) Requires: javascriptcoregtk4.0%{?_isa} = %{version}-%{release} Requires: bubblewrap +Requires: libGLES Requires: xdg-dbus-proxy Recommends: geoclue2 Recommends: gstreamer1-plugins-bad-free @@ -107,6 +108,7 @@ Recommends: gstreamer1-plugins-good Recommends: xdg-desktop-portal-gtk Provides: bundled(angle) Provides: bundled(pdfjs) +Provides: bundled(skia) Provides: bundled(xdgmime) Obsoletes: webkitgtk4 < %{version}-%{release} Provides: webkitgtk4 = %{version}-%{release} @@ -131,7 +133,7 @@ Obsoletes: webkit2gtk3-devel < %{version}-%{release} Provides: webkit2gtk3-devel = %{version}-%{release} %description -n webkit2gtk3-devel -The webkit2gtk4.0-devel package contains libraries, build data, and header +The webkit2gtk3-devel package contains libraries, build data, and header files for developing applications that use webkit2gtk4.0. %if %{with docs} @@ -153,7 +155,7 @@ This package contains developer documentation for webkit2gtk4.0. %endif %package -n webkit2gtk3-jsc -Summary: JavaScript engine from webkit2gtk3 +Summary: JavaScript engine from webkit2gtk4.0 Provides: javascriptcoregtk4.0%{?_isa} = %{version}-%{release} Obsoletes: webkitgtk4-jsc < %{version}-%{release} Provides: webkitgtk4-jsc = %{version}-%{release} @@ -179,26 +181,34 @@ Provides: jsc4.0-devel = %{version}-%{release} Provides: jsc4.0-devel%{?_isa} = %{version}-%{release} %description -n webkit2gtk3-jsc-devel -The javascriptcoregtk4.0-devel package contains libraries, build data, and header +The webkit2gtk3-jsc-devel package contains libraries, build data, and header files for developing applications that use JavaScript engine from webkit2gtk-4.0. %prep %autosetup -p1 -n webkitgtk-%{version} %build -#%%define _vpath_builddir %{_vendor}-%{_target_os}-build/webkit2gtk-4.0 mkdir -p build-4.0 pushd build-4.0 %cmake \ -GNinja \ -DPORT=GTK \ -DCMAKE_BUILD_TYPE=Release \ + -DUSE_GTK4=OFF \ -DUSE_SOUP2=ON \ -DENABLE_WEBDRIVER=OFF \ + -DUSE_JPEGXL=OFF \ + -DUSE_AVIF=OFF \ + -DUSE_LIBBACKTRACE=OFF \ + -DUSE_GSTREAMER_TRANSCODER=OFF \ + -DENABLE_SPEECH_SYNTHESIS=OFF \ + -DUSE_SKIA_OPENTYPE_SVG=OFF \ %if %{without docs} -DENABLE_DOCUMENTATION=OFF \ %endif +%if %{without gamepad} -DENABLE_GAMEPAD=OFF \ +%endif %ifarch aarch64 loongarch64 -DENABLE_JIT=OFF \ -DUSE_SYSTEM_MALLOC=ON \ @@ -211,21 +221,19 @@ pushd build-4.0 .. %{nil} export NINJA_STATUS="[3/3][%f/%t %es] " -%ninja_build -j16 +%ninja_build popd %install -#%%define _vpath_builddir %{_vendor}-%{_target_os}-build/webkit2gtk-4.0 pushd build-4.0 %ninja_install popd -%find_lang WebKit2GTK-4.0 +%find_lang WebKitGTK-4.0 # Finally, copy over and rename various files for %%license inclusion %add_to_license_files Source/JavaScriptCore/COPYING.LIB %add_to_license_files Source/ThirdParty/ANGLE/LICENSE -%add_to_license_files Source/ThirdParty/ANGLE/src/common/third_party/smhasher/LICENSE %add_to_license_files Source/ThirdParty/ANGLE/src/third_party/libXNVCtrl/LICENSE %add_to_license_files Source/WebCore/LICENSE-APPLE %add_to_license_files Source/WebCore/LICENSE-LGPL-2 @@ -237,7 +245,7 @@ popd %add_to_license_files Source/WTF/wtf/dtoa/COPYING %add_to_license_files Source/WTF/wtf/dtoa/LICENSE -%files -n webkit2gtk3 -f WebKit2GTK-4.0.lang +%files -n webkit2gtk3 -f WebKitGTK-4.0.lang %license _license_files/*ThirdParty* %license _license_files/*WebCore* %license _license_files/*WebInspectorUI* @@ -281,14 +289,16 @@ popd %if %{with docs} %files -n webkit2gtk3-help -%dir %{_datadir}/gtk-doc -%dir %{_datadir}/gtk-doc/html -%{_datadir}/gtk-doc/html/javascriptcoregtk-4.0/ -%{_datadir}/gtk-doc/html/webkit2gtk-4.0/ -%{_datadir}/gtk-doc/html/webkit2gtk-web-extension-4.0/ +%dir %{_datadir}/doc +%{_datadir}/doc/javascriptcoregtk-4.0/ +%{_datadir}/doc/webkit2gtk-4.0/ +%{_datadir}/doc/webkit2gtk-web-extension-4.0/ %endif %changelog +* Tue Apr 15 2025 lingsheng - 2.48.1-1 +- Update to 2.48.1 + * Thu Aug 29 2024 lingsheng - 2.38.2-10 - Modfiy loongarch64 and sw_64 support use all arch diff --git a/webkit2gtk4_1.spec b/webkit2gtk4_1.spec index f04858c7aac59895d72222d02a2d8c45c6bc889d..7109081cb3806a74b0cb0c54d9d7fc2bddfc6f3f 100644 --- a/webkit2gtk4_1.spec +++ b/webkit2gtk4_1.spec @@ -1,43 +1,42 @@ # Filter out provides for private libraries -%global __provides_exclude_from ^(%{_libdir}/webkit2gtk-4\\.0/.*\\.so|%{_libdir}/webkit2gtk-4\\.1/.*\\.so|%{_libdir}/webkit2gtk-5\\.0/.*\\.so)$ +%global __provides_exclude_from ^(%{_libdir}/webkit2gtk-4\\.1/.*\\.so)$ +# Run dwz to reduce debuginfo package size %global _dwz_max_die_limit 250000000 -%global _dwz_max_die_limit_x86_64 250000000 +%global _find_debuginfo_dwz_opts --run-dwz\\\ + --dwz-max-die-limit %{_dwz_max_die_limit} %global add_to_license_files() \ mkdir -p _license_files ; \ cp -p %1 _license_files/$(echo '%1' | sed -e 's!/!.!g') -%ifarch aarch64 +# Clang is preferred by skia +%global toolchain clang + +# Build document by default %bcond_without docs -%endif + +# Not support GamePad by default +%bcond_with gamepad Name: webkit2gtk4.1 -Version: 2.38.2 -Release: 10 +Version: 2.48.1 +Release: 1 Summary: GTK web content engine library -License: LGPLv2 +License: BSD-3-Clause AND LGPL-2.0-or-later URL: https://www.webkitgtk.org/ Source0: https://webkitgtk.org/releases/webkitgtk-%{version}.tar.xz -Source1: https://webkitgtk.org/releases/webkitgtk-%{version}.tar.xz.asc Patch1000: webkitgtk-add-loongarch-and-sw.patch - -Patch6000: backport-CVE-2023-28204.patch -Patch6001: backport-CVE-2023-32373.patch -Patch6002: backport-CVE-2023-32409.patch -Patch6003: backport-Fix-build-with-Ruby-3.2.patch -Patch6004: backport-CVE-2023-39928.patch -Patch6005: backport-CVE-2024-4558.patch -Patch6006: backport-CVE-2024-40779.patch -Patch6007: backport-CVE-2024-40780.patch +# clang 17 has bug on Wunsafe-buffer-usage, disable it for now +Patch1001: webkitgtk-2.48.1-drop-Wunsafe-buffer-usage.patch #Dependency BuildRequires: bison BuildRequires: bubblewrap +BuildRequires: clang BuildRequires: cmake BuildRequires: flex -BuildRequires: gcc-c++ BuildRequires: gettext BuildRequires: gi-docgen BuildRequires: git @@ -46,6 +45,8 @@ BuildRequires: gperf BuildRequires: hyphen-devel BuildRequires: libatomic BuildRequires: ninja-build +BuildRequires: openssl-devel +BuildRequires: perl(bigint) BuildRequires: perl(English) BuildRequires: perl(FindBin) BuildRequires: perl(JSON::PP) @@ -53,62 +54,66 @@ BuildRequires: python3 BuildRequires: ruby BuildRequires: rubygems BuildRequires: rubygem-json +BuildRequires: unifdef BuildRequires: xdg-dbus-proxy BuildRequires: pkgconfig(atspi-2) BuildRequires: pkgconfig(cairo) BuildRequires: pkgconfig(egl) BuildRequires: pkgconfig(enchant-2) +BuildRequires: pkgconfig(epoxy) BuildRequires: pkgconfig(fontconfig) BuildRequires: pkgconfig(freetype2) -BuildRequires: pkgconfig(gl) +BuildRequires: pkgconfig(gbm) BuildRequires: pkgconfig(glib-2.0) -BuildRequires: pkgconfig(glesv2) BuildRequires: pkgconfig(gobject-introspection-1.0) BuildRequires: pkgconfig(gstreamer-1.0) BuildRequires: pkgconfig(gstreamer-plugins-base-1.0) BuildRequires: pkgconfig(gtk+-3.0) -BuildRequires: pkgconfig(gtk4) BuildRequires: pkgconfig(harfbuzz) BuildRequires: pkgconfig(icu-uc) BuildRequires: pkgconfig(lcms2) +BuildRequires: pkgconfig(libdrm) BuildRequires: pkgconfig(libgcrypt) BuildRequires: pkgconfig(libjpeg) BuildRequires: pkgconfig(libnotify) -BuildRequires: pkgconfig(libopenjp2) -BuildRequires: pkgconfig(libpcre) BuildRequires: pkgconfig(libpng) BuildRequires: pkgconfig(libseccomp) BuildRequires: pkgconfig(libsecret-1) -BuildRequires: pkgconfig(libsoup-2.4) BuildRequires: pkgconfig(libsoup-3.0) BuildRequires: pkgconfig(libsystemd) BuildRequires: pkgconfig(libtasn1) BuildRequires: pkgconfig(libwebp) BuildRequires: pkgconfig(libwoff2dec) BuildRequires: pkgconfig(libxslt) -#BuildRequires: pkgconfig(manette-0.2) +%if %{with gamepad} +BuildRequires: pkgconfig(manette-0.2) +%endif BuildRequires: pkgconfig(sqlite3) +BuildRequires: pkgconfig(sysprof-capture-4) BuildRequires: pkgconfig(upower-glib) BuildRequires: pkgconfig(wayland-client) BuildRequires: pkgconfig(wayland-egl) BuildRequires: pkgconfig(wayland-protocols) BuildRequires: pkgconfig(wayland-server) -BuildRequires: pkgconfig(wpe-1.0) -BuildRequires: pkgconfig(wpebackend-fdo-1.0) BuildRequires: pkgconfig(xt) Requires: javascriptcoregtk4.1%{?_isa} = %{version}-%{release} Requires: bubblewrap +Requires: libGLES Requires: xdg-dbus-proxy Recommends: geoclue2 Recommends: gstreamer1-plugins-bad-free Recommends: gstreamer1-plugins-good Recommends: xdg-desktop-portal-gtk +Provides: bundled(angle) +Provides: bundled(pdfjs) +Provides: bundled(skia) +Provides: bundled(xdgmime) %description WebKitGTK is the port of the WebKit web rendering engine to the -GTK platform. This package contains WebKitGTK for GTK 3 and libsoup 2. +GTK platform. This package contains WebKitGTK for GTK 3 and libsoup 3. %package -n webkit2gtk4.1-devel Summary: Development files for webkit2gtk4.1 @@ -146,7 +151,7 @@ Requires: javascriptcoregtk4.1%{?_isa} = %{version}-%{release} Obsoletes: webkit2gtk4.1-jsc-devel < %{version}-%{release} %description -n jsc4.1-devel -The javascriptcoregtk4.1-devel package contains libraries, build data, and header +The jsc4.1-devel package contains libraries, build data, and header files for developing applications that use JavaScript engine from webkit2gtk-4.1. @@ -154,18 +159,25 @@ files for developing applications that use JavaScript engine from webkit2gtk-4.1 %autosetup -p1 -n webkitgtk-%{version} %build - -#%%define _vpath_builddir %{_vendor}-%{_target_os}-build/webkit2gtk-4.1 mkdir -p build-4.1 pushd build-4.1 %cmake \ -GNinja \ -DPORT=GTK \ -DCMAKE_BUILD_TYPE=Release \ + -DUSE_GTK4=OFF \ + -DUSE_JPEGXL=OFF \ + -DUSE_AVIF=OFF \ + -DUSE_LIBBACKTRACE=OFF \ + -DUSE_GSTREAMER_TRANSCODER=OFF \ + -DENABLE_SPEECH_SYNTHESIS=OFF \ + -DUSE_SKIA_OPENTYPE_SVG=OFF \ %if %{without docs} -DENABLE_DOCUMENTATION=OFF \ %endif +%if %{without gamepad} -DENABLE_GAMEPAD=OFF \ +%endif %if 0%{?openEuler} %ifarch aarch64 -DUSE_64KB_PAGE_BLOCK=ON \ @@ -174,22 +186,20 @@ pushd build-4.1 .. %{nil} export NINJA_STATUS="[2/3][%f/%t %es] " -%ninja_build -j16 +%ninja_build popd %install -#%%define _vpath_builddir %{_vendor}-%{_target_os}-build/webkit2gtk-4.1 pushd build-4.1 %ninja_install popd -%find_lang WebKit2GTK-4.1 +%find_lang WebKitGTK-4.1 # Finally, copy over and rename various files for %%license inclusion %add_to_license_files Source/JavaScriptCore/COPYING.LIB %add_to_license_files Source/ThirdParty/ANGLE/LICENSE -%add_to_license_files Source/ThirdParty/ANGLE/src/common/third_party/smhasher/LICENSE %add_to_license_files Source/ThirdParty/ANGLE/src/third_party/libXNVCtrl/LICENSE %add_to_license_files Source/WebCore/LICENSE-APPLE %add_to_license_files Source/WebCore/LICENSE-LGPL-2 @@ -202,7 +212,7 @@ popd %add_to_license_files Source/WTF/wtf/dtoa/LICENSE -%files -n webkit2gtk4.1 -f WebKit2GTK-4.1.lang +%files -n webkit2gtk4.1 -f WebKitGTK-4.1.lang %license _license_files/*ThirdParty* %license _license_files/*WebCore* %license _license_files/*WebInspectorUI* @@ -250,14 +260,16 @@ popd %if %{with docs} %files -n webkit2gtk4.1-help -%dir %{_datadir}/gtk-doc -%dir %{_datadir}/gtk-doc/html -%{_datadir}/gtk-doc/html/javascriptcoregtk-4.1/ -%{_datadir}/gtk-doc/html/webkit2gtk-4.1/ -%{_datadir}/gtk-doc/html/webkit2gtk-web-extension-4.1/ +%dir %{_datadir}/doc +%{_datadir}/doc/javascriptcoregtk-4.1/ +%{_datadir}/doc/webkit2gtk-4.1/ +%{_datadir}/doc/webkit2gtk-web-extension-4.1/ %endif %changelog +* Tue Apr 15 2025 lingsheng - 2.48.1-1 +- Update to 2.48.1 + * Thu Aug 29 2024 lingsheng - 2.38.2-10 - Modfiy loongarch64 and sw_64 support use all arch diff --git a/webkitgtk-2.38.2.tar.xz b/webkitgtk-2.38.2.tar.xz deleted file mode 100644 index 6a3b058187dbe4abb3e1d903d068bf0b993366c5..0000000000000000000000000000000000000000 Binary files a/webkitgtk-2.38.2.tar.xz and /dev/null differ diff --git a/webkitgtk-2.38.2.tar.xz.asc b/webkitgtk-2.38.2.tar.xz.asc deleted file mode 100644 index 7c4264075309636ec46b56035c4e438491de022d..0000000000000000000000000000000000000000 --- a/webkitgtk-2.38.2.tar.xz.asc +++ /dev/null @@ -1,6 +0,0 @@ ------BEGIN PGP SIGNATURE----- - -iF0EABEDAB0WIQTX/PYc+aLeqzHYG9Pz0yLQ7EWCwwUCY2TNpwAKCRDz0yLQ7EWC -wyH5AJ4ktXefZTDTuk7ETZ3ZhjyVqaVqfQCg3uzmbd5M3POtdDuuG5eALaXQXhA= -=CshI ------END PGP SIGNATURE----- diff --git a/webkitgtk-2.48.1-drop-Wunsafe-buffer-usage.patch b/webkitgtk-2.48.1-drop-Wunsafe-buffer-usage.patch new file mode 100644 index 0000000000000000000000000000000000000000..b6c8895f8753d56a82c97297019ef15bfdb3105e --- /dev/null +++ b/webkitgtk-2.48.1-drop-Wunsafe-buffer-usage.patch @@ -0,0 +1,11 @@ +--- webkitgtk-2.48.1/Source/cmake/WebKitCompilerFlags.cmake.orig 2025-04-10 18:49:19.920205230 +0800 ++++ webkitgtk-2.48.1/Source/cmake/WebKitCompilerFlags.cmake 2025-04-10 18:51:38.568732084 +0800 +@@ -99,7 +99,7 @@ + function(WEBKIT_ADD_COMPILER_FLAGS _compiler _kind _subject) + foreach (_flag IN LISTS ARGN) + WEBKIT_CHECK_COMPILER_FLAGS(${_compiler} flag_supported "${_flag}") +- if (flag_supported) ++ if ((flag_supported) AND NOT ("${_flag}" MATCHES "-Wunsafe-buffer-usage")) + set_property(${_kind} ${_subject} APPEND PROPERTY COMPILE_OPTIONS "${_flag}") + endif () + endforeach () diff --git a/webkitgtk-2.48.1.tar.xz b/webkitgtk-2.48.1.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..52c4031c33bbc9e64a0052ec2b7601443e579228 --- /dev/null +++ b/webkitgtk-2.48.1.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:98efdf21c4cdca0fe0b73ab5a8cb52093b5aa52d9b1b016a93f71dbfa1eb258f +size 44168216 diff --git a/webkit2gtk5_0.spec b/webkitgtk6_0.spec similarity index 63% rename from webkit2gtk5_0.spec rename to webkitgtk6_0.spec index 1792ed36fa7b3dea5ce764307187431b6df70fca..0f0961c8d84a2fc7b0d8f3e17001fa40f9c175c4 100644 --- a/webkit2gtk5_0.spec +++ b/webkitgtk6_0.spec @@ -1,43 +1,42 @@ # Filter out provides for private libraries -%global __provides_exclude_from ^(%{_libdir}/webkit2gtk-4\\.0/.*\\.so|%{_libdir}/webkit2gtk-4\\.1/.*\\.so|%{_libdir}/webkit2gtk-5\\.0/.*\\.so)$ +%global __provides_exclude_from ^(%{_libdir}/webkitgtk-6\\.0/.*\\.so)$ +# Run dwz to reduce debuginfo package size %global _dwz_max_die_limit 250000000 -%global _dwz_max_die_limit_x86_64 250000000 +%global _find_debuginfo_dwz_opts --run-dwz\\\ + --dwz-max-die-limit %{_dwz_max_die_limit} %global add_to_license_files() \ mkdir -p _license_files ; \ cp -p %1 _license_files/$(echo '%1' | sed -e 's!/!.!g') -%ifarch aarch64 +# Clang is preferred by skia +%global toolchain clang + +# Build document by default %bcond_without docs -%endif -Name: webkit2gtk5.0 -Version: 2.38.2 -Release: 10 +# Not support GamePad by default +%bcond_with gamepad + +Name: webkitgtk6.0 +Version: 2.48.1 +Release: 1 Summary: GTK web content engine library -License: LGPLv2 +License: BSD-3-Clause AND LGPL-2.0-or-later URL: https://www.webkitgtk.org/ Source0: https://webkitgtk.org/releases/webkitgtk-%{version}.tar.xz -Source1: https://webkitgtk.org/releases/webkitgtk-%{version}.tar.xz.asc Patch1000: webkitgtk-add-loongarch-and-sw.patch - -Patch6000: backport-CVE-2023-28204.patch -Patch6001: backport-CVE-2023-32373.patch -Patch6002: backport-CVE-2023-32409.patch -Patch6003: backport-Fix-build-with-Ruby-3.2.patch -Patch6004: backport-CVE-2023-39928.patch -Patch6005: backport-CVE-2024-4558.patch -Patch6006: backport-CVE-2024-40779.patch -Patch6007: backport-CVE-2024-40780.patch +# clang 17 has bug on Wunsafe-buffer-usage, disable it for now +Patch1001: webkitgtk-2.48.1-drop-Wunsafe-buffer-usage.patch #Dependency BuildRequires: bison BuildRequires: bubblewrap +BuildRequires: clang BuildRequires: cmake BuildRequires: flex -BuildRequires: gcc-c++ BuildRequires: gettext BuildRequires: gi-docgen BuildRequires: git @@ -46,6 +45,8 @@ BuildRequires: gperf BuildRequires: hyphen-devel BuildRequires: libatomic BuildRequires: ninja-build +BuildRequires: openssl-devel +BuildRequires: perl(bigint) BuildRequires: perl(English) BuildRequires: perl(FindBin) BuildRequires: perl(JSON::PP) @@ -53,99 +54,108 @@ BuildRequires: python3 BuildRequires: ruby BuildRequires: rubygems BuildRequires: rubygem-json +BuildRequires: unifdef BuildRequires: xdg-dbus-proxy BuildRequires: pkgconfig(atspi-2) BuildRequires: pkgconfig(cairo) BuildRequires: pkgconfig(egl) BuildRequires: pkgconfig(enchant-2) +BuildRequires: pkgconfig(epoxy) BuildRequires: pkgconfig(fontconfig) BuildRequires: pkgconfig(freetype2) -BuildRequires: pkgconfig(gl) +BuildRequires: pkgconfig(gbm) BuildRequires: pkgconfig(glib-2.0) -BuildRequires: pkgconfig(glesv2) BuildRequires: pkgconfig(gobject-introspection-1.0) BuildRequires: pkgconfig(gstreamer-1.0) BuildRequires: pkgconfig(gstreamer-plugins-base-1.0) -BuildRequires: pkgconfig(gtk+-3.0) BuildRequires: pkgconfig(gtk4) BuildRequires: pkgconfig(harfbuzz) BuildRequires: pkgconfig(icu-uc) BuildRequires: pkgconfig(lcms2) +BuildRequires: pkgconfig(libdrm) BuildRequires: pkgconfig(libgcrypt) BuildRequires: pkgconfig(libjpeg) BuildRequires: pkgconfig(libnotify) -BuildRequires: pkgconfig(libopenjp2) -BuildRequires: pkgconfig(libpcre) BuildRequires: pkgconfig(libpng) BuildRequires: pkgconfig(libseccomp) BuildRequires: pkgconfig(libsecret-1) -BuildRequires: pkgconfig(libsoup-2.4) BuildRequires: pkgconfig(libsoup-3.0) BuildRequires: pkgconfig(libsystemd) BuildRequires: pkgconfig(libtasn1) BuildRequires: pkgconfig(libwebp) BuildRequires: pkgconfig(libwoff2dec) BuildRequires: pkgconfig(libxslt) -#BuildRequires: pkgconfig(manette-0.2) +%if %{with gamepad} +BuildRequires: pkgconfig(manette-0.2) +%endif BuildRequires: pkgconfig(sqlite3) +BuildRequires: pkgconfig(sysprof-capture-4) BuildRequires: pkgconfig(upower-glib) BuildRequires: pkgconfig(wayland-client) BuildRequires: pkgconfig(wayland-egl) BuildRequires: pkgconfig(wayland-protocols) BuildRequires: pkgconfig(wayland-server) -BuildRequires: pkgconfig(wpe-1.0) -BuildRequires: pkgconfig(wpebackend-fdo-1.0) BuildRequires: pkgconfig(xt) -Requires: javascriptcoregtk5.0%{?_isa} = %{version}-%{release} +Requires: javascriptcoregtk6.0%{?_isa} = %{version}-%{release} Requires: bubblewrap +Requires: libGLES Requires: xdg-dbus-proxy Recommends: geoclue2 Recommends: gstreamer1-plugins-bad-free Recommends: gstreamer1-plugins-good Recommends: xdg-desktop-portal-gtk +Provides: bundled(angle) +Provides: bundled(pdfjs) +Provides: bundled(skia) +Provides: bundled(xdgmime) +Obsoletes: webkit2gtk5.0 < %{version}-%{release} %description WebKitGTK is the port of the WebKit web rendering engine to the -GTK platform. This package contains WebKitGTK for GTK 3 and libsoup 2. +GTK platform. This package contains WebKitGTK for GTK 4 and libsoup 3. -%package -n webkit2gtk5.0-devel -Summary: Development files for webkit2gtk5.0 -Requires: webkit2gtk5.0%{?_isa} = %{version}-%{release} -Requires: javascriptcoregtk5.0%{?_isa} = %{version}-%{release} -Requires: javascriptcoregtk5.0-devel%{?_isa} = %{version}-%{release} +%package -n webkitgtk6.0-devel +Summary: Development files for webkitgtk6.0 +Requires: webkitgtk6.0%{?_isa} = %{version}-%{release} +Requires: javascriptcoregtk6.0%{?_isa} = %{version}-%{release} +Requires: javascriptcoregtk6.0-devel%{?_isa} = %{version}-%{release} +Obsoletes: webkit2gtk5.0-devel < %{version}-%{release} -%description -n webkit2gtk5.0-devel -The webkit2gtk5.0-devel package contains libraries, build data, and header -files for developing applications that use webkit2gtk5.0. +%description -n webkitgtk6.0-devel +The webkitgtk6.0-devel package contains libraries, build data, and header +files for developing applications that use webkitgtk6.0. %if %{with docs} -%package -n webkit2gtk5.0-help -Summary: Documentation files for webkit2gtk5.0 +%package -n webkitgtk6.0-help +Summary: Documentation files for webkitgtk6.0 BuildArch: noarch -Requires: webkit2gtk5.0 = %{version}-%{release} +Requires: webkitgtk6.0 = %{version}-%{release} +Obsoletes: webkit2gtk5.0-help < %{version}-%{release} -%description -n webkit2gtk5.0-help -This package contains developer documentation for webkit2gtk5.0. +%description -n webkitgtk6.0-help +This package contains developer documentation for webkitgtk6.0. %endif -%package -n jsc5.0 -Summary: JavaScript engine from webkit2gtk5.0 -Provides: javascriptcoregtk5.0%{?_isa} = %{version}-%{release} +%package -n jsc6.0 +Summary: JavaScript engine from webkitgtk6.0 +Provides: javascriptcoregtk6.0%{?_isa} = %{version}-%{release} +Obsoletes: jsc5.0 < %{version}-%{release} -%description -n jsc5.0 -This package contains JavaScript engine from webkit2gtk5.0. +%description -n jsc6.0 +This package contains JavaScript engine from webkitgtk6.0. -%package -n jsc5.0-devel -Summary: Development files for JavaScript engine from webkit2gtk5.0 -Provides: javascriptcoregtk5.0-devel%{?_isa} = %{version}-%{release} -Requires: javascriptcoregtk5.0%{?_isa} = %{version}-%{release} +%package -n jsc6.0-devel +Summary: Development files for JavaScript engine from webkitgtk6.0 +Provides: javascriptcoregtk6.0-devel%{?_isa} = %{version}-%{release} +Requires: javascriptcoregtk6.0%{?_isa} = %{version}-%{release} +Obsoletes: jsc5.0-devel < %{version}-%{release} -%description -n jsc5.0-devel -The javascriptcoregtk5.0-devel package contains libraries, build data, and header -files for developing applications that use JavaScript engine from webkit2gtk-5.0. +%description -n jsc6.0-devel +The jsc6.0-devel package contains libraries, build data, and header +files for developing applications that use JavaScript engine from webkitgtk-6.0. @@ -153,19 +163,26 @@ files for developing applications that use JavaScript engine from webkit2gtk-5.0 %autosetup -p1 -n webkitgtk-%{version} %build -#%%define _vpath_builddir %{_vendor}-%{_target_os}-build/webkit2gtk-5.0 -mkdir -p build-5.0 -pushd build-5.0 +mkdir -p build-6.0 +pushd build-6.0 %cmake \ -GNinja \ -DPORT=GTK \ -DCMAKE_BUILD_TYPE=Release \ -DUSE_GTK4=ON \ -DENABLE_WEBDRIVER=OFF \ + -DUSE_JPEGXL=OFF \ + -DUSE_AVIF=OFF \ + -DUSE_LIBBACKTRACE=OFF \ + -DUSE_GSTREAMER_TRANSCODER=OFF \ + -DENABLE_SPEECH_SYNTHESIS=OFF \ + -DUSE_SKIA_OPENTYPE_SVG=OFF \ %if %{without docs} -DENABLE_DOCUMENTATION=OFF \ %endif +%if %{without gamepad} -DENABLE_GAMEPAD=OFF \ +%endif %ifarch aarch64 loongarch64 -DENABLE_JIT=OFF \ -DUSE_SYSTEM_MALLOC=ON \ @@ -178,22 +195,19 @@ pushd build-5.0 .. %{nil} export NINJA_STATUS="[1/3][%f/%t %es] " -%ninja_build -j16 +%ninja_build popd %install -#%%define _vpath_builddir %{_vendor}-%{_target_os}-build/webkit2gtk-5.0 -pushd build-5.0 +pushd build-6.0 %ninja_install popd - -%find_lang WebKit2GTK-5.0 +%find_lang WebKitGTK-6.0 # Finally, copy over and rename various files for %%license inclusion %add_to_license_files Source/JavaScriptCore/COPYING.LIB %add_to_license_files Source/ThirdParty/ANGLE/LICENSE -%add_to_license_files Source/ThirdParty/ANGLE/src/common/third_party/smhasher/LICENSE %add_to_license_files Source/ThirdParty/ANGLE/src/third_party/libXNVCtrl/LICENSE %add_to_license_files Source/WebCore/LICENSE-APPLE %add_to_license_files Source/WebCore/LICENSE-LGPL-2 @@ -205,59 +219,59 @@ popd %add_to_license_files Source/WTF/wtf/dtoa/COPYING %add_to_license_files Source/WTF/wtf/dtoa/LICENSE -%files -n webkit2gtk5.0 -f WebKit2GTK-5.0.lang +%files -n webkitgtk6.0 -f WebKitGTK-6.0.lang %license _license_files/*ThirdParty* %license _license_files/*WebCore* %license _license_files/*WebInspectorUI* %license _license_files/*WTF* -%{_libdir}/libwebkit2gtk-5.0.so.0* +%{_libdir}/libwebkitgtk-6.0.so.4* %dir %{_libdir}/girepository-1.0 -%{_libdir}/girepository-1.0/WebKit2-5.0.typelib -%{_libdir}/girepository-1.0/WebKit2WebExtension-5.0.typelib -%{_libdir}/webkit2gtk-5.0/ -%{_libexecdir}/webkit2gtk-5.0/ -%exclude %{_libexecdir}/webkit2gtk-5.0/MiniBrowser -%exclude %{_libexecdir}/webkit2gtk-5.0/jsc - - -%files -n webkit2gtk5.0-devel -%{_libexecdir}/webkit2gtk-5.0/MiniBrowser -%{_includedir}/webkitgtk-5.0/ -%exclude %{_includedir}/webkitgtk-5.0/JavaScriptCore -%exclude %{_includedir}/webkitgtk-5.0/jsc -%{_libdir}/libwebkit2gtk-5.0.so -%{_libdir}/pkgconfig/webkit2gtk-5.0.pc -%{_libdir}/pkgconfig/webkit2gtk-web-extension-5.0.pc +%{_libdir}/girepository-1.0/WebKit-6.0.typelib +%{_libdir}/girepository-1.0/WebKitWebProcessExtension-6.0.typelib +%{_libdir}/webkitgtk-6.0/ +%{_libexecdir}/webkitgtk-6.0/ +%exclude %{_libexecdir}/webkitgtk-6.0/MiniBrowser +%exclude %{_libexecdir}/webkitgtk-6.0/jsc + + +%files -n webkitgtk6.0-devel +%{_libexecdir}/webkitgtk-6.0/MiniBrowser +%{_includedir}/webkitgtk-6.0/ +%exclude %{_includedir}/webkitgtk-6.0/jsc +%{_libdir}/libwebkitgtk-6.0.so +%{_libdir}/pkgconfig/webkitgtk-6.0.pc +%{_libdir}/pkgconfig/webkitgtk-web-process-extension-6.0.pc %dir %{_datadir}/gir-1.0 -%{_datadir}/gir-1.0/WebKit2-5.0.gir -%{_datadir}/gir-1.0/WebKit2WebExtension-5.0.gir +%{_datadir}/gir-1.0/WebKit-6.0.gir +%{_datadir}/gir-1.0/WebKitWebProcessExtension-6.0.gir -%files -n jsc5.0 +%files -n jsc6.0 %license _license_files/*JavaScriptCore* -%{_libdir}/libjavascriptcoregtk-5.0.so.0* +%{_libdir}/libjavascriptcoregtk-6.0.so.1* %dir %{_libdir}/girepository-1.0 -%{_libdir}/girepository-1.0/JavaScriptCore-5.0.typelib - -%files -n jsc5.0-devel -%{_libexecdir}/webkit2gtk-5.0/jsc -%dir %{_includedir}/webkitgtk-5.0 -%{_includedir}/webkitgtk-5.0/JavaScriptCore/ -%{_includedir}/webkitgtk-5.0/jsc/ -%{_libdir}/libjavascriptcoregtk-5.0.so -%{_libdir}/pkgconfig/javascriptcoregtk-5.0.pc +%{_libdir}/girepository-1.0/JavaScriptCore-6.0.typelib + +%files -n jsc6.0-devel +%{_libexecdir}/webkitgtk-6.0/jsc +%dir %{_includedir}/webkitgtk-6.0 +%{_includedir}/webkitgtk-6.0/jsc/ +%{_libdir}/libjavascriptcoregtk-6.0.so +%{_libdir}/pkgconfig/javascriptcoregtk-6.0.pc %dir %{_datadir}/gir-1.0 -%{_datadir}/gir-1.0/JavaScriptCore-5.0.gir +%{_datadir}/gir-1.0/JavaScriptCore-6.0.gir %if %{with docs} -%files -n webkit2gtk5.0-help -%dir %{_datadir}/gtk-doc -%dir %{_datadir}/gtk-doc/html -%{_datadir}/gtk-doc/html/javascriptcoregtk-5.0/ -%{_datadir}/gtk-doc/html/webkit2gtk-5.0/ -%{_datadir}/gtk-doc/html/webkit2gtk-web-extension-5.0/ +%files -n webkitgtk6.0-help +%dir %{_datadir}/doc +%{_datadir}/doc/javascriptcoregtk-6.0/ +%{_datadir}/doc/webkitgtk-6.0/ +%{_datadir}/doc/webkitgtk-web-process-extension-6.0/ %endif %changelog +* Tue Apr 15 2025 lingsheng - 2.48.1-1 +- Update to 2.48.1 + * Thu Aug 29 2024 lingsheng - 2.38.2-10 - Modfiy loongarch64 and sw_64 support use all arch