File webkit2gtk3-old-glib.patch of Package webkit2gtk3.29343

diff -urpN webkitgtk-2.39.90.gstreamer/Source/cmake/OptionsGTK.cmake webkitgtk-2.39.90.glib/Source/cmake/OptionsGTK.cmake
--- webkitgtk-2.39.90.gstreamer/Source/cmake/OptionsGTK.cmake	2023-02-20 03:36:08.297193300 -0600
+++ webkitgtk-2.39.90.glib/Source/cmake/OptionsGTK.cmake	2023-02-22 10:25:38.742240345 -0600
@@ -238,7 +238,7 @@ endif ()
 if (ENABLE_2022_GLIB_API)
     set(GLIB_MINIMUM_VERSION 2.70.0)
 else ()
-    set(GLIB_MINIMUM_VERSION 2.56.4)
+    set(GLIB_MINIMUM_VERSION 2.54.3)
 endif ()
 find_package(GLIB ${GLIB_MINIMUM_VERSION} REQUIRED COMPONENTS gio gio-unix gobject gthread gmodule)
 
diff -urpN webkitgtk-2.39.90.gstreamer/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp webkitgtk-2.39.90.glib/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
--- webkitgtk-2.39.90.gstreamer/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2023-02-22 10:23:33.555958712 -0600
+++ webkitgtk-2.39.90.glib/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2023-02-22 10:24:04.920530360 -0600
@@ -82,6 +82,7 @@
 #include <gst/video/gstvideometa.h>
 #include <limits>
 #include <wtf/FileSystem.h>
+#include <wtf/glib/GLibUtilities.h>
 #include <wtf/glib/GUniquePtr.h>
 #include <wtf/glib/RunLoopSourcePriority.h>
 #include <wtf/MathExtras.h>
@@ -2007,10 +2008,7 @@ void MediaPlayerPrivateGStreamer::update
 {
     bool wasBuffering = m_isBuffering;
 
-#ifndef GST_DISABLE_GST_DEBUG
-    GUniquePtr<char> modeString(g_enum_to_string(GST_TYPE_BUFFERING_MODE, mode));
-    GST_DEBUG_OBJECT(pipeline(), "[Buffering] mode: %s, status: %f%%", modeString.get(), percentage);
-#endif
+    GST_DEBUG_OBJECT(pipeline(), "[Buffering] mode: %s, status: %f%%", enumToString(GST_TYPE_BUFFERING_MODE, mode).data(), percentage);
 
     m_didDownloadFinish = percentage == 100;
 
@@ -2036,9 +2034,7 @@ void MediaPlayerPrivateGStreamer::update
         break;
     }
     default:
-#ifndef GST_DISABLE_GST_DEBUG
-        GST_DEBUG_OBJECT(pipeline(), "Unhandled buffering mode: %s", modeString.get());
-#endif
+        GST_DEBUG_OBJECT(pipeline(), "Unhandled buffering mode: %s", enumToString(GST_TYPE_BUFFERING_MODE, mode).data());
         break;
     }
 }
diff -urpN webkitgtk-2.39.90.gstreamer/Source/WTF/wtf/glib/GLibUtilities.cpp webkitgtk-2.39.90.glib/Source/WTF/wtf/glib/GLibUtilities.cpp
--- webkitgtk-2.39.90.gstreamer/Source/WTF/wtf/glib/GLibUtilities.cpp	1969-12-31 18:00:00.000000000 -0600
+++ webkitgtk-2.39.90.glib/Source/WTF/wtf/glib/GLibUtilities.cpp	2023-02-22 10:24:04.920530360 -0600
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2010 Igalia, S.L.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Library General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Library General Public License
+ *  along with this library; see the file COPYING.LIB.  If not, write to
+ *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include <wtf/glib/GLibUtilities.h>
+
+#include <glib.h>
+#include <wtf/glib/GUniquePtr.h>
+
+#if OS(WINDOWS)
+#include <windows.h>
+#include <wtf/text/WTFString.h>
+#else
+#include <limits.h>
+#include <unistd.h>
+#endif
+
+CString enumToString(GType type, guint value)
+{
+#if GLIB_CHECK_VERSION(2, 54, 0)
+    GUniquePtr<char> result(g_enum_to_string(type, value));
+    return result.get();
+#else
+    GEnumClass* enumClass = reinterpret_cast<GEnumClass*>(g_type_class_ref(type));
+    GEnumValue* enumValue = g_enum_get_value(enumClass, value);
+    char* representation = enumValue ? g_strdup(enumValue->value_nick) : nullptr;
+    g_type_class_unref(enumClass);
+    GUniquePtr<char> result(representation);
+    return result.get();
+#endif
+}
diff -urpN webkitgtk-2.39.90.gstreamer/Source/WTF/wtf/glib/GLibUtilities.h webkitgtk-2.39.90.glib/Source/WTF/wtf/glib/GLibUtilities.h
--- webkitgtk-2.39.90.gstreamer/Source/WTF/wtf/glib/GLibUtilities.h	1969-12-31 18:00:00.000000000 -0600
+++ webkitgtk-2.39.90.glib/Source/WTF/wtf/glib/GLibUtilities.h	2023-02-22 10:24:04.920530360 -0600
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2010 Igalia, S.L.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Library General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Library General Public License
+ *  along with this library; see the file COPYING.LIB.  If not, write to
+ *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
+ */
+
+#ifndef GLibUtilities_h
+#define GLibUtilities_h
+
+#include <glib-object.h>
+#include <wtf/Assertions.h>
+#include <wtf/text/CString.h>
+
+WTF_EXPORT_PRIVATE CString enumToString(GType, guint value);
+
+// These might be added to glib in the future, but in the meantime they're defined here.
+#ifndef GULONG_TO_POINTER
+#define GULONG_TO_POINTER(ul) ((gpointer) (gulong) (ul))
+#endif
+
+#ifndef GPOINTER_TO_ULONG
+#define GPOINTER_TO_ULONG(p) ((gulong) (p))
+#endif
+
+#endif
diff -urpN webkitgtk-2.39.90.gstreamer/Source/WTF/wtf/PlatformGTK.cmake webkitgtk-2.39.90.glib/Source/WTF/wtf/PlatformGTK.cmake
--- webkitgtk-2.39.90.gstreamer/Source/WTF/wtf/PlatformGTK.cmake	2023-02-20 03:22:13.877723700 -0600
+++ webkitgtk-2.39.90.glib/Source/WTF/wtf/PlatformGTK.cmake	2023-02-22 10:24:04.924530433 -0600
@@ -2,6 +2,7 @@ set(WTF_OUTPUT_NAME WTFGTK)
 
 list(APPEND WTF_PUBLIC_HEADERS
     glib/ChassisType.h
+    glib/GLibUtilities.h
     glib/GMutexLocker.h
     glib/GRefPtr.h
     glib/GSocketMonitor.h
@@ -36,6 +37,7 @@ list(APPEND WTF_SOURCES
 
     glib/ChassisType.cpp
     glib/FileSystemGlib.cpp
+    glib/GLibUtilities.cpp
     glib/GRefPtr.cpp
     glib/GSocketMonitor.cpp
     glib/RunLoopGLib.cpp
openSUSE Build Service is sponsored by