diff options
-rw-r--r-- | meta/recipes-devtools/python/python3/0001-main.c-if-OEPYTHON3HOME-is-set-use-instead-of-PYTHON.patch | 47 | ||||
-rw-r--r-- | meta/recipes-devtools/python/python3_3.7.3.bb | 7 |
2 files changed, 54 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..06eb2bd35b --- /dev/null +++ b/meta/recipes-devtools/python/python3/0001-main.c-if-OEPYTHON3HOME-is-set-use-instead-of-PYTHON.patch | |||
@@ -0,0 +1,47 @@ | |||
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 | --- | ||
14 | Modules/main.c | 17 +++++++++++++---- | ||
15 | 1 file changed, 13 insertions(+), 4 deletions(-) | ||
16 | |||
17 | diff --git a/Modules/main.c b/Modules/main.c | ||
18 | index a745381..b553e30 100644 | ||
19 | --- a/Modules/main.c | ||
20 | +++ b/Modules/main.c | ||
21 | @@ -1855,10 +1855,19 @@ config_init_home(_PyCoreConfig *config) | ||
22 | } | ||
23 | return _Py_INIT_OK(); | ||
24 | } | ||
25 | - | ||
26 | - int res = config_get_env_var_dup(&home, L"PYTHONHOME", "PYTHONHOME"); | ||
27 | - if (res < 0) { | ||
28 | - return DECODE_LOCALE_ERR("PYTHONHOME", res); | ||
29 | + int res; | ||
30 | + const char *oepython3home = config_get_env_var("OEPYTHON3HOME"); | ||
31 | + if (oepython3home) { | ||
32 | + res = config_get_env_var_dup(&home, L"OEPYTHON3HOME", "OEPYTHON3HOME"); | ||
33 | + if (res < 0) { | ||
34 | + return DECODE_LOCALE_ERR("OEPYTHON3HOME", res); | ||
35 | + } | ||
36 | + } | ||
37 | + else { | ||
38 | + res = config_get_env_var_dup(&home, L"PYTHONHOME", "PYTHONHOME"); | ||
39 | + if (res < 0) { | ||
40 | + return DECODE_LOCALE_ERR("PYTHONHOME", res); | ||
41 | + } | ||
42 | } | ||
43 | config->home = home; | ||
44 | return _Py_INIT_OK(); | ||
45 | -- | ||
46 | 2.7.4 | ||
47 | |||
diff --git a/meta/recipes-devtools/python/python3_3.7.3.bb b/meta/recipes-devtools/python/python3_3.7.3.bb index 3a1c8f5be6..eee01c3af6 100644 --- a/meta/recipes-devtools/python/python3_3.7.3.bb +++ b/meta/recipes-devtools/python/python3_3.7.3.bb | |||
@@ -29,6 +29,9 @@ SRC_URI_append_class-native = " \ | |||
29 | file://0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch \ | 29 | file://0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch \ |
30 | file://12-distutils-prefix-is-inside-staging-area.patch \ | 30 | file://12-distutils-prefix-is-inside-staging-area.patch \ |
31 | " | 31 | " |
32 | SRC_URI_append_class-nativesdk = " \ | ||
33 | file://0001-main.c-if-OEPYTHON3HOME-is-set-use-instead-of-PYTHON.patch \ | ||
34 | " | ||
32 | 35 | ||
33 | SRC_URI[md5sum] = "93df27aec0cd18d6d42173e601ffbbfd" | 36 | SRC_URI[md5sum] = "93df27aec0cd18d6d42173e601ffbbfd" |
34 | SRC_URI[sha256sum] = "da60b54064d4cfcd9c26576f6df2690e62085123826cff2e667e72a91952d318" | 37 | SRC_URI[sha256sum] = "da60b54064d4cfcd9c26576f6df2690e62085123826cff2e667e72a91952d318" |
@@ -132,6 +135,10 @@ do_install_append() { | |||
132 | ${D}${libdir}/python-sysconfigdata/_sysconfigdata.py | 135 | ${D}${libdir}/python-sysconfigdata/_sysconfigdata.py |
133 | } | 136 | } |
134 | 137 | ||
138 | do_install_append_class-nativesdk () { | ||
139 | 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' | ||
140 | } | ||
141 | |||
135 | SSTATE_SCAN_FILES += "Makefile _sysconfigdata.py" | 142 | SSTATE_SCAN_FILES += "Makefile _sysconfigdata.py" |
136 | PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess" | 143 | PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess" |
137 | 144 | ||