[packages/gtk+2] fix build with gcc 14

atler atler at pld-linux.org
Sat Jul 27 16:08:36 CEST 2024


commit 8ff7f7960cc7692e3003a410e59e576125ff9cb9
Author: Jan Palus <atler at pld-linux.org>
Date:   Sat Jul 27 15:28:34 2024 +0200

    fix build with gcc 14

 gcc14.patch | 209 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 gtk+2.spec  |   2 +
 2 files changed, 211 insertions(+)
---
diff --git a/gtk+2.spec b/gtk+2.spec
index 25b250d..73476fc 100644
--- a/gtk+2.spec
+++ b/gtk+2.spec
@@ -23,6 +23,7 @@ Source0:	https://download.gnome.org/sources/gtk+/2.24/gtk+-%{version}.tar.xz
 # Source0-md5:	0118e98dbe0e4dab90ce475f9f0e6c0c
 Patch0:		%{name}-arch_confdir.patch
 Patch1:		%{name}-papi.patch
+Patch2:		gcc14.patch
 URL:		https://www.gtk.org/
 BuildRequires:	atk-devel >= 1:1.30.0-3
 BuildRequires:	autoconf >= 2.62
@@ -246,6 +247,7 @@ Moduł GTK+ do drukowania przez PAPI.
 %setup -q -n gtk+-%{version}
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 
 %{__sed} -i -e '1s,/usr/bin/env python,%{__python3},' gtk/gtk-builder-convert
 
diff --git a/gcc14.patch b/gcc14.patch
new file mode 100644
index 0000000..cb1f92e
--- /dev/null
+++ b/gcc14.patch
@@ -0,0 +1,209 @@
+diff --color -ur gtk+-2.24.33.orig/gtk/gtkcellrendererspin.c gtk+-2.24.33/gtk/gtkcellrendererspin.c
+--- gtk+-2.24.33.orig/gtk/gtkcellrendererspin.c	2020-12-18 06:29:40.000000000 +0100
++++ gtk+-2.24.33/gtk/gtkcellrendererspin.c	2024-07-26 22:29:34.909453878 +0200
+@@ -207,7 +207,7 @@
+ 	}
+ 
+       if (obj)
+-	priv->adjustment = g_object_ref_sink (obj);
++	priv->adjustment = GTK_ADJUSTMENT(g_object_ref_sink (obj));
+       break;
+     case PROP_CLIMB_RATE:
+       priv->climb_rate = g_value_get_double (value);
+diff --color -ur gtk+-2.24.33.orig/gtk/gtkcomboboxtext.c gtk+-2.24.33/gtk/gtkcomboboxtext.c
+--- gtk+-2.24.33.orig/gtk/gtkcomboboxtext.c	2020-12-18 06:29:40.000000000 +0100
++++ gtk+-2.24.33/gtk/gtkcomboboxtext.c	2024-07-26 22:31:11.963300930 +0200
+@@ -275,7 +275,7 @@
+ 
+       parser_data = g_slice_new0 (ItemParserData);
+       parser_data->builder = g_object_ref (builder);
+-      parser_data->object = g_object_ref (buildable);
++      parser_data->object = G_OBJECT(g_object_ref (buildable));
+       parser_data->domain = gtk_builder_get_translation_domain (builder);
+       *parser = item_parser;
+       *data = parser_data;
+diff --color -ur gtk+-2.24.33.orig/gtk/gtkimmodule.c gtk+-2.24.33/gtk/gtkimmodule.c
+--- gtk+-2.24.33.orig/gtk/gtkimmodule.c	2020-12-18 06:29:40.000000000 +0100
++++ gtk+-2.24.33/gtk/gtkimmodule.c	2024-07-26 22:35:04.303562847 +0200
+@@ -662,7 +662,7 @@
+ 	  gboolean found;
+ 	  gchar *context_id;
+ 	  found = g_hash_table_lookup_extended (contexts_hash, *immodules_list,
+-						&context_id, NULL);
++						(gpointer *) &context_id, NULL);
+ 	  if (found)
+ 	    return context_id;
+ 	}
+diff --color -ur gtk+-2.24.33.orig/gtk/gtklabel.c gtk+-2.24.33/gtk/gtklabel.c
+--- gtk+-2.24.33.orig/gtk/gtklabel.c	2020-12-18 06:29:40.000000000 +0100
++++ gtk+-2.24.33/gtk/gtklabel.c	2024-07-26 22:36:39.491101561 +0200
+@@ -1336,7 +1336,7 @@
+ 
+       parser_data = g_slice_new0 (PangoParserData);
+       parser_data->builder = g_object_ref (builder);
+-      parser_data->object = g_object_ref (buildable);
++      parser_data->object = G_OBJECT(g_object_ref (buildable));
+       *parser = pango_parser;
+       *data = parser_data;
+       return TRUE;
+diff --color -ur gtk+-2.24.33.orig/gtk/gtkscale.c gtk+-2.24.33/gtk/gtkscale.c
+--- gtk+-2.24.33.orig/gtk/gtkscale.c	2020-12-18 06:29:40.000000000 +0100
++++ gtk+-2.24.33/gtk/gtkscale.c	2024-07-26 22:47:14.633908404 +0200
+@@ -1471,7 +1471,7 @@
+   mark->position = position;
+  
+   priv->marks = g_slist_insert_sorted_with_data (priv->marks, mark,
+-                                                 (GCompareFunc) compare_marks,
++                                                 (GCompareDataFunc) compare_marks,
+                                                  GINT_TO_POINTER (
+                                                    gtk_range_get_inverted (GTK_RANGE (scale)) 
+                                                    ));
+diff --color -ur gtk+-2.24.33.orig/gtk/gtktoolpalette.c gtk+-2.24.33/gtk/gtktoolpalette.c
+--- gtk+-2.24.33.orig/gtk/gtktoolpalette.c	2020-12-18 06:29:40.000000000 +0100
++++ gtk+-2.24.33/gtk/gtktoolpalette.c	2024-07-26 22:52:00.935926505 +0200
+@@ -734,7 +734,7 @@
+ 
+   g_ptr_array_add (palette->priv->groups, info);
+   info->pos = palette->priv->groups->len - 1;
+-  info->widget = g_object_ref_sink (child);
++  info->widget = GTK_TOOL_ITEM_GROUP(g_object_ref_sink (child));
+ 
+   gtk_widget_set_parent (child, GTK_WIDGET (palette));
+ }
+diff --color -ur gtk+-2.24.33.orig/gtk/gtktreeview.c gtk+-2.24.33/gtk/gtktreeview.c
+--- gtk+-2.24.33.orig/gtk/gtktreeview.c	2020-12-18 06:29:40.000000000 +0100
++++ gtk+-2.24.33/gtk/gtktreeview.c	2024-07-26 22:54:24.005245712 +0200
+@@ -14147,7 +14147,7 @@
+ 
+   if (entry)
+     {
+-      tree_view->priv->search_entry = g_object_ref (entry);
++      tree_view->priv->search_entry = GTK_WIDGET(g_object_ref (entry));
+       tree_view->priv->search_custom_entry_set = TRUE;
+ 
+       if (tree_view->priv->search_entry_changed_id == 0)
+diff --color -ur gtk+-2.24.33.orig/gtk/gtkuimanager.c gtk+-2.24.33/gtk/gtkuimanager.c
+--- gtk+-2.24.33.orig/gtk/gtkuimanager.c	2020-12-18 06:29:40.000000000 +0100
++++ gtk+-2.24.33/gtk/gtkuimanager.c	2024-07-26 22:56:07.019014753 +0200
+@@ -503,7 +503,7 @@
+   g_signal_connect (widget, "hierarchy-changed",
+ 		    G_CALLBACK (child_hierarchy_changed_cb),
+ 		    GTK_UI_MANAGER (buildable));
+-  return g_object_ref (widget);
++  return G_OBJECT(g_object_ref (widget));
+ }
+ 
+ static void
+diff --color -ur gtk+-2.24.33.orig/gtk/gtkwidget.c gtk+-2.24.33/gtk/gtkwidget.c
+--- gtk+-2.24.33.orig/gtk/gtkwidget.c	2020-12-18 06:29:40.000000000 +0100
++++ gtk+-2.24.33/gtk/gtkwidget.c	2024-07-26 22:58:00.209158608 +0200
+@@ -10679,7 +10679,7 @@
+       AccelGroupParserData *parser_data;
+ 
+       parser_data = g_slice_new0 (AccelGroupParserData);
+-      parser_data->object = g_object_ref (buildable);
++      parser_data->object = G_OBJECT(g_object_ref (buildable));
+       *parser = accel_group_parser;
+       *data = parser_data;
+       return TRUE;
+diff --color -ur gtk+-2.24.33.orig/gtk/tests/defaultvalue.c gtk+-2.24.33/gtk/tests/defaultvalue.c
+--- gtk+-2.24.33.orig/gtk/tests/defaultvalue.c	2020-12-18 06:29:40.000000000 +0100
++++ gtk+-2.24.33/gtk/tests/defaultvalue.c	2024-07-27 01:20:41.770337977 +0200
+@@ -91,13 +91,13 @@
+   klass = g_type_class_ref (type);
+   
+   if (g_type_is_a (type, GTK_TYPE_SETTINGS))
+-    instance = g_object_ref (gtk_settings_get_default ());
++    instance = G_OBJECT(g_object_ref (gtk_settings_get_default ()));
+   else if (g_type_is_a (type, GDK_TYPE_PANGO_RENDERER))
+-    instance = g_object_ref (gdk_pango_renderer_get_default (gdk_screen_get_default ()));
++    instance = G_OBJECT(g_object_ref (gdk_pango_renderer_get_default (gdk_screen_get_default ())));
+   else if (g_type_is_a (type, GDK_TYPE_PIXMAP))
+-    instance = g_object_ref (gdk_pixmap_new (NULL, 1, 1, 1));
++    instance = G_OBJECT(g_object_ref (gdk_pixmap_new (NULL, 1, 1, 1)));
+   else if (g_type_is_a (type, GDK_TYPE_COLORMAP))
+-    instance = g_object_ref (gdk_colormap_new (gdk_visual_get_best (), TRUE));
++    instance = G_OBJECT(g_object_ref (gdk_colormap_new (gdk_visual_get_best (), TRUE)));
+   else if (g_type_is_a (type, GDK_TYPE_WINDOW))
+     {
+       GdkWindowAttr attributes;
+@@ -105,7 +105,7 @@
+       attributes.event_mask = 0;
+       attributes.width = 100;
+       attributes.height = 100;
+-      instance = g_object_ref (gdk_window_new (NULL, &attributes, 0));
++      instance = G_OBJECT(g_object_ref (gdk_window_new (NULL, &attributes, 0)));
+     }
+   else
+     instance = g_object_new (type, NULL);
+diff --color -ur gtk+-2.24.33.orig/modules/other/gail/gailtreeview.c gtk+-2.24.33/modules/other/gail/gailtreeview.c
+--- gtk+-2.24.33.orig/modules/other/gail/gailtreeview.c	2020-12-18 06:50:58.000000000 +0100
++++ gtk+-2.24.33/modules/other/gail/gailtreeview.c	2024-07-27 01:23:34.878665670 +0200
+@@ -995,7 +995,7 @@
+         gail_cell_add_state (cell, ATK_STATE_FOCUSABLE, FALSE);
+         if (focus_index == i)
+           {
+-            gailview->focus_cell = g_object_ref (cell);
++            gailview->focus_cell = ATK_OBJECT(g_object_ref (cell));
+             gail_cell_add_state (cell, ATK_STATE_FOCUSED, FALSE);
+             g_signal_emit_by_name (gailview,
+                                    "active-descendant-changed",
+diff --color -ur gtk+-2.24.33.orig/modules/printbackends/cups/gtkprintbackendcups.c gtk+-2.24.33/modules/printbackends/cups/gtkprintbackendcups.c
+--- gtk+-2.24.33.orig/modules/printbackends/cups/gtkprintbackendcups.c	2020-12-18 06:29:40.000000000 +0100
++++ gtk+-2.24.33/modules/printbackends/cups/gtkprintbackendcups.c	2024-07-27 01:26:00.761009100 +0200
+@@ -3479,7 +3479,7 @@
+   g_io_channel_set_encoding (data->ppd_io, NULL, NULL);
+   g_io_channel_set_close_on_unref (data->ppd_io, TRUE);
+ 
+-  data->printer = g_object_ref (printer);
++  data->printer = GTK_PRINTER_CUPS(g_object_ref (printer));
+ 
+   resource = g_strdup_printf ("/printers/%s.ppd", 
+                               gtk_printer_cups_get_ppd_name (GTK_PRINTER_CUPS (printer)));
+diff --color -ur gtk+-2.24.33.orig/tests/testentrycompletion.c gtk+-2.24.33/tests/testentrycompletion.c
+--- gtk+-2.24.33.orig/tests/testentrycompletion.c	2020-12-18 06:29:42.000000000 +0100
++++ gtk+-2.24.33/tests/testentrycompletion.c	2024-07-27 01:28:12.363762836 +0200
+@@ -237,7 +237,7 @@
+ 	{
+ 	  g_print ("removing model!\n");
+ 
+-	  old_store = g_object_ref (gtk_entry_completion_get_model (completion));
++	  old_store = GTK_LIST_STORE(g_object_ref (gtk_entry_completion_get_model (completion)));
+ 	  gtk_entry_completion_set_model (completion, NULL);
+ 	}
+       else
+diff --color -ur gtk+-2.24.33.orig/tests/testmenubars.c gtk+-2.24.33/tests/testmenubars.c
+--- gtk+-2.24.33.orig/tests/testmenubars.c	2020-12-18 06:29:42.000000000 +0100
++++ gtk+-2.24.33/tests/testmenubars.c	2024-07-27 01:33:17.108105649 +0200
+@@ -21,7 +21,7 @@
+ #include <gtk/gtk.h>
+ 
+ static GtkWidget *
+-create_menu (depth)
++create_menu (int depth)
+ {
+     GtkWidget *menu;
+     GtkWidget *menuitem;
+@@ -70,19 +70,19 @@
+   menuitem = gtk_image_menu_item_new_from_stock (GTK_STOCK_HOME, NULL);
+   gtk_menu_shell_append (GTK_MENU_SHELL (menubar), menuitem);
+   gtk_label_set_angle (GTK_LABEL (GTK_BIN (menuitem)->child), angle);
+-  menu = create_menu (2, TRUE);
++  menu = create_menu (2);
+   gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), menu);
+ 
+   menuitem = gtk_menu_item_new_with_label ("foo");
+   gtk_menu_shell_append (GTK_MENU_SHELL (menubar), menuitem);
+   gtk_label_set_angle (GTK_LABEL (GTK_BIN (menuitem)->child), angle);
+-  menu = create_menu (2, TRUE);
++  menu = create_menu (2);
+   gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), menu);
+ 
+   menuitem = gtk_menu_item_new_with_label ("bar");
+   gtk_menu_shell_append (GTK_MENU_SHELL (menubar), menuitem);
+   gtk_label_set_angle (GTK_LABEL (GTK_BIN (menuitem)->child), angle);
+-  menu = create_menu (2, TRUE);
++  menu = create_menu (2);
+   gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), menu);
+ 
+   return menubar;
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/gtk+2.git/commitdiff/8ff7f7960cc7692e3003a410e59e576125ff9cb9



More information about the pld-cvs-commit mailing list