poky/meta/recipes-devtools/python/python3/0001-Lib-sysconfig.py-use-prefix-value-from-build-configu.patch
Alexander Kanavin bbb4d65500 Revert "python3-native: further tweak to sysconfig.py to find python includes correctly"
Unfortunately, sysconfig is used by:
- setuptools to find out where to install new headers
- autoconf-archive to find where Python.h is

In the first case we want the target location, in the second case we want
the sysroot location. The second case is not yet used in the wild
(as projects such as gpgpme are using outdated distutils-based m4 macros),
but it will become a problem once python 3.12 is out, and
said projects are forced to migrate to sysconfig. Let's deal with it
then in a more careful manner, and hopefully convince upstream that
there is a general problem too.

(From OE-Core rev: 499b152bf63749be18fc252978a6cc632254b325)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-12-28 23:59:56 +00:00

33 lines
1.2 KiB
Diff

From a73020a9c388b4882c384087882a77ab2c7b3729 Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex@linutronix.de>
Date: Fri, 10 Sep 2021 12:28:31 +0200
Subject: [PATCH] Lib/sysconfig.py: use prefix value from build configuration
file
This allows correctly substituting them for target installs using
native python.
Upstream-Status: Inappropriate [oe-core cross builds]
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
Lib/sysconfig.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
index 93c6f73..ff399e2 100644
--- a/Lib/sysconfig.py
+++ b/Lib/sysconfig.py
@@ -668,6 +668,11 @@ def get_config_vars(*args):
_CONFIG_VARS['VPATH'] = sys._vpath
if os.name == 'posix':
_init_posix(_CONFIG_VARS)
+ _CONFIG_VARS['installed_base'] = _CONFIG_VARS['prefix']
+ _CONFIG_VARS['base'] = _CONFIG_VARS['prefix']
+ _CONFIG_VARS['installed_platbase'] = _CONFIG_VARS['prefix']
+ _CONFIG_VARS['platbase'] = _CONFIG_VARS['prefix']
+ _CONFIG_VARS['platlibdir'] = _CONFIG_VARS['PLATLIBDIR']
if _HAS_USER_BASE:
# Setting 'userbase' is done below the call to the
# init function to enable using 'get_config_var' in