summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Le Cuirot <chewi@gentoo.org>2023-08-16 22:34:25 +0100
committerJames Le Cuirot <chewi@gentoo.org>2023-08-17 08:41:30 +0100
commit0686381dfc3d39c0f844d25aeb8471b9a5de657e (patch)
tree5bfe893b562ca6be75b7992c91f71a492e254896 /dev-util/meson
parentmedia-video/webcamoid: fix docompress path (diff)
downloadgentoo-0686381dfc3d39c0f844d25aeb8471b9a5de657e.tar.gz
gentoo-0686381dfc3d39c0f844d25aeb8471b9a5de657e.tar.bz2
gentoo-0686381dfc3d39c0f844d25aeb8471b9a5de657e.zip
dev-util/meson: Backport fix to respect PATH when finding Python
Closes: https://bugs.gentoo.org/912051 Signed-off-by: James Le Cuirot <chewi@gentoo.org>
Diffstat (limited to 'dev-util/meson')
-rw-r--r--dev-util/meson/files/meson-1.2.1-python-path.patch26
-rw-r--r--dev-util/meson/meson-1.2.1-r1.ebuild (renamed from dev-util/meson/meson-1.2.1.ebuild)4
2 files changed, 30 insertions, 0 deletions
diff --git a/dev-util/meson/files/meson-1.2.1-python-path.patch b/dev-util/meson/files/meson-1.2.1-python-path.patch
new file mode 100644
index 000000000000..d6151881f83f
--- /dev/null
+++ b/dev-util/meson/files/meson-1.2.1-python-path.patch
@@ -0,0 +1,26 @@
+From 2b33c94e6315e9a397dd48a58a5becb0df3b8aba 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.
+
+https://github.com/mesonbuild/meson/pull/12116
+
+diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py
+index 5654e4231..2b2395a9b 100644
+--- a/mesonbuild/modules/python.py
++++ b/mesonbuild/modules/python.py
+@@ -381,7 +381,9 @@ class PythonModule(ExtensionModule):
+
+ def _find_installation_impl(self, state: 'ModuleState', display_name: str, name_or_path: str, required: bool) -> MaybePythonProg:
+ if not name_or_path:
+- python = PythonExternalProgram('python3', mesonlib.python_command)
++ python = PythonExternalProgram('python3')
++ if not python.found():
++ python = PythonExternalProgram('python3', mesonlib.python_command)
+ else:
+ tmp_python = ExternalProgram.from_entry(display_name, name_or_path)
+ python = PythonExternalProgram(display_name, ext_prog=tmp_python)
diff --git a/dev-util/meson/meson-1.2.1.ebuild b/dev-util/meson/meson-1.2.1-r1.ebuild
index fefd68d177e5..2f54a0120763 100644
--- a/dev-util/meson/meson-1.2.1.ebuild
+++ b/dev-util/meson/meson-1.2.1-r1.ebuild
@@ -44,6 +44,10 @@ RDEPEND="
virtual/pkgconfig
"
+PATCHES=(
+ "${FILESDIR}"/${P}-python-path.patch
+)
+
python_prepare_all() {
local disable_unittests=(
# ASAN and sandbox both want control over LD_PRELOAD