v5-0012-Make-finding-pkg-config-python3-more-robust.patch
text/x-patch
Filename: v5-0012-Make-finding-pkg-config-python3-more-robust.patch
Type: text/x-patch
Part: 11
Message:
Re: Meson build updates
Patch
Format: format-patch
Series: patch v5-0012
Subject: Make finding pkg-config(python3) more robust
| File | + | − |
|---|---|---|
| meson.build | 8 | 6 |
From 56b43d0d66a8aaf057f9c2bc0c0e70e874f9c305 Mon Sep 17 00:00:00 2001
From: Tristan Partin <tristan@neon.tech>
Date: Wed, 17 May 2023 09:40:02 -0500
Subject: [PATCH v5 12/16] Make finding pkg-config(python3) more robust
It is a possibility that the installation can't be found. Checking for
Python.h is redundant with what Meson does internally.
https://github.com/mesonbuild/meson/blob/master/mesonbuild/dependencies/python.py#L218
---
meson.build | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/meson.build b/meson.build
index 5806463138..7c50c7567d 100644
--- a/meson.build
+++ b/meson.build
@@ -1050,15 +1050,17 @@ endif
###############################################################
pyopt = get_option('plpython')
+python3_dep = not_found_dep
if not pyopt.disabled()
pm = import('python')
- python3_inst = pm.find_installation(required: pyopt.enabled())
- python3_dep = python3_inst.dependency(embed: true, required: pyopt.enabled())
- if not cc.check_header('Python.h', dependencies: python3_dep, required: pyopt.enabled())
- python3_dep = not_found_dep
+ python3_inst = pm.find_installation(required: pyopt)
+ if python3_inst.found()
+ python3_dep = python3_inst.dependency(embed: true, required: pyopt)
+ # Remove this check after we depend on Meson >= 1.1.0
+ if not cc.check_header('Python.h', dependencies: python3_dep, required: pyopt)
+ python3_dep = not_found_dep
+ endif
endif
-else
- python3_dep = not_found_dep
endif
--
Tristan Partin
Neon (https://neon.tech)