commit:     b1631392ca489e12652ed5682f2b79205b976c56
Author:     Eli Schwartz <eschwartz <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 10 01:45:41 2024 +0000
Commit:     Eli Schwartz <eschwartz <AT> gentoo <DOT> org>
CommitDate: Wed Jul 10 15:23:57 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b1631392

x11-libs/libgxim: backport gcc 14 fix for implicit-function-decl

Upstream has fixed this in 2018 but simply not released a new version:
https://bitbucket.org/tagoh/libgxim/commits/274976ff39d9142169a18655f5013e66233ac9c8

Due to the implicit function declaration, compilation fails on gcc 14.
On gcc 13, instead, there is an lto-type-mismatch because the K&R C
style incorrect prototype was... incorrect and mismatched the required
types. :)

The same upstream commit also includes an unrelated fix for a different
build issue: -Werror=format-security.

Closes: https://bugs.gentoo.org/875056
Closes: https://bugs.gentoo.org/928090
Signed-off-by: Eli Schwartz <eschwartz <AT> gentoo.org>

 x11-libs/libgxim/files/libgxim-0.5.0-gcc14.patch   | 40 ++++++++++++++++++++++
 ...ibgxim-0.5.0.ebuild => libgxim-0.5.0-r1.ebuild} |  6 ++++
 2 files changed, 46 insertions(+)

diff --git a/x11-libs/libgxim/files/libgxim-0.5.0-gcc14.patch 
b/x11-libs/libgxim/files/libgxim-0.5.0-gcc14.patch
new file mode 100644
index 000000000000..36e62471d591
--- /dev/null
+++ b/x11-libs/libgxim/files/libgxim-0.5.0-gcc14.patch
@@ -0,0 +1,40 @@
+From 274976ff39d9142169a18655f5013e66233ac9c8 Mon Sep 17 00:00:00 2001
+From: Akira TAGOH <ak...@tagoh.org>
+Date: Wed, 14 Feb 2018 13:20:40 +0900
+Subject: [PATCH] Fix a build fail
+
+---
+ libgxim/gximcore.c       | 2 --
+ libgxim/gximprotocol10.c | 2 +-
+ 2 files changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/libgxim/gximcore.c b/libgxim/gximcore.c
+index a92c413..3955d01 100644
+--- a/libgxim/gximcore.c
++++ b/libgxim/gximcore.c
+@@ -26,9 +26,7 @@
+ #endif
+ 
+ #include <glib/gi18n-lib.h>
+-#ifdef GNOME_ENABLE_DEBUG
+ #include <gdk/gdkx.h>
+-#endif /* GNOME_ENABLE_DEBUG */
+ #include "gximacc.h"
+ #include "gximconnection.h"
+ #include "gximmarshal.h"
+diff --git a/libgxim/gximprotocol10.c b/libgxim/gximprotocol10.c
+index 04887a5..65bd4df 100644
+--- a/libgxim/gximprotocol10.c
++++ b/libgxim/gximprotocol10.c
+@@ -2073,7 +2073,7 @@ g_xim_protocol10_closure_real_parser_error(GXimProtocol 
*proto,
+       msg = g_strdup_printf("Unable to parse the protocol %s properly",
+                             g_xim_protocol_name(major_opcode));
+ 
+-      g_xim_messages_error(G_XIM_PROTOCOL_GET_IFACE (proto)->message, msg);
++      g_xim_messages_error(G_XIM_PROTOCOL_GET_IFACE (proto)->message, "%s", 
msg);
+       switch (major_opcode) {
+           case G_XIM_CONNECT:
+           case G_XIM_AUTH_REQUIRED:
+-- 
+2.45.0
+

diff --git a/x11-libs/libgxim/libgxim-0.5.0.ebuild 
b/x11-libs/libgxim/libgxim-0.5.0-r1.ebuild
similarity index 88%
rename from x11-libs/libgxim/libgxim-0.5.0.ebuild
rename to x11-libs/libgxim/libgxim-0.5.0-r1.ebuild
index 3a0811f9cd0d..f7a149908a9b 100644
--- a/x11-libs/libgxim/libgxim-0.5.0.ebuild
+++ b/x11-libs/libgxim/libgxim-0.5.0-r1.ebuild
@@ -33,6 +33,12 @@ BDEPEND="${RUBY_DEPS}
 
 AT_M4DIR="m4macros"
 
+PATCHES=(
+       # backport upstream fix for gcc 14 implicit function declarations and by
+       # extension, LTO type mismatches. Also fixes format-security.
+       "${FILESDIR}"/${P}-gcc14.patch
+)
+
 src_prepare() {
        sed -i \
                -e "/PKG_CHECK_MODULES/s/\(check\)/$(usex test '\1' _)/" \

Reply via email to