diff options
Diffstat (limited to 'meta/recipes-devtools/python/python3/0001-main.c-if-OEPYTHON3HOME-is-set-use-instead-of-PYTHON.patch')
-rw-r--r-- | meta/recipes-devtools/python/python3/0001-main.c-if-OEPYTHON3HOME-is-set-use-instead-of-PYTHON.patch | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python3/0001-main.c-if-OEPYTHON3HOME-is-set-use-instead-of-PYTHON.patch b/meta/recipes-devtools/python/python3/0001-main.c-if-OEPYTHON3HOME-is-set-use-instead-of-PYTHON.patch new file mode 100644 index 0000000000..48d4f73e9c --- /dev/null +++ b/meta/recipes-devtools/python/python3/0001-main.c-if-OEPYTHON3HOME-is-set-use-instead-of-PYTHON.patch | |||
@@ -0,0 +1,35 @@ | |||
1 | From ffe7797637f08cd6ee4c82e2d67462c5e194d30a Mon Sep 17 00:00:00 2001 | ||
2 | From: Jaewon Lee <jaewon.lee@xilinx.com> | ||
3 | Date: Thu, 25 Apr 2019 15:34:26 -0700 | ||
4 | Subject: [PATCH] main.c: if OEPYTHON3HOME is set use instead of PYTHONHOME | ||
5 | |||
6 | There is one variable PYTHONHOME to determine where libraries are coming | ||
7 | from for both python2 and python3. This becomes an issue if only one has | ||
8 | libraries in the specified PYTHONHOME path, but they are using the same | ||
9 | PYTHONHOME. Creating another variable OEPYTHON3HOME to allow for a way | ||
10 | to set a different path for python3 | ||
11 | |||
12 | Signed-off-by: Jaewon Lee <jaewon.lee@xilinx.com> | ||
13 | RP: Backported to 3.5.6 (code totally different to original path for | ||
14 | later python versions) | ||
15 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> | ||
16 | |||
17 | --- | ||
18 | Modules/main.c | 17 +++++++++++++---- | ||
19 | 1 file changed, 13 insertions(+), 4 deletions(-) | ||
20 | |||
21 | Index: Python-3.5.6/Python/pylifecycle.c | ||
22 | =================================================================== | ||
23 | --- Python-3.5.6.orig/Python/pylifecycle.c | ||
24 | +++ Python-3.5.6/Python/pylifecycle.c | ||
25 | @@ -864,7 +864,9 @@ Py_GetPythonHome(void) | ||
26 | { | ||
27 | wchar_t *home = default_home; | ||
28 | if (home == NULL && !Py_IgnoreEnvironmentFlag) { | ||
29 | - char* chome = Py_GETENV("PYTHONHOME"); | ||
30 | + char* chome = Py_GETENV("OEPYTHON3HOME"); | ||
31 | + if (!chome) | ||
32 | + chome = Py_GETENV("PYTHONHOME"); | ||
33 | if (chome) { | ||
34 | size_t size = Py_ARRAY_LENGTH(env_home); | ||
35 | size_t r = mbstowcs(env_home, chome, size); | ||