commit:     5ac484970bf6ad79af459a9ac7c26d6a158be600
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Mar  2 16:39:05 2026 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Mar  2 17:08:45 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5ac48497

sys-apps/flatpak: fix build with glibc 2.43

Closes: https://bugs.gentoo.org/970765
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 .../flatpak/files/flatpak-1.16.3-glibc-2.43.patch  | 80 ++++++++++++++++++++++
 sys-apps/flatpak/flatpak-1.16.1.ebuild             |  2 +
 sys-apps/flatpak/flatpak-1.16.3.ebuild             |  2 +
 3 files changed, 84 insertions(+)

diff --git a/sys-apps/flatpak/files/flatpak-1.16.3-glibc-2.43.patch 
b/sys-apps/flatpak/files/flatpak-1.16.3-glibc-2.43.patch
new file mode 100644
index 000000000000..fb922175fb04
--- /dev/null
+++ b/sys-apps/flatpak/files/flatpak-1.16.3-glibc-2.43.patch
@@ -0,0 +1,80 @@
+From 9380e0c66c7f0f081647c84e72c86599853951b0 Mon Sep 17 00:00:00 2001
+From: Reilly Brogan <[email protected]>
+Date: Tue, 27 Jan 2026 23:07:30 -0600
+Subject: [PATCH] fix: Build with glibc 2.43
+
+Several glibc functions now return a const pointer if the input is a const 
pointer and a non-const pointer if the input is non-const, causing a build 
failure.
+
+Fix this by declaring the output pointers as const if they are never modified 
and for the lone failure where the output is modified instead make the input 
non-const.
+---
+ app/flatpak-builtins-utils.c | 2 +-
+ app/flatpak-tty-utils.c      | 2 +-
+ common/flatpak-context.c     | 8 ++++----
+ 3 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/app/flatpak-builtins-utils.c b/app/flatpak-builtins-utils.c
+index be9053763d..3ba07a5baf 100644
+--- a/app/flatpak-builtins-utils.c
++++ b/app/flatpak-builtins-utils.c
+@@ -824,7 +824,7 @@ find_column (Column     *columns,
+ {
+   int i;
+   int candidate;
+-  char *p = strchr (name, ':');
++  const char *p = strchr (name, ':');
+ 
+   candidate = -1;
+   for (i = 0; columns[i].name; i++)
+diff --git a/app/flatpak-tty-utils.c b/app/flatpak-tty-utils.c
+index dbc0f9808b..c3142fdb14 100644
+--- a/app/flatpak-tty-utils.c
++++ b/app/flatpak-tty-utils.c
+@@ -253,7 +253,7 @@ flatpak_number_prompt (gboolean default_yes, int min, int 
max, const char *promp
+ }
+ 
+ static gboolean
+-parse_range (const char *s, int *a, int *b)
++parse_range (char *s, int *a, int *b)
+ {
+   char *p;
+ 
+diff --git a/common/flatpak-context.c b/common/flatpak-context.c
+index d130d58adb..6d0a6ab271 100644
+--- a/common/flatpak-context.c
++++ b/common/flatpak-context.c
+@@ -1544,7 +1544,7 @@ get_xdg_dir_from_string (const char  *filesystem,
+                          const char **suffix,
+                          const char **where)
+ {
+-  char *slash;
++  const char *slash;
+   const char *rest;
+   g_autofree char *prefix = NULL;
+   const char *dir = NULL;
+@@ -1578,7 +1578,7 @@ get_xdg_user_dir_from_string (const char  *filesystem,
+                               const char **suffix,
+                               char **dir)
+ {
+-  char *slash;
++  const char *slash;
+   const char *rest;
+   g_autofree char *prefix = NULL;
+   gsize len;
+@@ -2580,7 +2580,7 @@ option_add_generic_policy_cb (const gchar *option_name,
+                               GError     **error)
+ {
+   FlatpakContext *context = data;
+-  char *t;
++  const char *t;
+   g_autofree char *key = NULL;
+   const char *policy_value;
+ 
+@@ -2619,7 +2619,7 @@ option_remove_generic_policy_cb (const gchar 
*option_name,
+                                  GError     **error)
+ {
+   FlatpakContext *context = data;
+-  char *t;
++  const char *t;
+   g_autofree char *key = NULL;
+   const char *policy_value;
+   g_autofree char *extended_value = NULL;

diff --git a/sys-apps/flatpak/flatpak-1.16.1.ebuild 
b/sys-apps/flatpak/flatpak-1.16.1.ebuild
index 3a24eca176f7..f61f374a6a05 100644
--- a/sys-apps/flatpak/flatpak-1.16.1.ebuild
+++ b/sys-apps/flatpak/flatpak-1.16.1.ebuild
@@ -71,6 +71,8 @@ BDEPEND="
 
 PDEPEND="sys-apps/xdg-desktop-portal"
 
+PATCHES=("${FILESDIR}/flatpak-1.16.3-glibc-2.43.patch")
+
 python_check_deps() {
        python_has_version "dev-python/pyparsing[${PYTHON_USEDEP}]"
 }

diff --git a/sys-apps/flatpak/flatpak-1.16.3.ebuild 
b/sys-apps/flatpak/flatpak-1.16.3.ebuild
index d9c92a36f2b1..60bc84f843e9 100644
--- a/sys-apps/flatpak/flatpak-1.16.3.ebuild
+++ b/sys-apps/flatpak/flatpak-1.16.3.ebuild
@@ -70,6 +70,8 @@ BDEPEND="
 
 PDEPEND="sys-apps/xdg-desktop-portal"
 
+PATCHES=("${FILESDIR}/flatpak-1.16.3-glibc-2.43.patch")
+
 python_check_deps() {
        python_has_version "dev-python/pyparsing[${PYTHON_USEDEP}]"
 }

Reply via email to