diff mbox series

[meta-gnome] ibus: fix build with GCC 15

Message ID 20250511214858.3693814-1-yoann.congal@smile.fr
State Under Review
Headers show
Series [meta-gnome] ibus: fix build with GCC 15 | expand

Commit Message

Yoann Congal May 11, 2025, 9:48 p.m. UTC
From: Yoann Congal <yoann.congal@smile.fr>

Backport 2 patchs from upstream to fix build with GCC 15.

Fixes:
| ibusenginesimple.c: In function 'check_emoji_table':
| ibusenginesimple.c:523:41: error: too many arguments to function 'load_emoji_dict'; expected 0, have 1
|   523 |         emoji_dict = priv->emoji_dict = load_emoji_dict (simple);
|       |                                         ^~~~~~~~~~~~~~~  ~~~~~~
| ibusenginesimple.c:480:1: note: declared here
|   480 | load_emoji_dict ()
|       | ^~~~~~~~~~~~~~~
| make[4]: *** [Makefile:1012: ibusenginesimple.lo] Error 1

and:
| i18nMethod.c:84:28: error: initialization of 'int (*)(void)' from incompatible pointer type 'int (*)(struct _Xi18nCore *, TransportSW *, char *)' [-Wincompatible-pointer-types]
|    84 |     {"X",               1, _Xi18nCheckXAddress},
|       |                            ^~~~~~~~~~~~~~~~~~~
| i18nMethod.c:84:28: note: (near initialization for '_TransR[0].checkAddr')
| i18nMethod.c:79:13: note: '_Xi18nCheckXAddress' declared here
|    79 | extern Bool _Xi18nCheckXAddress (Xi18n, TransportSW *, char *);
|       |             ^~~~~~~~~~~~~~~~~~~
| i18nMethod.c: In function 'CheckIMName':
| i18nMethod.c:498:17: error: too many arguments to function '_TransR[i].checkAddr'; expected 0, have 3
|   498 |             if (_TransR[i].checkAddr (i18n_core,
|       |                 ^~~~~~~               ~~~~~~~~~
| In file included from i18nMethod.c:41:
| Xi18n.h:78:19: note: declared here
|    78 |     Bool        (*checkAddr) ();
|       |                   ^~~~~~~~~

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
---
 meta-gnome/recipes-support/ibus/ibus.inc      |   2 +
 ...c-Fix-declaration-errors-with-GCC-15.patch |  36 ++++++
 ...incompatible-pointer-types-in-Transp.patch | 109 ++++++++++++++++++
 3 files changed, 147 insertions(+)
 create mode 100644 meta-gnome/recipes-support/ibus/ibus/0001-src-Fix-declaration-errors-with-GCC-15.patch
 create mode 100644 meta-gnome/recipes-support/ibus/ibus/0002-util-IMdkit-Fix-incompatible-pointer-types-in-Transp.patch
diff mbox series

Patch

diff --git a/meta-gnome/recipes-support/ibus/ibus.inc b/meta-gnome/recipes-support/ibus/ibus.inc
index 9d0600c794..9dce2ce4f3 100644
--- a/meta-gnome/recipes-support/ibus/ibus.inc
+++ b/meta-gnome/recipes-support/ibus/ibus.inc
@@ -13,6 +13,8 @@  SRC_URI = " \
     git://github.com/ibus/ibus.git;branch=main;protocol=https \
     file://0001-Do-not-try-to-start-dbus-we-do-not-have-dbus-lauch.patch \
     file://0001-makefile-don-t-gzip-the-man-pages.patch \
+    file://0002-util-IMdkit-Fix-incompatible-pointer-types-in-Transp.patch \
+    file://0001-src-Fix-declaration-errors-with-GCC-15.patch \
 "
 SRCREV = "6a70ab0338206bd1c7d01a4e1874ea0ee5b3a9d3"
 S = "${WORKDIR}/git"
diff --git a/meta-gnome/recipes-support/ibus/ibus/0001-src-Fix-declaration-errors-with-GCC-15.patch b/meta-gnome/recipes-support/ibus/ibus/0001-src-Fix-declaration-errors-with-GCC-15.patch
new file mode 100644
index 0000000000..150ff631ba
--- /dev/null
+++ b/meta-gnome/recipes-support/ibus/ibus/0001-src-Fix-declaration-errors-with-GCC-15.patch
@@ -0,0 +1,36 @@ 
+From 0f5407f8a3846477fcaa73505437e805467901e1 Mon Sep 17 00:00:00 2001
+From: fujiwarat <takao.fujiwara1@gmail.com>
+Date: Fri, 24 Jan 2025 09:40:31 +0900
+Subject: [PATCH] src: Fix declaration errors with GCC 15
+
+
+BUG=rhbz#2340629
+
+Upstream-Status: Backport [https://github.com/ibus/ibus/commit/aac5446e8c98db934912b9b15a1ef92c3b7e4c8c]
+Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
+---
+ src/ibusenginesimple.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/ibusenginesimple.c b/src/ibusenginesimple.c
+index c57a3ea5..60e7fb34 100644
+--- a/src/ibusenginesimple.c
++++ b/src/ibusenginesimple.c
+@@ -477,7 +477,7 @@ check_hex (IBusEngineSimple *simple,
+ }
+ 
+ static IBusEngineDict *
+-load_emoji_dict ()
++load_emoji_dict (void)
+ {
+     IBusEngineDict *emoji_dict;
+     GList *keys;
+@@ -520,7 +520,7 @@ check_emoji_table (IBusEngineSimple       *simple,
+         g_object_ref_sink (priv->lookup_table);
+     }
+     if (emoji_dict == NULL)
+-        emoji_dict = priv->emoji_dict = load_emoji_dict (simple);
++        emoji_dict = priv->emoji_dict = load_emoji_dict ();
+ 
+     if (emoji_dict == NULL || emoji_dict->dict == NULL)
+         return FALSE;
diff --git a/meta-gnome/recipes-support/ibus/ibus/0002-util-IMdkit-Fix-incompatible-pointer-types-in-Transp.patch b/meta-gnome/recipes-support/ibus/ibus/0002-util-IMdkit-Fix-incompatible-pointer-types-in-Transp.patch
new file mode 100644
index 0000000000..229a9d34aa
--- /dev/null
+++ b/meta-gnome/recipes-support/ibus/ibus/0002-util-IMdkit-Fix-incompatible-pointer-types-in-Transp.patch
@@ -0,0 +1,109 @@ 
+From b0a554d7c9d4d52bd34a85fe66a85adf9542a2ec Mon Sep 17 00:00:00 2001
+From: fujiwarat <takao.fujiwara1@gmail.com>
+Date: Fri, 24 Jan 2025 10:01:11 +0900
+Subject: [PATCH] util/IMdkit: Fix incompatible-pointer-types in
+ TransportSW.checkAddr
+
+
+BUG=rhbz#2340629
+
+Upstream-Status: Backport [https://github.com/ibus/ibus/commit/d039b95b1af14fd34167a4ca038938cef2ea41ca]
+Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
+---
+ util/IMdkit/Xi18n.h           | 18 ++++++++++--------
+ util/IMdkit/i18nMethod.c      |  3 ++-
+ util/IMdkit/i18nOffsetCache.c | 10 ++++++----
+ 3 files changed, 18 insertions(+), 13 deletions(-)
+
+diff --git a/util/IMdkit/Xi18n.h b/util/IMdkit/Xi18n.h
+index 79dd9619..09097bb6 100644
+--- a/util/IMdkit/Xi18n.h
++++ b/util/IMdkit/Xi18n.h
+@@ -3,7 +3,7 @@
+          Copyright (C) 1994-1995 Sun Microsystems, Inc.
+          Copyright (C) 1993-1994 Hewlett-Packard Company
+          Copyright (C) 2014 Peng Huang <shawn.p.huang@gmail.com>
+-         Copyright (C) 2014 Red Hat, Inc.
++         Copyright (C) 2014-2025 Red Hat, Inc.
+  
+ Permission to use, copy, modify, distribute, and sell this software
+ and its documentation for any purpose is hereby granted without fee,
+@@ -71,13 +71,6 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ #define I18N_SET	1
+ #define I18N_GET	2
+ 
+-typedef struct
+-{
+-    char        *transportname;
+-    int         namelen;
+-    Bool        (*checkAddr) ();
+-} TransportSW;
+-
+ typedef struct _XIMPending
+ {
+     unsigned    char *p;
+@@ -172,6 +165,15 @@ typedef struct _Xi18nClient
+ 
+ typedef struct _Xi18nCore *Xi18n;
+ 
++typedef struct _TransportSW TransportSW;
++
++struct _TransportSW
++{
++    char        *transportname;
++    int         namelen;
++    Bool        (*checkAddr) (Xi18n, TransportSW *, char *);
++};
++
+ /*
+  * Callback Struct for XIM Protocol
+  */
+diff --git a/util/IMdkit/i18nMethod.c b/util/IMdkit/i18nMethod.c
+index 9c44e7fe..7f343d87 100644
+--- a/util/IMdkit/i18nMethod.c
++++ b/util/IMdkit/i18nMethod.c
+@@ -2,6 +2,7 @@
+  
+          Copyright 1994, 1995 by Sun Microsystems, Inc.
+          Copyright 1993, 1994 by Hewlett-Packard Company
++         Copyright (C) 2014-2025 Red Hat, Inc.
+  
+ Permission to use, copy, modify, distribute, and sell this software
+ and its documentation for any purpose is hereby granted without fee,
+@@ -89,7 +90,7 @@ TransportSW _TransR[] =
+ #ifdef DNETCONN
+     {"decnet",          6, _Xi18nCheckTransAddress},
+ #endif
+-    {(char *) NULL,     0, (Bool (*) ()) NULL}
++    {(char *) NULL,     0, (Bool (*) (Xi18n, TransportSW *, char *))NULL}
+ };
+ 
+ static Bool GetInputStyles (Xi18n i18n_core, XIMStyles **p_style)
+diff --git a/util/IMdkit/i18nOffsetCache.c b/util/IMdkit/i18nOffsetCache.c
+index e2fe8c6b..cab974c7 100644
+--- a/util/IMdkit/i18nOffsetCache.c
++++ b/util/IMdkit/i18nOffsetCache.c
+@@ -1,6 +1,6 @@
+ /*
+  * Copyright (C) 2014 Peng Huang <shawn.p.huang@gmail.com>
+- * Copyright (C) 2014 Red Hat, Inc.
++ * Copyright (C) 2014-2025 Red Hat, Inc.
+  *
+  * Permission to use, copy, modify, distribute, and sell this
+  * software and its documentation for any purpose is hereby granted
+@@ -83,10 +83,12 @@ void _Xi18nSetPropertyOffset (Xi18nOffsetCache *offset_cache, Atom key,
+     }
+ 
+     if (++offset_cache->size > offset_cache->capacity) {
+-        offset_cache->capacity *= OFFSET_CACHE_GROWTH_FACTOR;
+-        offset_cache->data = (Xi18nAtomOffsetPair *) realloc (data,
++        Xi18nAtomOffsetPair *pair = (Xi18nAtomOffsetPair *) realloc (data,
+                 offset_cache->capacity * sizeof (Xi18nAtomOffsetPair));
+-        if (offset_cache->data == NULL) {
++        offset_cache->capacity *= OFFSET_CACHE_GROWTH_FACTOR;
++        if (pair) {
++            offset_cache->data = pair;
++        } else {
+             offset_cache->data = data;
+             --offset_cache->size;
+         }