diff mbox series

[PATCHv2] gtk4: upgrade 4.22.5 -> 4.24.0

Message ID 20260916141229.483396-1-f_l_k@t-online.de
State New
Headers show
Series [PATCHv2] gtk4: upgrade 4.22.5 -> 4.24.0 | expand

Commit Message

Markus Volk Sept. 16, 2026, 2:12 p.m. UTC
Needs glib-2.0 >= 2.89.3, which the 2.90.0 upgrade provides.

gtk/svg is new in this release and is built as a meson unity target.
Meson implements unity builds by generating a source file that #includes
the real sources by absolute path, and that file is part of the debug
information of libgtk_svg, so it lands in gtk4-src carrying the path of
the build tree:

    File /usr/src/debug/gtk4/4.24.0/gtk/svg/libgtk_svg.a.p/gtk_svg-unity0.c
    in package gtk4-src contains reference to TMPDIR [buildpaths]

Rewrite the paths in the generated file the way -ffile-prefix-map
rewrites them for the compiler, so they name where the sources are
installed rather than where they were built. The rewriting happens at
packaging time, after the file has been compiled.

Dropping the unity build is not an option: the sources rely on being a
single translation unit and do not compile individually.

AI-Generated: Uses Claude Code (Claude Opus 5)
Signed-off-by: Markus Volk <f_l_k@t-online.de>
---
 .../gtk+/{gtk4_4.22.5.bb => gtk4_4.24.0.bb}          | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
 rename meta/recipes-gnome/gtk+/{gtk4_4.22.5.bb => gtk4_4.24.0.bb} (86%)
diff mbox series

Patch

diff --git a/meta/recipes-gnome/gtk+/gtk4_4.22.5.bb b/meta/recipes-gnome/gtk+/gtk4_4.24.0.bb
similarity index 86%
rename from meta/recipes-gnome/gtk+/gtk4_4.22.5.bb
rename to meta/recipes-gnome/gtk+/gtk4_4.24.0.bb
index 5d7385d29a..2d5a2c57cd 100644
--- a/meta/recipes-gnome/gtk+/gtk4_4.22.5.bb
+++ b/meta/recipes-gnome/gtk+/gtk4_4.24.0.bb
@@ -33,7 +33,7 @@  LIC_FILES_CHKSUM = " \
     file://tests/testgtk.c;endline=25;md5=49d06770681b8322466b52ed19d29fb2 \
 "
 
-SRC_URI[archive.sha256sum] = "7fd725deb2cb3f8dc218ad862c5056ff8548f49d3b0e4081796e444c22d19686"
+SRC_URI[archive.sha256sum] = "28ba4ac1c04f86eac09b79a163cb163a4c2b54442d9f7eccc04679062a581044"
 
 S = "${UNPACKDIR}/${GNOMEBN}-${PV}"
 
@@ -80,6 +80,16 @@  CFLAGS += "-Wno-error=int-conversion"
 
 LIBV = "4.0.0"
 
+# gtk/svg is built as a unity target, and meson implements that by generating a
+# source file that #includes the real sources by absolute path. That generated
+# file is part of the debug information and lands in the -src package, so give
+# it the same rewriting that -ffile-prefix-map does for the compiler. Otherwise
+# the build directory leaks into the package and buildpaths QA rejects it.
+gtk4_rewrite_unity_sources() {
+	find ${B} -name '*-unity*.c' -exec sed -i -e 's|${B}|${TARGET_DBGSRC_DIR}|g' -e 's|${S}|${TARGET_DBGSRC_DIR}|g' {} +
+}
+PACKAGE_PREPROCESS_FUNCS += "gtk4_rewrite_unity_sources"
+
 FILES:${PN}:append = " \
     ${datadir}/bash-completion \
     ${datadir}/gtk-4.0/emoji/ \