File webkit2gtk3-glib262.patch of Package webkit2gtk3
diff -urp webkitgtk-2.51.90.epoxy/Source/cmake/FindGI.cmake webkitgtk-2.51.90.glib262/Source/cmake/FindGI.cmake
--- webkitgtk-2.51.90.epoxy/Source/cmake/FindGI.cmake 2026-01-23 02:35:26.904985400 -0600
+++ webkitgtk-2.51.90.glib262/Source/cmake/FindGI.cmake 2026-01-25 18:34:30.755832880 -0600
@@ -342,7 +342,7 @@ function(GI_INTROSPECT namespace nsversi
VERBATIM
COMMAND_EXPAND_LISTS
COMMAND ${CMAKE_COMMAND} -E env "CC=${CMAKE_C_COMPILER}" "CFLAGS=${CMAKE_C_FLAGS}"
- "${GI_SCANNER_EXE}" --quiet --warn-all --warn-error --no-libtool
+ "${GI_SCANNER_EXE}" --quiet --warn-all --no-libtool
"--output=${gir_path}"
"--library=$<TARGET_FILE_BASE_NAME:${opt_TARGET}>"
"--library-path=$<TARGET_FILE_DIR:${opt_TARGET}>"
diff -urp webkitgtk-2.51.90.epoxy/Source/cmake/OptionsGTK.cmake webkitgtk-2.51.90.glib262/Source/cmake/OptionsGTK.cmake
--- webkitgtk-2.51.90.epoxy/Source/cmake/OptionsGTK.cmake 2026-01-25 15:21:09.865745508 -0600
+++ webkitgtk-2.51.90.glib262/Source/cmake/OptionsGTK.cmake 2026-01-25 18:34:53.550563412 -0600
@@ -8,7 +8,7 @@ SET_PROJECT_VERSION(2 51 90)
set(USER_AGENT_BRANDING "" CACHE STRING "Branding to add to user agent string")
# Update Source/WTF/wtf/Platform.h to match required GLib versions.
-find_package(GLib 2.70.0 REQUIRED COMPONENTS GioUnix Thread Module)
+find_package(GLib 2.62.6 REQUIRED COMPONENTS GioUnix Thread Module)
find_package(Cairo 1.16.0 REQUIRED)
find_package(LibGcrypt 1.7.0 REQUIRED)
find_package(Tasn1 REQUIRED)
diff -urp webkitgtk-2.51.90.epoxy/Source/WebCore/platform/glib/LowPowerModeNotifierGLib.cpp webkitgtk-2.51.90.glib262/Source/WebCore/platform/glib/LowPowerModeNotifierGLib.cpp
--- webkitgtk-2.51.90.epoxy/Source/WebCore/platform/glib/LowPowerModeNotifierGLib.cpp 2026-01-23 02:35:25.790121000 -0600
+++ webkitgtk-2.51.90.glib262/Source/WebCore/platform/glib/LowPowerModeNotifierGLib.cpp 2026-01-25 18:34:53.551538388 -0600
@@ -28,10 +28,13 @@ namespace WebCore {
LowPowerModeNotifier::LowPowerModeNotifier(LowPowerModeChangeCallback&& callback)
+#if GLIB_CHECK_VERSION(2, 69, 1)
: m_callback(WTF::move(callback))
, m_powerProfileMonitor(adoptGRef(g_power_profile_monitor_dup_default()))
, m_lowPowerModeEnabled(g_power_profile_monitor_get_power_saver_enabled(m_powerProfileMonitor.get()))
+#endif
{
+#if GLIB_CHECK_VERSION(2, 69, 1)
g_signal_connect_swapped(m_powerProfileMonitor.get(), "notify::power-saver-enabled", G_CALLBACK(+[] (LowPowerModeNotifier* self, GParamSpec*, GPowerProfileMonitor* monitor) {
bool powerSaverEnabled = g_power_profile_monitor_get_power_saver_enabled(monitor);
if (self->m_lowPowerModeEnabled != powerSaverEnabled) {
@@ -39,11 +42,16 @@ LowPowerModeNotifier::LowPowerModeNotifi
self->m_callback(self->m_lowPowerModeEnabled);
}
}), this);
+#else
+ UNUSED_PARAM(callback);
+#endif
}
LowPowerModeNotifier::~LowPowerModeNotifier()
{
+#if GLIB_CHECK_VERSION(2, 69, 1)
g_signal_handlers_disconnect_by_data(m_powerProfileMonitor.get(), this);
+#endif
}
bool LowPowerModeNotifier::isLowPowerModeEnabled() const
diff -urp webkitgtk-2.51.90.epoxy/Source/WebCore/platform/LowPowerModeNotifier.h webkitgtk-2.51.90.glib262/Source/WebCore/platform/LowPowerModeNotifier.h
--- webkitgtk-2.51.90.epoxy/Source/WebCore/platform/LowPowerModeNotifier.h 2026-01-23 02:35:25.727459000 -0600
+++ webkitgtk-2.51.90.glib262/Source/WebCore/platform/LowPowerModeNotifier.h 2026-01-25 18:34:53.552031852 -0600
@@ -61,8 +61,10 @@ private:
RetainPtr<WebLowPowerModeObserver> m_observer;
LowPowerModeChangeCallback m_callback;
#elif USE(GLIB)
+#if GLIB_CHECK_VERSION(2, 69, 1)
LowPowerModeChangeCallback m_callback;
GRefPtr<GPowerProfileMonitor> m_powerProfileMonitor;
+#endif
bool m_lowPowerModeEnabled { false };
#endif
};
diff -urp webkitgtk-2.51.90.epoxy/Source/WebCore/platform/network/soup/CertificateInfoSoup.cpp webkitgtk-2.51.90.glib262/Source/WebCore/platform/network/soup/CertificateInfoSoup.cpp
--- webkitgtk-2.51.90.epoxy/Source/WebCore/platform/network/soup/CertificateInfoSoup.cpp 2026-01-23 02:35:25.971680900 -0600
+++ webkitgtk-2.51.90.glib262/Source/WebCore/platform/network/soup/CertificateInfoSoup.cpp 2026-01-25 18:34:53.552554802 -0600
@@ -73,9 +73,11 @@ CertificateInfo CertificateInfo::isolate
certificatesDataList.append(certificateData.release());
}
+#if GLIB_CHECK_VERSION(2, 69, 0)
GUniqueOutPtr<char> privateKey;
GUniqueOutPtr<char> privateKeyPKCS11Uri;
g_object_get(m_certificate.get(), "private-key-pem", &privateKey.outPtr(), "private-key-pkcs11-uri", &privateKeyPKCS11Uri.outPtr(), nullptr);
+#endif
GType certificateType = g_tls_backend_get_certificate_type(g_tls_backend_get_default());
GRefPtr<GTlsCertificate> certificate;
@@ -86,8 +88,10 @@ CertificateInfo CertificateInfo::isolate
certificateType, nullptr, nullptr,
"certificate-pem", certificateData.get(),
"issuer", issuer,
+#if GLIB_CHECK_VERSION(2, 69, 0)
"private-key-pem", certificatesDataList.isEmpty() ? privateKey.get() : nullptr,
"private-key-pkcs11-uri", certificatesDataList.isEmpty() ? privateKeyPKCS11Uri.get() : nullptr,
+#endif
nullptr)));
RELEASE_ASSERT(certificate);
issuer = certificate.get();
@@ -101,6 +105,7 @@ std::optional<CertificateSummary> Certif
if (!m_certificate)
return std::nullopt;
+#if GLIB_CHECK_VERSION(2, 69, 0)
CertificateSummary summaryInfo;
GRefPtr<GDateTime> validNotBefore;
@@ -125,6 +130,9 @@ std::optional<CertificateSummary> Certif
}
return summaryInfo;
+#else
+ return std::nullopt;
+#endif
}
} // namespace WebCore
diff -urp webkitgtk-2.51.90.epoxy/Source/WebKit/Shared/glib/ArgumentCodersGLib.cpp webkitgtk-2.51.90.glib262/Source/WebKit/Shared/glib/ArgumentCodersGLib.cpp
--- webkitgtk-2.51.90.epoxy/Source/WebKit/Shared/glib/ArgumentCodersGLib.cpp 2026-01-23 02:35:26.452323700 -0600
+++ webkitgtk-2.51.90.glib262/Source/WebKit/Shared/glib/ArgumentCodersGLib.cpp 2026-01-25 18:34:53.553384243 -0600
@@ -121,11 +121,13 @@ void ArgumentCoder<GRefPtr<GTlsCertifica
encoder << certificatesData;
+#if GLIB_CHECK_VERSION(2, 69, 0)
GRefPtr<GByteArray> privateKey;
GUniqueOutPtr<char> privateKeyPKCS11Uri;
g_object_get(certificate.get(), "private-key", &privateKey.outPtr(), "private-key-pkcs11-uri", &privateKeyPKCS11Uri.outPtr(), nullptr);
encoder << privateKey;
encoder << CString(privateKeyPKCS11Uri.get());
+#endif
}
std::optional<GRefPtr<GTlsCertificate>> ArgumentCoder<GRefPtr<GTlsCertificate>>::decode(Decoder& decoder)
@@ -138,6 +140,7 @@ std::optional<GRefPtr<GTlsCertificate>>
if (!certificatesData->size())
return GRefPtr<GTlsCertificate>();
+#if GLIB_CHECK_VERSION(2, 69, 0)
std::optional<GRefPtr<GByteArray>> privateKey;
decoder >> privateKey;
if (!privateKey) [[unlikely]]
@@ -147,6 +150,7 @@ std::optional<GRefPtr<GTlsCertificate>>
decoder >> privateKeyPKCS11Uri;
if (!privateKeyPKCS11Uri) [[unlikely]]
return std::nullopt;
+#endif
GType certificateType = g_tls_backend_get_certificate_type(g_tls_backend_get_default());
GRefPtr<GTlsCertificate> certificate;
@@ -157,8 +161,10 @@ std::optional<GRefPtr<GTlsCertificate>>
certificateType, nullptr, nullptr,
"certificate", certificateData.get(),
"issuer", issuer,
+#if GLIB_CHECK_VERSION(2, 69, 0)
"private-key", i == certificatesData->size() - 1 ? privateKey->get() : nullptr,
"private-key-pkcs11-uri", i == certificatesData->size() - 1 ? privateKeyPKCS11Uri->data() : nullptr,
+#endif
nullptr)));
issuer = certificate.get();
i++;
diff -urp webkitgtk-2.51.90.epoxy/Source/WTF/wtf/glib/GRefPtr.h webkitgtk-2.51.90.glib262/Source/WTF/wtf/glib/GRefPtr.h
--- webkitgtk-2.51.90.epoxy/Source/WTF/wtf/glib/GRefPtr.h 2026-01-23 02:35:24.965636000 -0600
+++ webkitgtk-2.51.90.glib262/Source/WTF/wtf/glib/GRefPtr.h 2026-01-25 18:34:53.554152948 -0600
@@ -329,7 +329,9 @@ WTF_DEFINE_GREF_TRAITS_INLINE(GMainLoop,
WTF_DEFINE_GREF_TRAITS_INLINE(GMappedFile, g_mapped_file_ref, g_mapped_file_unref)
WTF_DEFINE_GREF_TRAITS_INLINE(GPtrArray, g_ptr_array_ref, g_ptr_array_unref)
WTF_DEFINE_GREF_TRAITS_INLINE(GSource, g_source_ref, g_source_unref)
+#if HAVE(GURI)
WTF_DEFINE_GREF_TRAITS_INLINE(GUri, g_uri_ref, g_uri_unref)
+#endif
WTF_DEFINE_GREF_TRAITS_INLINE(GVariantBuilder, g_variant_builder_ref, g_variant_builder_unref)
WTF_DEFINE_GREF_TRAITS_INLINE(GVariant, g_variant_ref_sink, g_variant_unref, g_variant_is_floating)
diff -urp webkitgtk-2.51.90.epoxy/Source/WTF/wtf/glib/URLGLib.cpp webkitgtk-2.51.90.glib262/Source/WTF/wtf/glib/URLGLib.cpp
--- webkitgtk-2.51.90.epoxy/Source/WTF/wtf/glib/URLGLib.cpp 2026-01-23 02:35:24.967469700 -0600
+++ webkitgtk-2.51.90.glib262/Source/WTF/wtf/glib/URLGLib.cpp 2026-01-25 18:34:53.554894652 -0600
@@ -35,6 +35,7 @@
namespace WTF {
+#if HAVE(GURI)
URL::URL(GUri* uri)
{
if (!uri) {
@@ -56,6 +57,7 @@ GRefPtr<GUri> URL::createGUri() const
static_cast<GUriFlags>(G_URI_FLAGS_HAS_PASSWORD | G_URI_FLAGS_ENCODED_PATH | G_URI_FLAGS_ENCODED_QUERY | G_URI_FLAGS_ENCODED_FRAGMENT | G_URI_FLAGS_SCHEME_NORMALIZE | G_URI_FLAGS_PARSE_RELAXED),
nullptr));
}
+#endif
bool URL::hostIsIPAddress(StringView host)
{
diff -urp webkitgtk-2.51.90.epoxy/Source/WTF/wtf/Platform.h webkitgtk-2.51.90.glib262/Source/WTF/wtf/Platform.h
--- webkitgtk-2.51.90.epoxy/Source/WTF/wtf/Platform.h 2026-01-24 18:59:25.863761757 -0600
+++ webkitgtk-2.51.90.glib262/Source/WTF/wtf/Platform.h 2026-01-25 18:34:53.555383337 -0600
@@ -92,7 +92,7 @@
#if USE(GLIB)
#define GLIB_VERSION_MIN_REQUIRED GLIB_VERSION_2_56
-#define GLIB_VERSION_MAX_ALLOWED GLIB_VERSION_2_70
+#define GLIB_VERSION_MAX_ALLOWED GLIB_VERSION_2_62
#endif
#if PLATFORM(GTK)
diff -urp webkitgtk-2.51.90.epoxy/Source/WTF/wtf/URL.h webkitgtk-2.51.90.glib262/Source/WTF/wtf/URL.h
--- webkitgtk-2.51.90.epoxy/Source/WTF/wtf/URL.h 2026-01-23 02:35:24.943470000 -0600
+++ webkitgtk-2.51.90.glib262/Source/WTF/wtf/URL.h 2026-01-25 18:34:53.556065980 -0600
@@ -27,7 +27,7 @@
#include <wtf/text/WTFString.h>
-#if USE(GLIB)
+#if USE(GLIB) && HAVE(GURI)
#include <wtf/glib/GRefPtr.h>
#endif
@@ -240,7 +240,7 @@ public:
WTF_EXPORT_PRIVATE static NSURL *emptyNSURL();
#endif
-#if USE(GLIB)
+#if USE(GLIB) && HAVE(GURI)
WTF_EXPORT_PRIVATE URL(GUri*);
WTF_EXPORT_PRIVATE GRefPtr<GUri> createGUri() const;
#endif