new file mode 100644
@@ -0,0 +1,36 @@
+From c6199341bcd47239d56df5df05971ba237d39d90 Mon Sep 17 00:00:00 2001
+From: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
+Date: Wed, 25 Nov 2026 18:43:12 +0000
+Subject: [PATCH] utils: keep can_use_env when merging EnvironmentVariables
+
+merge() didn't carry over can_use_env, so an env using append() or
+prepend() lost the existing value when merged, e.g. in
+gnome.generate_gir().
+
+Fixes #16382
+
+Backport Notes: The unit test added to unittests/internaltests.py upstream
+is dropped, as it does not apply to 1.12.1 and the unit tests are not run
+as part of the meson recipe.
+
+Upstream-Status: Submitted [https://github.com/mesonbuild/meson/pull/16383]
+Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
+---
+ mesonbuild/utils/core.py | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/mesonbuild/utils/core.py b/mesonbuild/utils/core.py
+index 3b212e2d1..90a85c779 100644
+--- a/mesonbuild/utils/core.py
++++ b/mesonbuild/utils/core.py
+@@ -95,6 +95,10 @@ class EnvironmentVariables(HoldableObject):
+ return self.varnames
+
+ def merge(self, other: EnvironmentVariables) -> None:
++ # append() and prepend() depend on the value inherited at runtime, so
++ # the merged object can't use the env shortcut either.
++ if not other.can_use_env:
++ self.can_use_env = False
+ for method, name, values, separator in other.envvars:
+ self.varnames.add(name)
+ self.envvars.append((method, name, values, separator))
@@ -13,6 +13,7 @@ SRC_URI = "${GITHUB_BASE_URI}/download/${PV}/meson-${PV}.tar.gz \
file://meson-wrapper \
file://0001-Make-CPU-family-warnings-fatal.patch \
file://0002-Support-building-allarch-recipes-again.patch \
+ file://0003-utils-keep-can_use_env-when-merging-EnvironmentVaria.patch \
"
SRC_URI[sha256sum] = "ab0a6ca09f8ef70c564c8241fb5a23957886a0b53fb58412b5e07eaf07dba743"
UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)$"
merge() dropped can_use_env, so prepend()/append() in gnome.generate_gir() overwrote the variable instead of extending it. This breaks glib 2.90.1, whose g-ir-scanner loses the caller's LD_LIBRARY_PATH. Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech> --- ...se_env-when-merging-EnvironmentVaria.patch | 36 +++++++++++++++++++ meta/recipes-devtools/meson/meson_1.12.1.bb | 1 + 2 files changed, 37 insertions(+) create mode 100644 meta/recipes-devtools/meson/meson/0003-utils-keep-can_use_env-when-merging-EnvironmentVaria.patch