blob: cc64e3ecf7b36d7a5058d99bbfd0d6046a91baa7 [file] [log] [blame]
Andrew Geisslereff27472021-10-29 15:35:00 -05001From f6411021856bafedd784748ec33494151e783b51 Mon Sep 17 00:00:00 2001
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05002From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 14 May 2013 15:00:26 -0700
Andrew Geisslereff27472021-10-29 15:35:00 -05004Subject: [PATCH] python3: Add target and native recipes
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05005
Patrick Williamsc124f4f2015-09-15 14:41:29 -05006Upstream-Status: Inappropriate [embedded specific]
7
802/2015 Rebased for Python 3.4.2
9
Andrew Geissler6ce62a22020-11-30 19:58:47 -060010The proper prefix is inside our staging area.
11Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
12Signed-off-by: Phil Blundell <philb@gnu.org>
13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050015---
Brad Bishopa34c0302019-09-23 22:34:48 -040016 Lib/distutils/sysconfig.py | 14 +++++++++++---
17 1 file changed, 11 insertions(+), 3 deletions(-)
Patrick Williamsc0f7c042017-02-23 20:41:17 -060018
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050019diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
Andrew Geisslereff27472021-10-29 15:35:00 -050020index 3414a76..361d3a1 100644
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050021--- a/Lib/distutils/sysconfig.py
22+++ b/Lib/distutils/sysconfig.py
Andrew Geisslereff27472021-10-29 15:35:00 -050023@@ -277,7 +277,9 @@ def get_python_inc(plat_specific=0, prefix=None):
Patrick Williamsc124f4f2015-09-15 14:41:29 -050024 If 'prefix' is supplied, use it instead of sys.base_prefix or
25 sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
26 """
27- if prefix is None:
Brad Bishopa34c0302019-09-23 22:34:48 -040028+ if prefix is None and os.environ.get('STAGING_INCDIR', ""):
Patrick Williamsc124f4f2015-09-15 14:41:29 -050029+ prefix = os.environ['STAGING_INCDIR'].rstrip('include')
30+ elif prefix is None:
31 prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX
32 if os.name == "posix":
33 if python_build:
Andrew Geisslereff27472021-10-29 15:35:00 -050034@@ -320,7 +322,13 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
Patrick Williamsc124f4f2015-09-15 14:41:29 -050035 If 'prefix' is supplied, use it instead of sys.base_prefix or
36 sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
37 """
Brad Bishopa34c0302019-09-23 22:34:48 -040038- if prefix is None:
39+ if os.environ.get('STAGING_LIBDIR', ""):
40+ lib_basename = os.environ['STAGING_LIBDIR'].split('/')[-1]
41+ else:
42+ lib_basename = "lib"
43+ if prefix is None and os.environ.get('STAGING_LIBDIR', ""):
Patrick Williamsc124f4f2015-09-15 14:41:29 -050044+ prefix = os.environ['STAGING_LIBDIR'].rstrip(lib_basename)
Brad Bishopa34c0302019-09-23 22:34:48 -040045+ elif prefix is None:
Patrick Williamsc124f4f2015-09-15 14:41:29 -050046 if standard_lib:
47 prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX
Brad Bishopa34c0302019-09-23 22:34:48 -040048 else:
Andrew Geisslereff27472021-10-29 15:35:00 -050049@@ -334,7 +342,7 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
Andrew Geissler6ce62a22020-11-30 19:58:47 -060050 else:
51 # Pure Python
52 libdir = "lib"
53- libpython = os.path.join(prefix, libdir,
54+ libpython = os.path.join(prefix, lib_basename,
55 "python" + get_python_version())
Patrick Williamsc124f4f2015-09-15 14:41:29 -050056 if standard_lib:
57 return libpython
Andrew Geissler6ce62a22020-11-30 19:58:47 -060058--
Andrew Geisslereff27472021-10-29 15:35:00 -0500592.20.1
Andrew Geissler6ce62a22020-11-30 19:58:47 -060060