File webkit2gtk3-old-glib.patch of Package webkit2gtk3.23932
diff -urpN webkitgtk-2.36.0.icu52/Source/cmake/OptionsGTK.cmake webkitgtk-2.36.0.glib/Source/cmake/OptionsGTK.cmake
--- webkitgtk-2.36.0.icu52/Source/cmake/OptionsGTK.cmake 2022-03-28 15:11:54.570977102 -0500
+++ webkitgtk-2.36.0.glib/Source/cmake/OptionsGTK.cmake 2022-04-05 11:53:27.014803767 -0500
@@ -12,7 +12,7 @@ find_package(Cairo 1.14.0 REQUIRED)
find_package(Fontconfig 2.8.0 REQUIRED)
find_package(Freetype 2.4.2 REQUIRED)
find_package(LibGcrypt 1.6.0 REQUIRED)
-find_package(GLIB 2.56.4 REQUIRED COMPONENTS gio gio-unix gobject gthread gmodule)
+find_package(GLIB 2.44.0 REQUIRED COMPONENTS gio gio-unix gobject gthread gmodule)
find_package(HarfBuzz 0.9.18 REQUIRED COMPONENTS ICU)
find_package(ICU 52.1 REQUIRED COMPONENTS data i18n uc)
find_package(JPEG REQUIRED)
diff -urpN webkitgtk-2.36.0.icu52/Source/JavaScriptCore/PlatformGTK.cmake webkitgtk-2.36.0.glib/Source/JavaScriptCore/PlatformGTK.cmake
--- webkitgtk-2.36.0.icu52/Source/JavaScriptCore/PlatformGTK.cmake 2022-03-16 08:48:02.000000000 -0500
+++ webkitgtk-2.36.0.glib/Source/JavaScriptCore/PlatformGTK.cmake 2022-04-05 11:53:27.014803767 -0500
@@ -71,7 +71,7 @@ if (ENABLE_INTROSPECTION)
add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir
DEPENDS JavaScriptCore
- COMMAND CC=${CMAKE_C_COMPILER} CFLAGS="-Wno-deprecated-declarations ${CMAKE_C_FLAGS}" LDFLAGS=
+ COMMAND CC=${CMAKE_C_COMPILER} CFLAGS=${CMAKE_C_FLAGS} LDFLAGS=
${LOADER_LIBRARY_PATH_VAR}="${INTROSPECTION_ADDITIONAL_LIBRARY_PATH}"
${INTROSPECTION_SCANNER}
--quiet
diff -urpN webkitgtk-2.36.0.icu52/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp webkitgtk-2.36.0.glib/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
--- webkitgtk-2.36.0.icu52/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp 2022-03-28 15:09:37.022244594 -0500
+++ webkitgtk-2.36.0.glib/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp 2022-04-05 11:53:27.018803787 -0500
@@ -81,6 +81,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;
m_isBuffering = !m_didDownloadFinish;
@@ -2037,9 +2035,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.36.0.icu52/Source/WebKit/PlatformGTK.cmake webkitgtk-2.36.0.glib/Source/WebKit/PlatformGTK.cmake
--- webkitgtk-2.36.0.icu52/Source/WebKit/PlatformGTK.cmake 2022-03-28 15:08:09.585779015 -0500
+++ webkitgtk-2.36.0.glib/Source/WebKit/PlatformGTK.cmake 2022-04-05 12:37:36.564791824 -0500
@@ -685,7 +685,7 @@ if (ENABLE_INTROSPECTION)
add_custom_target(WebKit2-${WEBKITGTK_API_VERSION}-gir
DEPENDS WebKit
DEPENDS ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir
- COMMAND CC=${CMAKE_C_COMPILER} CFLAGS="-Wno-deprecated-declarations ${CMAKE_C_FLAGS}" LDFLAGS=
+ COMMAND CC=${CMAKE_C_COMPILER} CFLAGS=${CMAKE_C_FLAGS} LDFLAGS=
${LOADER_LIBRARY_PATH_VAR}="${INTROSPECTION_ADDITIONAL_LIBRARY_PATH}"
${INTROSPECTION_SCANNER}
--quiet
@@ -731,7 +731,7 @@ if (ENABLE_INTROSPECTION)
OUTPUT ${CMAKE_BINARY_DIR}/WebKit2WebExtension-${WEBKITGTK_API_VERSION}.gir
DEPENDS ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir
DEPENDS WebKit2-${WEBKITGTK_API_VERSION}-gir
- COMMAND CC=${CMAKE_C_COMPILER} CFLAGS="-Wno-deprecated-declarations ${CMAKE_C_FLAGS}"
+ COMMAND CC=${CMAKE_C_COMPILER} CFLAGS=${CMAKE_C_FLAGS}
LDFLAGS="${INTROSPECTION_ADDITIONAL_LDFLAGS}"
${LOADER_LIBRARY_PATH_VAR}="${INTROSPECTION_ADDITIONAL_LIBRARY_PATH}"
${INTROSPECTION_SCANNER}
diff -urpN webkitgtk-2.36.0.icu52/Source/WTF/wtf/glib/GLibUtilities.cpp webkitgtk-2.36.0.glib/Source/WTF/wtf/glib/GLibUtilities.cpp
--- webkitgtk-2.36.0.icu52/Source/WTF/wtf/glib/GLibUtilities.cpp 1969-12-31 18:00:00.000000000 -0600
+++ webkitgtk-2.36.0.glib/Source/WTF/wtf/glib/GLibUtilities.cpp 2022-04-05 11:53:27.018803787 -0500
@@ -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.36.0.icu52/Source/WTF/wtf/glib/GLibUtilities.h webkitgtk-2.36.0.glib/Source/WTF/wtf/glib/GLibUtilities.h
--- webkitgtk-2.36.0.icu52/Source/WTF/wtf/glib/GLibUtilities.h 1969-12-31 18:00:00.000000000 -0600
+++ webkitgtk-2.36.0.glib/Source/WTF/wtf/glib/GLibUtilities.h 2022-04-05 11:53:27.018803787 -0500
@@ -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.36.0.icu52/Source/WTF/wtf/PlatformGTK.cmake webkitgtk-2.36.0.glib/Source/WTF/wtf/PlatformGTK.cmake
--- webkitgtk-2.36.0.icu52/Source/WTF/wtf/PlatformGTK.cmake 2022-02-23 02:58:57.000000000 -0600
+++ webkitgtk-2.36.0.glib/Source/WTF/wtf/PlatformGTK.cmake 2022-04-05 11:53:27.018803787 -0500
@@ -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
@@ -32,6 +33,7 @@ list(APPEND WTF_SOURCES
glib/ChassisType.cpp
glib/FileSystemGlib.cpp
+ glib/GLibUtilities.cpp
glib/GRefPtr.cpp
glib/GSocketMonitor.cpp
glib/RunLoopGLib.cpp