python3: disable user site-pkg for native target

by setting the ENABLE_USER_SITE flag globally.
This is the recommended way according to
https://peps.python.org/pep-0370/#implementation

(From OE-Core rev: 71bf8e9e418af6213de17903f54502b5b1055872)

Signed-off-by: Konrad Weihmann <kweihmann@outlook.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Konrad Weihmann
2022-08-23 07:03:36 +00:00
committed by Richard Purdie
parent 0a095d4afb
commit 3e2fc11170

View File

@@ -171,6 +171,9 @@ do_install:append:class-native() {
# Nothing should be looking into ${B} for python3-native
sed -i -e 's:${B}:/build/path/unavailable/:g' \
${D}/${libdir}/python${PYTHON_MAJMIN}/config-${PYTHON_MAJMIN}${PYTHON_ABI}*/Makefile
# disable the lookup in user's site-packages globally
sed -i 's#ENABLE_USER_SITE = None#ENABLE_USER_SITE = False#' ${D}${libdir}/python${PYTHON_MAJMIN}/site.py
}
do_install:append() {