diff options
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r-- | meta/recipes-devtools/python/python3/0001-main.c-if-OEPYTHON3HOME-is-set-use-instead-of-PYTHON.patch | 35 | ||||
-rw-r--r-- | meta/recipes-devtools/python/python3_3.5.6.bb | 6 |
2 files changed, 40 insertions, 1 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 @@ +From ffe7797637f08cd6ee4c82e2d67462c5e194d30a Mon Sep 17 00:00:00 2001 +From: Jaewon Lee <jaewon.lee@xilinx.com> +Date: Thu, 25 Apr 2019 15:34:26 -0700 +Subject: [PATCH] main.c: if OEPYTHON3HOME is set use instead of PYTHONHOME + +There is one variable PYTHONHOME to determine where libraries are coming +from for both python2 and python3. This becomes an issue if only one has +libraries in the specified PYTHONHOME path, but they are using the same +PYTHONHOME. Creating another variable OEPYTHON3HOME to allow for a way +to set a different path for python3 + +Signed-off-by: Jaewon Lee <jaewon.lee@xilinx.com> +RP: Backported to 3.5.6 (code totally different to original path for +later python versions) +Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> + +--- + Modules/main.c | 17 +++++++++++++---- + 1 file changed, 13 insertions(+), 4 deletions(-) + +Index: Python-3.5.6/Python/pylifecycle.c +=================================================================== +--- Python-3.5.6.orig/Python/pylifecycle.c ++++ Python-3.5.6/Python/pylifecycle.c +@@ -864,7 +864,9 @@ Py_GetPythonHome(void) + { + wchar_t *home = default_home; + if (home == NULL && !Py_IgnoreEnvironmentFlag) { +- char* chome = Py_GETENV("PYTHONHOME"); ++ char* chome = Py_GETENV("OEPYTHON3HOME"); ++ if (!chome) ++ chome = Py_GETENV("PYTHONHOME"); + if (chome) { + size_t size = Py_ARRAY_LENGTH(env_home); + size_t r = mbstowcs(env_home, chome, size); diff --git a/meta/recipes-devtools/python/python3_3.5.6.bb b/meta/recipes-devtools/python/python3_3.5.6.bb index b2f8a3d034..4633a3d239 100644 --- a/meta/recipes-devtools/python/python3_3.5.6.bb +++ b/meta/recipes-devtools/python/python3_3.5.6.bb @@ -50,6 +50,10 @@ SRC_URI += "\ file://CVE-2019-9636.patch \ " +SRC_URI_append_class-nativesdk = " \ + file://0001-main.c-if-OEPYTHON3HOME-is-set-use-instead-of-PYTHON.patch \ + " + inherit multilib_header python3native update-alternatives qemu ptest MULTILIB_SUFFIX = "${@d.getVar('base_libdir',1).split('/')[-1]}" @@ -184,7 +188,7 @@ do_install() { } do_install_append_class-nativesdk () { - create_wrapper ${D}${bindir}/python${PYTHON_MAJMIN} PYTHONHOME='${prefix}' TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo' PYTHONNOUSERSITE='1' + create_wrapper ${D}${bindir}/python${PYTHON_MAJMIN} OEPYTHON3HOME='${prefix}' TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo' PYTHONNOUSERSITE='1' } SSTATE_SCAN_FILES += "Makefile" |