summaryrefslogtreecommitdiff
path: root/dev-build/meson/files/meson-1.10.0-python-path.patch
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2025-11-09 18:11:22 +0000
committerSam James <sam@gentoo.org>2025-11-09 18:13:13 +0000
commita11fd42c0814e166621b130111f878daf38cc980 (patch)
tree787621c577f47f0b86bc89d9290852aa160c93de /dev-build/meson/files/meson-1.10.0-python-path.patch
parent6062f71db62f6b07e9408fd7f2c234a2b2108996 (diff)
downloadgentoo-a11fd42c0814e166621b130111f878daf38cc980.tar.gz
gentoo-a11fd42c0814e166621b130111f878daf38cc980.tar.bz2
gentoo-a11fd42c0814e166621b130111f878daf38cc980.zip
dev-build/meson: rebase 9999 patch
Pull from Chewi's PR. Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-build/meson/files/meson-1.10.0-python-path.patch')
-rw-r--r--dev-build/meson/files/meson-1.10.0-python-path.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/dev-build/meson/files/meson-1.10.0-python-path.patch b/dev-build/meson/files/meson-1.10.0-python-path.patch
new file mode 100644
index 000000000000..3de84046e05d
--- /dev/null
+++ b/dev-build/meson/files/meson-1.10.0-python-path.patch
@@ -0,0 +1,39 @@
+From fbe4477ac8937253fe027486a28700f4f035b42b Mon Sep 17 00:00:00 2001
+From: James Le Cuirot <chewi@gentoo.org>
+Date: Sat, 12 Aug 2023 09:56:44 +0100
+Subject: [PATCH 2/2] python module: Respect PATH when python is not given in
+ machine file
+
+We should only fall back to the Python interpreter running Meson itself
+if `python3` is not found in the PATH.
+
+A couple of tests relied on the old behaviour. Under Arch/PyPy, the
+PATH's `python3` does not point to PyPy. Unfortunately, other
+Python-based tools like g-ir-scanner are installed with a shebang of
+`/usr/bin/env python3` on Arch, so adjusting the PATH to point to a
+different Python breaks such tools. We must therefore specify `python`
+in a machine file instead.
+
+We also have to now exclude "test cases/frameworks/1 boost" on Arch/PyPy
+because it cannot work against PyPy. It was previously using CPython,
+despite Meson itself running under PyPy, but the machine file has
+changed that.
+---
+ mesonbuild/modules/python.py | 4 +++-
+ 6 files changed, 18 insertions(+), 9 deletions(-)
+
+diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py
+index 9c1ad86cb170..ad1260ca5015 100644
+--- a/mesonbuild/modules/python.py
++++ b/mesonbuild/modules/python.py
+@@ -460,7 +460,9 @@ def _find_installation_impl(self, state: 'ModuleState', display_name: str, name_
+ build_config = self.interpreter.environment.coredata.optstore.get_value_for(OptionKey('python.build_config'))
+
+ if not name_or_path:
+- python = PythonExternalProgram('python3', mesonlib.python_command, build_config_path=build_config)
++ python = PythonExternalProgram('python3', build_config_path=build_config)
++ if not python.found():
++ python = PythonExternalProgram('python3', mesonlib.python_command, build_config_path=build_config)
+ else:
+ tmp_python = ExternalProgram.from_entry(display_name, name_or_path)
+ python = PythonExternalProgram(display_name, ext_prog=tmp_python, build_config_path=build_config)