commit:     5bb9d01763f49ac57dd05c06a4044262c08074e4
Author:     Lukas Schmelting <lschmelting <AT> posteo <DOT> com>
AuthorDate: Mon Nov 24 22:15:28 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Nov 26 03:09:39 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5bb9d017

x11-terms/ptyxis: fix build with gcc-16 and lto

See-also: https://gitlab.gnome.org/chergert/ptyxis/-/issues/504
Closes: https://bugs.gentoo.org/966109
Signed-off-by: Lukas Schmelting <lschmelting <AT> posteo.com>
Part-of: https://github.com/gentoo/gentoo/pull/44768
Closes: https://github.com/gentoo/gentoo/pull/44768
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/make-libc-compat-builds-optional.patch   | 61 ++++++++++++++++++++++
 x11-terms/ptyxis/ptyxis-47.13-r1.ebuild            |  4 ++
 x11-terms/ptyxis/ptyxis-48.5.ebuild                |  4 ++
 3 files changed, 69 insertions(+)

diff --git a/x11-terms/ptyxis/files/make-libc-compat-builds-optional.patch 
b/x11-terms/ptyxis/files/make-libc-compat-builds-optional.patch
new file mode 100644
index 000000000000..39ce00a83328
--- /dev/null
+++ b/x11-terms/ptyxis/files/make-libc-compat-builds-optional.patch
@@ -0,0 +1,61 @@
+From 64affa1242283923b24a1b3d683e8438a1585c6d Mon Sep 17 00:00:00 2001
+From: Christian Hergert <[email protected]>
+Date: Mon, 17 Nov 2025 15:12:46 -0800
+Subject: [PATCH] build: make libc-compat builds optional
+
+---
+ agent/meson.build           | 2 ++
+ meson_options.txt           | 5 +++++
+ org.gnome.Ptyxis.Devel.json | 3 ++-
+ 3 files changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/agent/meson.build b/agent/meson.build
+index 147c70b..bd0b928 100644
+--- a/agent/meson.build
++++ b/agent/meson.build
+@@ -45,6 +45,7 @@ ptyxis_agent_c_args = [
+   
'-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_@0@_@1@'.format(PTYXIS_AGENT_MIN_GLIB_MAJOR,
 PTYXIS_AGENT_MIN_GLIB_MINOR),
+ ]
+ 
++if get_option('libc-compat')
+ libc_compat = true
+ if target_machine.cpu_family() == 'x86_64'
+   ptyxis_agent_c_args += ['-include', 'x86_64/force_link_glibc_2.17.h']
+@@ -56,6 +57,7 @@ if libc_compat
+   config_h.set10('LIBC_COMPAT', libc_compat)
+   ptyxis_agent_link_args += ['-Wl,--wrap=__libc_start_main']
+ endif
++endif
+ 
+ executable('ptyxis-agent', ptyxis_agent_sources,
+          dependencies: ptyxis_agent_deps,
+diff --git a/meson_options.txt b/meson_options.txt
+index ec7f85c..a2d918e 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -5,3 +5,8 @@ option('generic', type: 'combo', value: 'ptyxis',
+ option('app-id', type: 'string', value: '', description: 'An alternate app-id 
to use for the application')
+ option('gschema-id', type: 'string', value: '', description: 'An alternative 
gschema identifier prefix')
+ option('gschema-path', type: 'string', value: '', description: 'An 
alternative gschema path to use')
++
++# Building with libc-compat is generally just useful when building the Flatpak
++# since that is where we will want to build a binary that can run on the host
++# outside of the Flatpak container.
++option('libc-compat', type: 'boolean', value: false, description: 'Try to 
build the agent with old glibc symbols for running on older hosts')
+diff --git a/org.gnome.Ptyxis.Devel.json b/org.gnome.Ptyxis.Devel.json
+index 9350c88..ae53aaf 100644
+--- a/org.gnome.Ptyxis.Devel.json
++++ b/org.gnome.Ptyxis.Devel.json
+@@ -100,7 +100,8 @@
+             "builddir" : true,
+             "buildsystem" : "meson",
+             "config-opts" : [
+-                "-Ddevelopment=true"
++                "-Ddevelopment=true",
++                "-Dlibc-compat=true"
+             ],
+             "sources" : [
+                 {
+-- 
+GitLab
+

diff --git a/x11-terms/ptyxis/ptyxis-47.13-r1.ebuild 
b/x11-terms/ptyxis/ptyxis-47.13-r1.ebuild
index a269d55f36cb..c5a1716d2c68 100644
--- a/x11-terms/ptyxis/ptyxis-47.13-r1.ebuild
+++ b/x11-terms/ptyxis/ptyxis-47.13-r1.ebuild
@@ -35,6 +35,10 @@ BDEPEND="
        )
 "
 
+PATCHES=(
+       "${FILESDIR}/make-libc-compat-builds-optional.patch"
+)
+
 src_configure() {
        use X || append-cppflags -DGENTOO_GTK_HIDE_X11
 

diff --git a/x11-terms/ptyxis/ptyxis-48.5.ebuild 
b/x11-terms/ptyxis/ptyxis-48.5.ebuild
index 73043f4537ac..5599f02f36a7 100644
--- a/x11-terms/ptyxis/ptyxis-48.5.ebuild
+++ b/x11-terms/ptyxis/ptyxis-48.5.ebuild
@@ -35,6 +35,10 @@ BDEPEND="
        )
 "
 
+PATCHES=(
+       "${FILESDIR}/make-libc-compat-builds-optional.patch"
+)
+
 src_configure() {
        use X || append-cflags -DGENTOO_GTK_HIDE_X11
        local emesonargs=(

Reply via email to