From 2d7f6e9b269b6bba6fbb171f8cf784e8186951f5 Mon Sep 17 00:00:00 2001 From: Renbo Date: Mon, 27 May 2024 16:51:58 +0800 Subject: [PATCH 1/3] update to webkit2gtk3-2.42.5-1.src.rpm Signed-off-by: Renbo --- CVE-2023-42917.patch | 80 ------- cairo-1.15.patch | 36 +++ download | 4 +- glib-2.56.patch | 39 ++++ glib-dep.patch | 19 -- gstreamer-1.16.1.patch | 458 ++++++++++++++++++++++++++++++++++++-- i686-build.patch | 16 ++ icu60.patch | 68 +++--- webkit2gtk3.spec | 65 +++--- webkitgtk-2.40.5-sw.patch | 26 --- 10 files changed, 607 insertions(+), 204 deletions(-) delete mode 100644 CVE-2023-42917.patch create mode 100644 cairo-1.15.patch create mode 100644 glib-2.56.patch delete mode 100644 glib-dep.patch create mode 100644 i686-build.patch delete mode 100644 webkitgtk-2.40.5-sw.patch diff --git a/CVE-2023-42917.patch b/CVE-2023-42917.patch deleted file mode 100644 index a638b86..0000000 --- a/CVE-2023-42917.patch +++ /dev/null @@ -1,80 +0,0 @@ -From 00352dd86bfa102b6e4b792120e3ef3498a27d1e Mon Sep 17 00:00:00 2001 -From: Russell Epstein -Date: Fri, 17 Nov 2023 15:48:32 -0800 -Subject: [PATCH] Cherry-pick b0a755e34426. - https://bugs.webkit.org/show_bug.cgi?id=265067 - - Race condition between JSObject::getDirectConcurrently users and Structure::flattenDictionaryStructure - https://bugs.webkit.org/show_bug.cgi?id=265067 - rdar://118548733 - - Reviewed by Justin Michaud and Mark Lam. - - Like Array shift/unshift, flattenDictionaryStructure is the other code which can shrink butterfly for named properties (no other code does it). - Compiler threads rely on the fact that normally named property storage never shrunk. And we should catch this exceptional case by taking a cellLock - in the compiler thread. But flattenDictionaryStructure is not taking cellLock correctly. - - This patch computes afterOutOfLineCapacity first to detect that whether this flattening will shrink the butterfly. - And if it is, then we take a cellLock. We do not need to take it if we do not shrink the butterfly. - - * Source/JavaScriptCore/runtime/Structure.cpp: - (JSC::Structure::flattenDictionaryStructure): - - Canonical link: https://commits.webkit.org/267815.577@safari-7617-branch - - Canonical link: https://commits.webkit.org/265870.632@safari-7616.2.9.10-branch ---- - Source/JavaScriptCore/runtime/Structure.cpp | 28 +++++++++++++++------ - 1 file changed, 21 insertions(+), 7 deletions(-) - -diff --git a/Source/JavaScriptCore/runtime/Structure.cpp b/Source/JavaScriptCore/runtime/Structure.cpp -index 2922e2478794c..9d094e2c8adc8 100644 ---- a/Source/JavaScriptCore/runtime/Structure.cpp -+++ b/Source/JavaScriptCore/runtime/Structure.cpp -@@ -913,17 +913,31 @@ Structure* Structure::flattenDictionaryStructure(VM& vm, JSObject* object) - checkOffsetConsistency(); - ASSERT(isDictionary()); - ASSERT(object->structure() == this); -- -- GCSafeConcurrentJSLocker locker(m_lock, vm); -- -- object->setStructureIDDirectly(id().nuke()); -- WTF::storeStoreFence(); - -+ Locker cellLocker(NoLockingNecessary); -+ -+ PropertyTable* table = nullptr; - size_t beforeOutOfLineCapacity = this->outOfLineCapacity(); -+ size_t afterOutOfLineCapacity = beforeOutOfLineCapacity; - if (isUncacheableDictionary()) { -- PropertyTable* table = propertyTableOrNull(); -+ table = propertyTableOrNull(); - ASSERT(table); -+ PropertyOffset maxOffset = invalidOffset; -+ if (unsigned propertyCount = table->size()) -+ maxOffset = offsetForPropertyNumber(propertyCount - 1, m_inlineCapacity); -+ afterOutOfLineCapacity = outOfLineCapacity(maxOffset); -+ } - -+ // This is the only case we shrink butterfly in this function. We should take a cell lock to protect against concurrent access to the butterfly. -+ if (beforeOutOfLineCapacity != afterOutOfLineCapacity) -+ cellLocker = Locker { object->cellLock() }; -+ -+ GCSafeConcurrentJSLocker locker(m_lock, vm); -+ -+ object->setStructureIDDirectly(id().nuke()); -+ WTF::storeStoreFence(); -+ -+ if (isUncacheableDictionary()) { - size_t propertyCount = table->size(); - - // Holds our values compacted by insertion order. This is OK since GC is deferred. -@@ -955,7 +969,7 @@ Structure* Structure::flattenDictionaryStructure(VM& vm, JSObject* object) - setDictionaryKind(NoneDictionaryKind); - setHasBeenFlattenedBefore(true); - -- size_t afterOutOfLineCapacity = this->outOfLineCapacity(); -+ ASSERT(this->outOfLineCapacity() == afterOutOfLineCapacity); - - if (object->butterfly() && beforeOutOfLineCapacity != afterOutOfLineCapacity) { - ASSERT(beforeOutOfLineCapacity > afterOutOfLineCapacity); diff --git a/cairo-1.15.patch b/cairo-1.15.patch new file mode 100644 index 0000000..f452d28 --- /dev/null +++ b/cairo-1.15.patch @@ -0,0 +1,36 @@ +diff --git a/Source/cmake/OptionsGTK.cmake b/Source/cmake/OptionsGTK.cmake +index 526fe7cfe0cf..7650ea1bade2 100644 +--- a/Source/cmake/OptionsGTK.cmake ++++ b/Source/cmake/OptionsGTK.cmake +@@ -13,7 +13,7 @@ endif () + + set(USER_AGENT_BRANDING "" CACHE STRING "Branding to add to user agent string") + +-find_package(Cairo 1.16.0 REQUIRED) ++find_package(Cairo 1.14.0 REQUIRED) + find_package(Fontconfig 2.13.0 REQUIRED) + find_package(Freetype 2.9.0 REQUIRED) + find_package(LibGcrypt 1.6.0 REQUIRED) +@@ -91,6 +91,14 @@ else () + WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_RESOURCE_USAGE PRIVATE OFF) + endif () + ++# Enable variation fonts when cairo >= 1.16, fontconfig >= 2.13.0, freetype >= 2.9.0 and harfbuzz >= 1.4.2. ++if (("${PC_CAIRO_VERSION}" VERSION_GREATER "1.16.0" OR "${PC_CAIRO_VERSION}" STREQUAL "1.16.0") ++ AND ("${PC_FONTCONFIG_VERSION}" VERSION_GREATER "2.13.0" OR "${PC_FONTCONFIG_VERSION}" STREQUAL "2.13.0") ++ AND ("${FREETYPE_VERSION_STRING}" VERSION_GREATER "2.9.0" OR "${FREETYPE_VERSION_STRING}" STREQUAL "2.9.0") ++ AND ("${PC_HARFBUZZ_VERSION}" VERSION_GREATER "1.4.2" OR "${PC_HARFBUZZ_VERSION}" STREQUAL "1.4.2")) ++ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_VARIATION_FONTS PRIVATE ON) ++endif () ++ + # Public options shared with other WebKit ports. Do not add any options here + # without approval from a GTK reviewer. There must be strong reason to support + # changing the value of the option. +@@ -149,7 +157,6 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_POINTER_LOCK PRIVATE ON) + WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SERVICE_WORKER PRIVATE ON) + WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SHAREABLE_RESOURCE PRIVATE ON) + WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SPEECH_SYNTHESIS PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES}) +-WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_VARIATION_FONTS PRIVATE ON) + WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEB_API_STATISTICS PRIVATE ON) + WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEB_CODECS PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES}) + WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEB_RTC PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES}) diff --git a/download b/download index 04c0e35..2c2f786 100644 --- a/download +++ b/download @@ -1,2 +1,2 @@ -1fa7f0e3a2146293cfa4fecd0363679b webkitgtk-2.40.5.tar.xz -d428d05a9ec0aa7e20327de7036c3a1f webkitgtk-2.40.5.tar.xz.asc +9cf27d88b55e5b8168f4835b17ea6fd0 webkitgtk-2.42.5.tar.xz +3fe03198ade93d37d064c4d822a2af6f webkitgtk-2.42.5.tar.xz.asc diff --git a/glib-2.56.patch b/glib-2.56.patch new file mode 100644 index 0000000..8c35f1e --- /dev/null +++ b/glib-2.56.patch @@ -0,0 +1,39 @@ +diff --git a/Tools/MiniBrowser/gtk/BrowserSettingsDialog.c b/Tools/MiniBrowser/gtk/BrowserSettingsDialog.c +index ef000cd2b910..432c97257048 100644 +--- a/Tools/MiniBrowser/gtk/BrowserSettingsDialog.c ++++ b/Tools/MiniBrowser/gtk/BrowserSettingsDialog.c +@@ -175,11 +175,12 @@ static void featureTreeViewRenderStatusData(GtkTreeViewColumn *column, GtkCellRe + { + g_autoptr(WebKitFeature) feature = NULL; + gtk_tree_model_get(model, iter, FEATURES_LIST_COLUMN_FEATURE, &feature, -1); +- g_autoptr(GEnumClass) enumClass = g_type_class_ref(WEBKIT_TYPE_FEATURE_STATUS); ++ GEnumClass *enumClass = g_type_class_ref(WEBKIT_TYPE_FEATURE_STATUS); + g_object_set(renderer, + "markup", NULL, + "text", g_enum_get_value(enumClass, webkit_feature_get_status(feature))->value_nick, + NULL); ++ g_type_class_unref(enumClass); + } + + static void featureTreeViewRenderCategoryData(GtkTreeViewColumn *column, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer data) +diff --git a/Tools/MiniBrowser/gtk/main.c b/Tools/MiniBrowser/gtk/main.c +index 8be643a54151..ae82b41400b5 100644 +--- a/Tools/MiniBrowser/gtk/main.c ++++ b/Tools/MiniBrowser/gtk/main.c +@@ -273,7 +273,7 @@ static gboolean parseFeaturesOptionCallback(const gchar *option, const gchar *va + "features, prefixes '-' and '!' disable features. Names are case-insensitive. Example:\n" + "\n %s --features='!DirPseudo,+WebAnimationsCustomEffects,webgl'\n\n" + "Available features (+/- = enabled/disabled by default):\n\n", g_get_prgname()); +- g_autoptr(GEnumClass) statusEnum = g_type_class_ref(WEBKIT_TYPE_FEATURE_STATUS); ++ GEnumClass *statusEnum = g_type_class_ref(WEBKIT_TYPE_FEATURE_STATUS); + for (gsize i = 0; i < webkit_feature_list_get_length(featureList); i++) { + WebKitFeature *feature = webkit_feature_list_get(featureList, i); + g_print(" %c %s (%s)", +@@ -284,6 +284,7 @@ static gboolean parseFeaturesOptionCallback(const gchar *option, const gchar *va + g_print(": %s", webkit_feature_get_name(feature)); + g_print("\n"); + } ++ g_type_class_unref(statusEnum); + exit(EXIT_SUCCESS); + } + diff --git a/glib-dep.patch b/glib-dep.patch deleted file mode 100644 index 770dec3..0000000 --- a/glib-dep.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff --git a/glib-dep.patch b/glib-dep.patch -new file mode 100644 -index 0000000..dbc0ab6 ---- /dev/null -+++ b/glib-dep.patch -@@ -0,0 +1,13 @@ -+diff --git a/Source/WTF/wtf/glib/Sandbox.cpp b/Source/WTF/wtf/glib/Sandbox.cpp -+index 9b07bb8cb5a9b..a8169511fe851 100644 -+--- a/Source/WTF/wtf/glib/Sandbox.cpp -++++ b/Source/WTF/wtf/glib/Sandbox.cpp -+@@ -58,7 +58,7 @@ bool isInsideUnsupportedContainer() -+ int waitStatus = 0; -+ gboolean spawnSucceeded = g_spawn_sync(nullptr, const_cast(bwrapArgs), nullptr, -+ G_SPAWN_STDERR_TO_DEV_NULL, nullptr, nullptr, nullptr, nullptr, &waitStatus, nullptr); -+- supportedContainer = spawnSucceeded && g_spawn_check_wait_status(waitStatus, nullptr); -++ supportedContainer = spawnSucceeded && g_spawn_check_exit_status(waitStatus, nullptr); -+ if (!supportedContainer) -+ WTFLogAlways("Bubblewrap does not work inside of this container, sandboxing will be disabled."); -+ } diff --git a/gstreamer-1.16.1.patch b/gstreamer-1.16.1.patch index aa8d0ad..9f53fca 100644 --- a/gstreamer-1.16.1.patch +++ b/gstreamer-1.16.1.patch @@ -1,5 +1,359 @@ +diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp +index 77a0d6507240..353fb87900ba 100644 +--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp ++++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp +@@ -479,7 +479,6 @@ bool MediaPlayerPrivateGStreamer::doSeek(const MediaTime& position, float rate) + + auto seekStart = toGstClockTime(startTime); + auto seekStop = toGstClockTime(endTime); +- GST_DEBUG_OBJECT(pipeline(), "[Seek] Performing actual seek to %" GST_TIMEP_FORMAT " (endTime: %" GST_TIMEP_FORMAT ") at rate %f", &seekStart, &seekStop, rate); + return gst_element_seek(m_pipeline.get(), rate, GST_FORMAT_TIME, m_seekFlags, GST_SEEK_TYPE_SET, seekStart, GST_SEEK_TYPE_SET, seekStop); + } + +@@ -3296,9 +3295,6 @@ static uint32_t fourccValue(GstVideoFormat format) + case GST_VIDEO_FORMAT_P010_10LE: + case GST_VIDEO_FORMAT_P010_10BE: + return uint32_t(DMABufFormat::FourCC::P010); +- case GST_VIDEO_FORMAT_P016_LE: +- case GST_VIDEO_FORMAT_P016_BE: +- return uint32_t(DMABufFormat::FourCC::P016); + default: + break; + } + +From bbc469a2b43531275243850693af65f5f7d11bc6 Mon Sep 17 00:00:00 2001 +From: Michael Catanzaro +Date: Wed, 20 Sep 2023 13:07:44 -0500 +Subject: [PATCH 1/2] Revert GStreamer 1.18 dependency + +This reverts https://commits.webkit.org/263218@main +--- + .../AudioSourceProviderGStreamer.cpp | 5 +- + .../gstreamer/GLVideoSinkGStreamer.cpp | 11 ++-- + .../gstreamer/GStreamerAudioMixer.cpp | 2 +- + .../graphics/gstreamer/GStreamerCommon.cpp | 52 +++++++++++++++++++ + .../graphics/gstreamer/GStreamerCommon.h | 16 ++++++ + .../gstreamer/GStreamerRegistryScanner.cpp | 9 +++- + .../gstreamer/MediaPlayerPrivateGStreamer.cpp | 46 +++++++++++++--- + .../gstreamer/MediaPlayerPrivateGStreamer.h | 1 + + Source/cmake/GStreamerChecks.cmake | 2 +- + 9 files changed, 127 insertions(+), 17 deletions(-) + +diff --git a/Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp b/Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp +index a97e6431802c..d8b1a1f4bd8b 100644 +--- a/Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp ++++ b/Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp +@@ -122,7 +122,10 @@ AudioSourceProviderGStreamer::AudioSourceProviderGStreamer(MediaStreamTrackPriva + g_signal_connect_swapped(decodebin, "pad-added", G_CALLBACK(+[](AudioSourceProviderGStreamer* provider, GstPad* pad) { + auto padCaps = adoptGRef(gst_pad_query_caps(pad, nullptr)); + bool isAudio = doCapsHaveType(padCaps.get(), "audio"); +- RELEASE_ASSERT(isAudio); ++ if (webkitGstCheckVersion(1, 18, 0)) ++ RELEASE_ASSERT(isAudio); ++ else if (!isAudio) ++ return; + + auto sinkPad = adoptGRef(gst_element_get_static_pad(provider->m_audioSinkBin.get(), "sink")); + gst_pad_link(pad, sinkPad.get()); +diff --git a/Source/WebCore/platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp +index 1a7480828861..f3a51be68534 100644 +--- a/Source/WebCore/platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp ++++ b/Source/WebCore/platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp +@@ -186,12 +186,13 @@ static void webKitGLVideoSinkGetProperty(GObject* object, guint propertyId, GVal + WebKitGLVideoSink* sink = WEBKIT_GL_VIDEO_SINK(object); + + switch (propertyId) { +- case PROP_STATS: { +- GUniqueOutPtr stats; +- g_object_get(sink->priv->appSink.get(), "stats", &stats.outPtr(), nullptr); +- gst_value_set_structure(value, stats.get()); ++ case PROP_STATS: ++ if (webkitGstCheckVersion(1, 18, 0)) { ++ GUniqueOutPtr stats; ++ g_object_get(sink->priv->appSink.get(), "stats", &stats.outPtr(), nullptr); ++ gst_value_set_structure(value, stats.get()); ++ } + break; +- } + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propertyId, paramSpec); + RELEASE_ASSERT_NOT_REACHED(); +diff --git a/Source/WebCore/platform/graphics/gstreamer/GStreamerAudioMixer.cpp b/Source/WebCore/platform/graphics/gstreamer/GStreamerAudioMixer.cpp +index ad4b1ae3f77e..fb7e617b5d56 100644 +--- a/Source/WebCore/platform/graphics/gstreamer/GStreamerAudioMixer.cpp ++++ b/Source/WebCore/platform/graphics/gstreamer/GStreamerAudioMixer.cpp +@@ -32,7 +32,7 @@ GST_DEBUG_CATEGORY_STATIC(webkit_media_gst_audio_mixer_debug); + + bool GStreamerAudioMixer::isAvailable() + { +- return isGStreamerPluginAvailable("inter") && isGStreamerPluginAvailable("audiomixer"); ++ return webkitGstCheckVersion(1, 18, 0) && isGStreamerPluginAvailable("inter") && isGStreamerPluginAvailable("audiomixer"); + } + + GStreamerAudioMixer& GStreamerAudioMixer::singleton() +diff --git a/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp b/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp +index 794beaa6932a..5f6b3826f182 100644 +--- a/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp ++++ b/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp +@@ -105,6 +105,24 @@ GstPad* webkitGstGhostPadFromStaticTemplate(GstStaticPadTemplate* staticPadTempl + return pad; + } + ++#if !GST_CHECK_VERSION(1, 18, 0) ++void webkitGstVideoFormatInfoComponent(const GstVideoFormatInfo* info, guint plane, gint components[GST_VIDEO_MAX_COMPONENTS]) ++{ ++ guint c, i = 0; ++ ++ /* Reverse mapping of info->plane. */ ++ for (c = 0; c < GST_VIDEO_FORMAT_INFO_N_COMPONENTS(info); c++) { ++ if (GST_VIDEO_FORMAT_INFO_PLANE(info, c) == plane) { ++ components[i] = c; ++ i++; ++ } ++ } ++ ++ for (c = i; c < GST_VIDEO_MAX_COMPONENTS; c++) ++ components[c] = -1; ++} ++#endif ++ + #if ENABLE(VIDEO) + bool getVideoSizeAndFormatFromCaps(const GstCaps* caps, WebCore::IntSize& size, GstVideoFormat& format, int& pixelAspectRatioNumerator, int& pixelAspectRatioDenominator, int& stride) + { +@@ -748,6 +766,36 @@ String gstStructureToJSONString(const GstStructure* structure) + return value->toJSONString(); + } + ++#if !GST_CHECK_VERSION(1, 18, 0) ++GstClockTime webkitGstElementGetCurrentRunningTime(GstElement* element) ++{ ++ g_return_val_if_fail(GST_IS_ELEMENT(element), GST_CLOCK_TIME_NONE); ++ ++ auto baseTime = gst_element_get_base_time(element); ++ if (!GST_CLOCK_TIME_IS_VALID(baseTime)) { ++ GST_DEBUG_OBJECT(element, "Could not determine base time"); ++ return GST_CLOCK_TIME_NONE; ++ } ++ ++ auto clock = adoptGRef(gst_element_get_clock(element)); ++ if (!clock) { ++ GST_DEBUG_OBJECT(element, "Element has no clock"); ++ return GST_CLOCK_TIME_NONE; ++ } ++ ++ auto clockTime = gst_clock_get_time(clock.get()); ++ if (!GST_CLOCK_TIME_IS_VALID(clockTime)) ++ return GST_CLOCK_TIME_NONE; ++ ++ if (clockTime < baseTime) { ++ GST_DEBUG_OBJECT(element, "Got negative current running time"); ++ return GST_CLOCK_TIME_NONE; ++ } ++ ++ return clockTime - baseTime; ++} ++#endif ++ + GstClockTime webkitGstInitTime() + { + return s_webkitGstInitTime; +@@ -805,6 +853,7 @@ PlatformVideoColorSpace videoColorSpaceFromInfo(const GstVideoInfo& info) + case GST_VIDEO_TRANSFER_BT709: + colorSpace.transfer = PlatformVideoTransferCharacteristics::Bt709; + break; ++#if GST_CHECK_VERSION(1, 18, 0) + case GST_VIDEO_TRANSFER_BT601: + colorSpace.transfer = PlatformVideoTransferCharacteristics::Smpte170m; + break; +@@ -817,6 +866,7 @@ PlatformVideoColorSpace videoColorSpaceFromInfo(const GstVideoInfo& info) + case GST_VIDEO_TRANSFER_BT2020_10: + colorSpace.transfer = PlatformVideoTransferCharacteristics::Bt2020_10bit; + break; ++#endif + case GST_VIDEO_TRANSFER_BT2020_12: + colorSpace.transfer = PlatformVideoTransferCharacteristics::Bt2020_12bit; + break; +@@ -935,6 +985,7 @@ void fillVideoInfoColorimetryFromColorSpace(GstVideoInfo* info, const PlatformVi + case PlatformVideoTransferCharacteristics::Bt709: + GST_VIDEO_INFO_COLORIMETRY(info).transfer = GST_VIDEO_TRANSFER_BT709; + break; ++#if GST_CHECK_VERSION(1, 18, 0) + case PlatformVideoTransferCharacteristics::Smpte170m: + GST_VIDEO_INFO_COLORIMETRY(info).transfer = GST_VIDEO_TRANSFER_BT601; + break; +@@ -947,6 +998,7 @@ void fillVideoInfoColorimetryFromColorSpace(GstVideoInfo* info, const PlatformVi + case PlatformVideoTransferCharacteristics::Bt2020_10bit: + GST_VIDEO_INFO_COLORIMETRY(info).transfer = GST_VIDEO_TRANSFER_BT2020_10; + break; ++#endif + case PlatformVideoTransferCharacteristics::Bt2020_12bit: + GST_VIDEO_INFO_COLORIMETRY(info).transfer = GST_VIDEO_TRANSFER_BT2020_12; + break; +diff --git a/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h b/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h +index fae7ef96d6c5..65ef4bfefdaa 100644 +--- a/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h ++++ b/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h +@@ -56,6 +56,15 @@ inline bool webkitGstCheckVersion(guint major, guint minor, guint micro) + return true; + } + ++// gst_video_format_info_component() is GStreamer 1.18 API, so for older versions we use a local ++// vendored copy of the function. ++#if !GST_CHECK_VERSION(1, 18, 0) ++#define GST_VIDEO_MAX_COMPONENTS 4 ++void webkitGstVideoFormatInfoComponent(const GstVideoFormatInfo*, guint, gint components[GST_VIDEO_MAX_COMPONENTS]); ++ ++#define gst_video_format_info_component webkitGstVideoFormatInfoComponent ++#endif ++ + #define GST_VIDEO_CAPS_TYPE_PREFIX "video/" + #define GST_AUDIO_CAPS_TYPE_PREFIX "audio/" + #define GST_TEXT_CAPS_TYPE_PREFIX "text/" +@@ -323,6 +332,13 @@ GstElement* makeGStreamerBin(const char* description, bool ghostUnlinkedPads); + + String gstStructureToJSONString(const GstStructure*); + ++// gst_element_get_current_running_time() is GStreamer 1.18 API, so for older versions we use a local ++// vendored copy of the function. ++#if !GST_CHECK_VERSION(1, 18, 0) ++GstClockTime webkitGstElementGetCurrentRunningTime(GstElement*); ++#define gst_element_get_current_running_time webkitGstElementGetCurrentRunningTime ++#endif ++ + GstClockTime webkitGstInitTime(); + + PlatformVideoColorSpace videoColorSpaceFromCaps(const GstCaps*); +diff --git a/Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp b/Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp +index 7cd1926e6d15..032f086b43c0 100644 +--- a/Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp ++++ b/Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp +@@ -900,8 +900,13 @@ GStreamerRegistryScanner::CodecLookupResult GStreamerRegistryScanner::isAVC1Code + return checkH264Caps(makeString("video/x-h264, level=(string)", maxLevelString).utf8().data()); + } + +- GST_DEBUG("Checking video decoders for constrained caps"); +- return checkH264Caps(makeString("video/x-h264, level=(string)", level, ", profile=(string)", profile).utf8().data()); ++ if (webkitGstCheckVersion(1, 18, 0)) { ++ GST_DEBUG("Checking video decoders for constrained caps"); ++ return checkH264Caps(makeString("video/x-h264, level=(string)", level, ", profile=(string)", profile).utf8().data()); ++ } ++ ++ GST_DEBUG("Falling back to unconstrained caps"); ++ return checkH264Caps("video/x-h264"); + } + + const char* GStreamerRegistryScanner::configurationNameForLogging(Configuration configuration) const +diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp +index aad2c0bc432b..77a0d6507240 100644 +--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp ++++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp +@@ -4114,7 +4114,29 @@ GstElement* MediaPlayerPrivateGStreamer::createVideoSink() + g_signal_connect_swapped(m_videoSink.get(), "repaint-cancelled", G_CALLBACK(repaintCancelledCallback), this); + } + +- return m_videoSink.get(); ++ GstElement* videoSink = nullptr; ++ if (!webkitGstCheckVersion(1, 18, 0)) { ++ m_fpsSink = makeGStreamerElement("fpsdisplaysink", "sink"); ++ if (m_fpsSink) { ++ g_object_set(m_fpsSink.get(), "silent", TRUE , nullptr); ++ ++ // Turn off text overlay unless tracing is enabled. ++ if (gst_debug_category_get_threshold(webkit_media_player_debug) < GST_LEVEL_TRACE) ++ g_object_set(m_fpsSink.get(), "text-overlay", FALSE , nullptr); ++ ++ if (gstObjectHasProperty(m_fpsSink.get(), "video-sink")) { ++ g_object_set(m_fpsSink.get(), "video-sink", m_videoSink.get(), nullptr); ++ videoSink = m_fpsSink.get(); ++ } else ++ m_fpsSink = nullptr; ++ } ++ } ++ ++ if (!m_fpsSink) ++ videoSink = m_videoSink.get(); ++ ++ ASSERT(videoSink); ++ return videoSink; + } + + void MediaPlayerPrivateGStreamer::setStreamVolumeElement(GstStreamVolume* volume) +@@ -4147,16 +4169,26 @@ bool MediaPlayerPrivateGStreamer::updateVideoSinkStatistics() + if (!m_videoSink) + return false; + ++ if (!webkitGstCheckVersion(1, 18, 0) && !m_fpsSink) ++ return false; ++ + uint64_t totalVideoFrames = 0; + uint64_t droppedVideoFrames = 0; +- GUniqueOutPtr stats; +- g_object_get(m_videoSink.get(), "stats", &stats.outPtr(), nullptr); ++ if (webkitGstCheckVersion(1, 18, 0)) { ++ GUniqueOutPtr stats; ++ g_object_get(m_videoSink.get(), "stats", &stats.outPtr(), nullptr); + +- if (!gst_structure_get_uint64(stats.get(), "rendered", &totalVideoFrames)) +- return false; ++ if (!gst_structure_get_uint64(stats.get(), "rendered", &totalVideoFrames)) ++ return false; + +- if (!gst_structure_get_uint64(stats.get(), "dropped", &droppedVideoFrames)) +- return false; ++ if (!gst_structure_get_uint64(stats.get(), "dropped", &droppedVideoFrames)) ++ return false; ++ } else if (m_fpsSink) { ++ unsigned renderedFrames, droppedFrames; ++ g_object_get(m_fpsSink.get(), "frames-rendered", &renderedFrames, "frames-dropped", &droppedFrames, nullptr); ++ totalVideoFrames = renderedFrames; ++ droppedVideoFrames = droppedFrames; ++ } + + // Caching is required so that metrics queries performed after EOS still return valid values. + if (totalVideoFrames) +diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h +index e0cdb0a2d01f..f33a674481e1 100644 +--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h ++++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h +@@ -578,6 +578,7 @@ private: + uint64_t m_networkReadPosition { 0 }; + mutable uint64_t m_readPositionAtLastDidLoadingProgress { 0 }; + ++ GRefPtr m_fpsSink { nullptr }; + uint64_t m_totalVideoFrames { 0 }; + uint64_t m_droppedVideoFrames { 0 }; + uint64_t m_decodedVideoFrames { 0 }; +diff --git a/Source/cmake/GStreamerChecks.cmake b/Source/cmake/GStreamerChecks.cmake +index 5380617afc9c..8774f1d2aca8 100644 +--- a/Source/cmake/GStreamerChecks.cmake ++++ b/Source/cmake/GStreamerChecks.cmake +@@ -36,7 +36,7 @@ if (ENABLE_VIDEO OR ENABLE_WEB_AUDIO) + list(APPEND GSTREAMER_COMPONENTS webrtc) + endif () + +- find_package(GStreamer 1.18.4 REQUIRED COMPONENTS ${GSTREAMER_COMPONENTS}) ++ find_package(GStreamer 1.16.2 REQUIRED COMPONENTS ${GSTREAMER_COMPONENTS}) + + if (ENABLE_WEB_AUDIO) + if (NOT PC_GSTREAMER_AUDIO_FOUND OR NOT PC_GSTREAMER_FFT_FOUND) +-- +2.41.0 + +From 9046961d80cc168aab253e3e0eda2268bd956293 Mon Sep 17 00:00:00 2001 +From: Michael Catanzaro +Date: Wed, 20 Sep 2023 13:09:28 -0500 +Subject: [PATCH 2/2] Revert GStreamer 1.16 dependency + +This (mostly) reverts https://commits.webkit.org/256284@main +--- + .../gstreamer/GLVideoSinkGStreamer.cpp | 20 ++++++++++++++++++- + .../gstreamer/eme/GStreamerEMEUtilities.h | 10 ++++++++++ + ...bKitCommonEncryptionDecryptorGStreamer.cpp | 7 +++++-- + Source/cmake/GStreamerChecks.cmake | 2 +- + 4 files changed, 35 insertions(+), 4 deletions(-) + diff --git a/Source/WebCore/platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp -index a861b913ccfc..df21a1f67e98 100644 +index f3a51be68534..bf8ebeda1725 100644 --- a/Source/WebCore/platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp +++ b/Source/WebCore/platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp @@ -88,7 +88,25 @@ static void webKitGLVideoSinkConstructed(GObject* object) @@ -28,9 +382,91 @@ index a861b913ccfc..df21a1f67e98 100644 + } gst_caps_set_features(caps.get(), 0, gst_caps_features_new(GST_CAPS_FEATURE_MEMORY_GL_MEMORY, nullptr)); g_object_set(sink->priv->appSink.get(), "caps", caps.get(), nullptr); - + +diff --git a/Source/WebCore/platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h b/Source/WebCore/platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h +index 6dbf6a67dfd1..184c5c3e5f77 100644 +--- a/Source/WebCore/platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h ++++ b/Source/WebCore/platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h +@@ -61,8 +61,10 @@ public: + const String& systemId() const { return m_systemId; } + String payloadContainerType() const + { ++#if GST_CHECK_VERSION(1, 16, 0) + if (m_systemId == GST_PROTECTION_UNSPECIFIED_SYSTEM_ID ""_s) + return "webm"_s; ++#endif + return "cenc"_s; + } + +@@ -111,8 +113,10 @@ public: + static constexpr auto s_WidevineKeySystem = "com.widevine.alpha"_s; + static constexpr auto s_PlayReadyUUID = WEBCORE_GSTREAMER_EME_UTILITIES_PLAYREADY_UUID ""_s; + static constexpr std::array s_PlayReadyKeySystems = { "com.microsoft.playready"_s, "com.youtube.playready"_s }; ++#if GST_CHECK_VERSION(1, 16, 0) + static constexpr auto s_unspecifiedUUID = GST_PROTECTION_UNSPECIFIED_SYSTEM_ID ""_s; + static constexpr auto s_unspecifiedKeySystem = GST_PROTECTION_UNSPECIFIED_SYSTEM_ID ""_s; ++#endif + + static bool isClearKeyKeySystem(const String& keySystem) + { +@@ -144,6 +148,7 @@ public: + return equalIgnoringASCIICase(uuid, s_PlayReadyUUID); + } + ++#if GST_CHECK_VERSION(1, 16, 0) + static bool isUnspecifiedKeySystem(const String& keySystem) + { + return equalIgnoringASCIICase(keySystem, s_unspecifiedKeySystem); +@@ -153,6 +158,7 @@ public: + { + return equalIgnoringASCIICase(uuid, s_unspecifiedUUID); + } ++#endif + + static const char* keySystemToUuid(const String& keySystem) + { +@@ -165,8 +171,10 @@ public: + if (isPlayReadyKeySystem(keySystem)) + return s_PlayReadyUUID; + ++#if GST_CHECK_VERSION(1, 16, 0) + if (isUnspecifiedKeySystem(keySystem)) + return s_unspecifiedUUID; ++#endif + + ASSERT_NOT_REACHED(); + return { }; +@@ -183,8 +191,10 @@ public: + if (isPlayReadyUUID(uuid)) + return s_PlayReadyKeySystems[0]; + ++#if GST_CHECK_VERSION(1, 16, 0) + if (isUnspecifiedUUID(uuid)) + return s_unspecifiedKeySystem; ++#endif + + ASSERT_NOT_REACHED(); + return ""_s; +diff --git a/Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp +index 0cde37e1f83f..a7bbf7fc569c 100644 +--- a/Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp ++++ b/Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp +@@ -171,8 +171,11 @@ static GstCaps* transformCaps(GstBaseTransform* base, GstPadDirection direction, + + // GST_PROTECTION_UNSPECIFIED_SYSTEM_ID was added in the GStreamer + // developement git master which will ship as version 1.16.0. +- gst_structure_set_name(outgoingStructure.get(), !g_strcmp0(klass->protectionSystemId(self), +- GST_PROTECTION_UNSPECIFIED_SYSTEM_ID) ? "application/x-webm-enc" : "application/x-cenc"); ++ gst_structure_set_name(outgoingStructure.get(), ++#if GST_CHECK_VERSION(1, 16, 0) ++ !g_strcmp0(klass->protectionSystemId(self), GST_PROTECTION_UNSPECIFIED_SYSTEM_ID) ? "application/x-webm-enc" : ++#endif ++ "application/x-cenc"); + } + } + diff --git a/Source/cmake/GStreamerChecks.cmake b/Source/cmake/GStreamerChecks.cmake -index ba8423e2795c..df9d3204910d 100644 +index 8774f1d2aca8..d43093ec7824 100644 --- a/Source/cmake/GStreamerChecks.cmake +++ b/Source/cmake/GStreamerChecks.cmake @@ -36,7 +36,7 @@ if (ENABLE_VIDEO OR ENABLE_WEB_AUDIO) @@ -38,20 +474,10 @@ index ba8423e2795c..df9d3204910d 100644 endif () - find_package(GStreamer 1.16.2 REQUIRED COMPONENTS ${GSTREAMER_COMPONENTS}) -+ find_package(GStreamer 1.16.0 REQUIRED COMPONENTS ${GSTREAMER_COMPONENTS}) ++ find_package(GStreamer 1.14.0 REQUIRED COMPONENTS ${GSTREAMER_COMPONENTS}) if (ENABLE_WEB_AUDIO) if (NOT PC_GSTREAMER_AUDIO_FOUND OR NOT PC_GSTREAMER_FFT_FOUND) - -diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp -index 0b81e04559f0..4c6ae470e49f 100644 ---- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp -+++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp -@@ -479,7 +479,6 @@ bool MediaPlayerPrivateGStreamer::doSeek(const MediaTime& position, float rate) - - auto seekStart = toGstClockTime(startTime); - auto seekStop = toGstClockTime(endTime); -- GST_DEBUG_OBJECT(pipeline(), "[Seek] Performing actual seek to %" GST_TIMEP_FORMAT " (endTime: %" GST_TIMEP_FORMAT ") at rate %f", &seekStart, &seekStop, rate); - return gst_element_seek(m_pipeline.get(), rate, GST_FORMAT_TIME, m_seekFlags, GST_SEEK_TYPE_SET, seekStart, GST_SEEK_TYPE_SET, seekStop); - } +-- +2.41.0 diff --git a/i686-build.patch b/i686-build.patch new file mode 100644 index 0000000..1b5ec0d --- /dev/null +++ b/i686-build.patch @@ -0,0 +1,16 @@ +From: Alberto Garcia +Subject: Fix FTBFS in i386 +Bug: https://bugs.webkit.org/show_bug.cgi?id=268739 +Index: webkitgtk/Source/JavaScriptCore/llint/LowLevelInterpreter.cpp +=================================================================== +--- webkitgtk.orig/Source/JavaScriptCore/llint/LowLevelInterpreter.cpp ++++ webkitgtk/Source/JavaScriptCore/llint/LowLevelInterpreter.cpp +@@ -336,8 +336,6 @@ JSValue CLoop::execute(OpcodeID entryOpc + UNUSED_VARIABLE(t2); + UNUSED_VARIABLE(t3); + UNUSED_VARIABLE(t5); +- UNUSED_VARIABLE(t6); +- UNUSED_VARIABLE(t7); + + struct StackPointerScope { + StackPointerScope(CLoopStack& stack) diff --git a/icu60.patch b/icu60.patch index eb46e27..c0dbc14 100644 --- a/icu60.patch +++ b/icu60.patch @@ -48,10 +48,10 @@ index 058b2423786d..e7a8c82f392b 100644 private: UDateTimePatternGenerator* getSharedPatternGenerator(const CString& locale, UErrorCode& status) diff --git a/Source/JavaScriptCore/runtime/IntlDisplayNames.cpp b/Source/JavaScriptCore/runtime/IntlDisplayNames.cpp -index f38161e7f95b..068613ce8feb 100644 +index ed8dd34fdf44..9ec789b65413 100644 --- a/Source/JavaScriptCore/runtime/IntlDisplayNames.cpp +++ b/Source/JavaScriptCore/runtime/IntlDisplayNames.cpp -@@ -110,6 +110,7 @@ void IntlDisplayNames::initializeDisplayNames(JSGlobalObject* globalObject, JSVa +@@ -104,6 +104,7 @@ void IntlDisplayNames::initializeDisplayNames(JSGlobalObject* globalObject, JSVa m_languageDisplay = intlOption(globalObject, options, vm.propertyNames->languageDisplay, { { "dialect"_s, LanguageDisplay::Dialect }, { "standard"_s, LanguageDisplay::Standard } }, "languageDisplay must be either \"dialect\" or \"standard\""_s, LanguageDisplay::Dialect); RETURN_IF_EXCEPTION(scope, void()); @@ -59,7 +59,7 @@ index f38161e7f95b..068613ce8feb 100644 UErrorCode status = U_ZERO_ERROR; UDisplayContext contexts[] = { -@@ -137,15 +138,19 @@ void IntlDisplayNames::initializeDisplayNames(JSGlobalObject* globalObject, JSVa +@@ -131,6 +132,10 @@ void IntlDisplayNames::initializeDisplayNames(JSGlobalObject* globalObject, JSVa throwTypeError(globalObject, scope, "failed to initialize DisplayNames"_s); return; } @@ -70,9 +70,7 @@ index f38161e7f95b..068613ce8feb 100644 } // https://tc39.es/proposal-intl-displaynames/#sec-Intl.DisplayNames.prototype.of - JSValue IntlDisplayNames::of(JSGlobalObject* globalObject, JSValue codeValue) const - { -- +@@ -140,6 +145,7 @@ JSValue IntlDisplayNames::of(JSGlobalObject* globalObject, JSValue codeValue) co VM& vm = globalObject->vm(); auto scope = DECLARE_THROW_SCOPE(vm); @@ -80,7 +78,7 @@ index f38161e7f95b..068613ce8feb 100644 ASSERT(m_displayNames); auto code = codeValue.toWTFString(globalObject); RETURN_IF_EXCEPTION(scope, { }); -@@ -350,6 +355,11 @@ JSValue IntlDisplayNames::of(JSGlobalObject* globalObject, JSValue codeValue) co +@@ -344,6 +350,11 @@ JSValue IntlDisplayNames::of(JSGlobalObject* globalObject, JSValue codeValue) co return throwTypeError(globalObject, scope, "Failed to query a display name."_s); } return jsString(vm, String(WTFMove(buffer))); @@ -93,7 +91,7 @@ index f38161e7f95b..068613ce8feb 100644 // https://tc39.es/proposal-intl-displaynames/#sec-Intl.DisplayNames.prototype.resolvedOptions diff --git a/Source/JavaScriptCore/runtime/IntlDisplayNames.h b/Source/JavaScriptCore/runtime/IntlDisplayNames.h -index d80dc3d83a15..f2bf36275c79 100644 +index 2101c342865e..87a95a26f55c 100644 --- a/Source/JavaScriptCore/runtime/IntlDisplayNames.h +++ b/Source/JavaScriptCore/runtime/IntlDisplayNames.h @@ -29,6 +29,13 @@ @@ -110,11 +108,31 @@ index d80dc3d83a15..f2bf36275c79 100644 namespace JSC { enum class RelevantExtensionKey : uint8_t; +diff --git a/Source/JavaScriptCore/runtime/IntlDurationFormat.cpp b/Source/JavaScriptCore/runtime/IntlDurationFormat.cpp +index fdcaa71f2011..f6aa1b0e3def 100644 +--- a/Source/JavaScriptCore/runtime/IntlDurationFormat.cpp ++++ b/Source/JavaScriptCore/runtime/IntlDurationFormat.cpp +@@ -41,7 +41,6 @@ + #endif + #endif + #include +-#include + #include + #if HAVE(ICU_U_LIST_FORMATTER) + #define U_HIDE_DRAFT_API 1 +@@ -49,6 +48,7 @@ + + #if HAVE(ICU_U_LIST_FORMATTER) + #include ++#include + #endif + + namespace JSC { diff --git a/Source/JavaScriptCore/runtime/IntlObject.cpp b/Source/JavaScriptCore/runtime/IntlObject.cpp -index 0080abf51be4..d23c7c021334 100644 +index cba15c79bc45..9553eb6b263b 100644 --- a/Source/JavaScriptCore/runtime/IntlObject.cpp +++ b/Source/JavaScriptCore/runtime/IntlObject.cpp -@@ -164,7 +164,6 @@ namespace JSC { +@@ -165,7 +165,6 @@ namespace JSC { supportedValuesOf intlObjectFuncSupportedValuesOf DontEnum|Function 1 Collator createCollatorConstructor DontEnum|PropertyCallback DateTimeFormat createDateTimeFormatConstructor DontEnum|PropertyCallback @@ -122,7 +140,7 @@ index 0080abf51be4..d23c7c021334 100644 Locale createLocaleConstructor DontEnum|PropertyCallback NumberFormat createNumberFormatConstructor DontEnum|PropertyCallback PluralRules createPluralRulesConstructor DontEnum|PropertyCallback -@@ -252,6 +251,11 @@ void IntlObject::finishCreation(VM& vm, JSGlobalObject*) +@@ -253,6 +252,11 @@ void IntlObject::finishCreation(VM& vm, JSGlobalObject*) Base::finishCreation(vm); ASSERT(inherits(info())); JSC_TO_STRING_TAG_WITHOUT_TRANSITION(); @@ -135,35 +153,15 @@ index 0080abf51be4..d23c7c021334 100644 if (Options::useIntlDurationFormat()) putDirectWithoutTransition(vm, vm.propertyNames->DurationFormat, createDurationFormatConstructor(vm, this), static_cast(PropertyAttribute::DontEnum)); diff --git a/Source/cmake/OptionsGTK.cmake b/Source/cmake/OptionsGTK.cmake -index 8bd6ed347418..9d0a7e88b16a 100644 +index 526fe7cfe0cf..7b057f87b67e 100644 --- a/Source/cmake/OptionsGTK.cmake +++ b/Source/cmake/OptionsGTK.cmake -@@ -18,7 +18,7 @@ find_package(Fontconfig 2.8.0 REQUIRED) - find_package(Freetype 2.4.2 REQUIRED) +@@ -18,7 +18,7 @@ find_package(Fontconfig 2.13.0 REQUIRED) + find_package(Freetype 2.9.0 REQUIRED) find_package(LibGcrypt 1.6.0 REQUIRED) - find_package(HarfBuzz 0.9.18 REQUIRED COMPONENTS ICU) + find_package(HarfBuzz 1.4.2 REQUIRED COMPONENTS ICU) -find_package(ICU 61.2 REQUIRED COMPONENTS data i18n uc) +find_package(ICU 60 REQUIRED COMPONENTS data i18n uc) find_package(JPEG REQUIRED) find_package(LibEpoxy 1.4.0 REQUIRED) find_package(LibXml2 2.8.0 REQUIRED) -diff --git a/Source/JavaScriptCore/runtime/IntlDurationFormat.cpp b/Source/JavaScriptCore/runtime/IntlDurationFormat.cpp -index fdcaa71f2011..f6aa1b0e3def 100644 ---- a/Source/JavaScriptCore/runtime/IntlDurationFormat.cpp -+++ b/Source/JavaScriptCore/runtime/IntlDurationFormat.cpp -@@ -41,7 +41,6 @@ - #endif - #endif - #include --#include - #include - #if HAVE(ICU_U_LIST_FORMATTER) - #define U_HIDE_DRAFT_API 1 -@@ -49,6 +48,7 @@ - - #if HAVE(ICU_U_LIST_FORMATTER) - #include -+#include - #endif - - namespace JSC { diff --git a/webkit2gtk3.spec b/webkit2gtk3.spec index 15322bd..b1e3425 100644 --- a/webkit2gtk3.spec +++ b/webkit2gtk3.spec @@ -1,4 +1,3 @@ -%define anolis_release .0.2 ## NOTE: Lots of files in various subdirectories have the same name (such as ## "LICENSE") so this short macro allows us to distinguish them by using their ## directory names (from the source tree) as prefixes for the files. @@ -7,13 +6,12 @@ cp -p %1 _license_files/$(echo '%1' | sed -e 's!/!.!g') Name: webkit2gtk3 -Version: 2.40.5 -Release: 1%{anolis_release}%{?dist}.1 +Version: 2.42.5 +Release: 1%{?dist} Summary: GTK Web content engine library License: LGPLv2 URL: http://www.webkitgtk.org/ -ExcludeArch: loongarch64 Source0: http://webkitgtk.org/releases/webkitgtk-%{version}.tar.xz Source1: https://webkitgtk.org/releases/webkitgtk-%{version}.tar.xz.asc # Use the keys from https://webkitgtk.org/verifying.html @@ -27,24 +25,23 @@ Patch0: evolution-shared-secondary-process.patch # https://bugs.webkit.org/show_bug.cgi?id=235367 Patch1: icu60.patch -# https://github.com/WebKit/WebKit/pull/14498 -Patch2: glib-dep.patch +# Partial revert of https://commits.webkit.org/256284@main +Patch2: gstreamer-1.16.1.patch -# Partial revert of https://github.com/WebKit/WebKit/pull/6087 -Patch3: gstreamer-1.16.1.patch +# Partial revert of https://commits.webkit.org/260744@main +Patch3: cairo-1.15.patch -# https://github.com/WebKit/WebKit/commit/00352dd86bfa102b6e4b792120e3ef3498a27d1e -Patch4: CVE-2023-42917.patch +# Avoid dependency on GEnumClass_autoptr +Patch4: glib-2.56.patch -Patch1001: webkitgtk-2.40.5-sw.patch +# https://bugs.webkit.org/show_bug.cgi?id=268739 +Patch5: i686-build.patch BuildRequires: bison BuildRequires: cmake BuildRequires: flex BuildRequires: gcc-c++ -%ifnarch sw_64 BuildRequires: gcc-toolset-13 -%endif BuildRequires: gettext BuildRequires: git BuildRequires: gperf @@ -71,12 +68,11 @@ BuildRequires: pkgconfig(enchant) %else BuildRequires: pkgconfig(enchant-2) %endif +BuildRequires: pkgconfig(epoxy) BuildRequires: pkgconfig(fontconfig) BuildRequires: pkgconfig(freetype2) BuildRequires: pkgconfig(gbm) -BuildRequires: pkgconfig(gl) BuildRequires: pkgconfig(glib-2.0) -BuildRequires: pkgconfig(glesv2) BuildRequires: pkgconfig(gobject-introspection-1.0) BuildRequires: pkgconfig(gstreamer-1.0) BuildRequires: pkgconfig(gstreamer-plugins-bad-1.0) @@ -109,6 +105,9 @@ BuildRequires: pkgconfig(wpe-1.0) BuildRequires: pkgconfig(wpebackend-fdo-1.0) BuildRequires: pkgconfig(xt) +# libepoxy will crash when WebKit tries using GLES2 if it's not installed. +Requires: libGLES + # If Geoclue is not running, the geolocation API will not work. Recommends: geoclue2 @@ -206,12 +205,10 @@ rm -rf Source/ThirdParty/qunit/ %global optflags %(echo %{optflags} | sed 's/-g /-g1 /') %endif -%ifnarch sw_64 # The system GCC is too old to build WebKit, so use a GCC Toolset instead. # This prints warnings complaining that it should not be used except in # SCL scriplets, but I can't figure out any other way to make it work. source scl_source enable gcc-toolset-13 -%endif # -DUSE_SYSTEM_MALLOC=ON is really bad for security, but libpas requires # __atomic_compare_exchange_16 which does not seem to be available. @@ -228,6 +225,7 @@ pushd %{_target_platform} -DUSE_AVIF=OFF \ -DENABLE_DOCUMENTATION=OFF \ -DUSE_GSTREAMER_TRANSCODER=OFF \ + -DUSE_JPEGXL=OFF \ -DENABLE_GAMEPAD=OFF \ %if 0%{?rhel} %ifarch aarch64 @@ -304,15 +302,30 @@ export NINJA_STATUS="[%f/%t][%e] " %{_datadir}/gir-1.0/JavaScriptCore-4.0.gir %changelog -* Mon Apr 1 2024 wxiat - 2.40.5-1.0.2.1 -- cherry-pick `add sw arch #ef8be098b07c4d8a9f809d32a607700f4a420676`. - -* Fri Mar 22 2024 Bo Ren 2.40.5-1.0.1.1 -- Exclude loongarch64 - -* Tue Dec 05 2023 Michael Catanzaro - 2.40.5-1.1 -- Add patch for CVE-2023-42917 - Resolves: RHEL-18172 +* Mon Feb 05 2024 Michael Catanzaro - 2.42.5-1 +- Update to 2.42.5 + Resolves: RHEL-3961 + +* Fri Dec 15 2023 Michael Catanzaro - 2.42.4-1 +- Update to 2.42.4 + Resolves: RHEL-3961 + Resolves: RHEL-19365 + +* Tue Dec 05 2023 Michael Catanzaro - 2.42.3-1 +- Update to 2.42.3 + Resolves: RHEL-3961 + +* Fri Nov 10 2023 Michael Catanzaro - 2.42.2-1 +- Update to 2.42.2 + Resolves: RHEL-3961 + +* Wed Sep 27 2023 Michael Catanzaro - 2.42.1-1 +- Update to 2.42.1 + Resolves: RHEL-3961 + +* Wed Sep 20 2023 Michael Catanzaro - 2.42.0-1 +- Upgrade to 2.42.0 + Resolves: RHEL-3961 * Tue Aug 01 2023 Michael Catanzaro - 2.40.5-1 - Upgrade to 2.40.5. Also, disable JIT diff --git a/webkitgtk-2.40.5-sw.patch b/webkitgtk-2.40.5-sw.patch deleted file mode 100644 index f827028..0000000 --- a/webkitgtk-2.40.5-sw.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 175ccbf0aa167628af0f22cbec72689a6e75e2b8 Mon Sep 17 00:00:00 2001 -From: wxiat -Date: Mon, 1 Apr 2024 11:31:04 +0800 -Subject: [PATCH] add sw arch. - -Signed-off-by: wxiat ---- - Source/WTF/wtf/dtoa/utils.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Source/WTF/wtf/dtoa/utils.h b/Source/WTF/wtf/dtoa/utils.h -index aa0786de..b7d66339 100644 ---- a/Source/WTF/wtf/dtoa/utils.h -+++ b/Source/WTF/wtf/dtoa/utils.h -@@ -87,7 +87,7 @@ int main(int argc, char** argv) { - defined(__powerpc__) || defined(__ppc__) || defined(__ppc64__) || \ - defined(_POWER) || defined(_ARCH_PPC) || defined(_ARCH_PPC64) || \ - defined(__sparc__) || defined(__sparc) || defined(__s390__) || \ -- defined(__SH4__) || defined(__alpha__) || \ -+ defined(__SH4__) || defined(__alpha__) || defined(__sw_64__)|| \ - defined(_MIPS_ARCH_MIPS32R2) || \ - defined(__AARCH64EL__) || defined(__aarch64__) || defined(__AARCH64EB__) || \ - defined(__riscv) || \ --- -2.31.1 - -- Gitee From e6338ff437e4834e5e0631515811a49a1373c772 Mon Sep 17 00:00:00 2001 From: Renbo Date: Tue, 16 Jan 2024 17:10:45 +0800 Subject: [PATCH 2/3] Exclude loongarch64 Signed-off-by: Renbo --- webkit2gtk3.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/webkit2gtk3.spec b/webkit2gtk3.spec index b1e3425..51a6f46 100644 --- a/webkit2gtk3.spec +++ b/webkit2gtk3.spec @@ -1,3 +1,4 @@ +%define anolis_release .0.1 ## NOTE: Lots of files in various subdirectories have the same name (such as ## "LICENSE") so this short macro allows us to distinguish them by using their ## directory names (from the source tree) as prefixes for the files. @@ -7,11 +8,12 @@ Name: webkit2gtk3 Version: 2.42.5 -Release: 1%{?dist} +Release: 1%{anolis_release}%{?dist} Summary: GTK Web content engine library License: LGPLv2 URL: http://www.webkitgtk.org/ +ExcludeArch: loongarch64 Source0: http://webkitgtk.org/releases/webkitgtk-%{version}.tar.xz Source1: https://webkitgtk.org/releases/webkitgtk-%{version}.tar.xz.asc # Use the keys from https://webkitgtk.org/verifying.html @@ -302,6 +304,9 @@ export NINJA_STATUS="[%f/%t][%e] " %{_datadir}/gir-1.0/JavaScriptCore-4.0.gir %changelog +* Mon May 27 2024 Bo Ren 2.42.5-1.0.1 +- Exclude loongarch64 + * Mon Feb 05 2024 Michael Catanzaro - 2.42.5-1 - Update to 2.42.5 Resolves: RHEL-3961 -- Gitee From bcb5aad24226cc61afe545aef03c76d5597ed3c6 Mon Sep 17 00:00:00 2001 From: wxiat Date: Tue, 1 Aug 2023 09:51:12 +0800 Subject: [PATCH 3/3] cherry-pick `add sw arch #ef8be098b07c4d8a9f809d32a607700f4a420676`. Signed-off-by: Weisson --- webkit2gtk3.spec | 7 +++++++ webkitgtk-2.40.5-sw.patch | 26 ++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 webkitgtk-2.40.5-sw.patch diff --git a/webkit2gtk3.spec b/webkit2gtk3.spec index 51a6f46..0b05600 100644 --- a/webkit2gtk3.spec +++ b/webkit2gtk3.spec @@ -39,11 +39,15 @@ Patch4: glib-2.56.patch # https://bugs.webkit.org/show_bug.cgi?id=268739 Patch5: i686-build.patch +Patch1001: webkitgtk-2.40.5-sw.patch + BuildRequires: bison BuildRequires: cmake BuildRequires: flex BuildRequires: gcc-c++ +%ifnarch sw_64 BuildRequires: gcc-toolset-13 +%endif BuildRequires: gettext BuildRequires: git BuildRequires: gperf @@ -207,10 +211,12 @@ rm -rf Source/ThirdParty/qunit/ %global optflags %(echo %{optflags} | sed 's/-g /-g1 /') %endif +%ifnarch sw_64 # The system GCC is too old to build WebKit, so use a GCC Toolset instead. # This prints warnings complaining that it should not be used except in # SCL scriplets, but I can't figure out any other way to make it work. source scl_source enable gcc-toolset-13 +%endif # -DUSE_SYSTEM_MALLOC=ON is really bad for security, but libpas requires # __atomic_compare_exchange_16 which does not seem to be available. @@ -306,6 +312,7 @@ export NINJA_STATUS="[%f/%t][%e] " %changelog * Mon May 27 2024 Bo Ren 2.42.5-1.0.1 - Exclude loongarch64 +- cherry-pick `add sw arch #ef8be098b07c4d8a9f809d32a607700f4a420676`. (nijie@wxiat.com) * Mon Feb 05 2024 Michael Catanzaro - 2.42.5-1 - Update to 2.42.5 diff --git a/webkitgtk-2.40.5-sw.patch b/webkitgtk-2.40.5-sw.patch new file mode 100644 index 0000000..f827028 --- /dev/null +++ b/webkitgtk-2.40.5-sw.patch @@ -0,0 +1,26 @@ +From 175ccbf0aa167628af0f22cbec72689a6e75e2b8 Mon Sep 17 00:00:00 2001 +From: wxiat +Date: Mon, 1 Apr 2024 11:31:04 +0800 +Subject: [PATCH] add sw arch. + +Signed-off-by: wxiat +--- + Source/WTF/wtf/dtoa/utils.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Source/WTF/wtf/dtoa/utils.h b/Source/WTF/wtf/dtoa/utils.h +index aa0786de..b7d66339 100644 +--- a/Source/WTF/wtf/dtoa/utils.h ++++ b/Source/WTF/wtf/dtoa/utils.h +@@ -87,7 +87,7 @@ int main(int argc, char** argv) { + defined(__powerpc__) || defined(__ppc__) || defined(__ppc64__) || \ + defined(_POWER) || defined(_ARCH_PPC) || defined(_ARCH_PPC64) || \ + defined(__sparc__) || defined(__sparc) || defined(__s390__) || \ +- defined(__SH4__) || defined(__alpha__) || \ ++ defined(__SH4__) || defined(__alpha__) || defined(__sw_64__)|| \ + defined(_MIPS_ARCH_MIPS32R2) || \ + defined(__AARCH64EL__) || defined(__aarch64__) || defined(__AARCH64EB__) || \ + defined(__riscv) || \ +-- +2.31.1 + -- Gitee