diff options
Diffstat (limited to 'meta/recipes-devtools/python/python3_3.8.5.bb')
-rw-r--r-- | meta/recipes-devtools/python/python3_3.8.5.bb | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/meta/recipes-devtools/python/python3_3.8.5.bb b/meta/recipes-devtools/python/python3_3.8.5.bb index f09a3c1d6e..418d35acfe 100644 --- a/meta/recipes-devtools/python/python3_3.8.5.bb +++ b/meta/recipes-devtools/python/python3_3.8.5.bb @@ -33,6 +33,8 @@ SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \ file://0001-python3-Do-not-hardcode-lib-for-distutils.patch \ file://0020-configure.ac-setup.py-do-not-add-a-curses-include-pa.patch \ file://CVE-2020-27619.patch \ + file://CVE-2021-3177.patch \ + file://CVE-2021-23336.patch \ " SRC_URI_append_class-native = " \ @@ -168,6 +170,10 @@ do_install_append() { } do_install_append_class-nativesdk () { + # Make sure we use /usr/bin/env python + for PYTHSCRIPT in `grep -rIl ${bindir}/python ${D}${bindir}`; do + sed -i -e '1s|^#!.*|#!/usr/bin/env python3|' $PYTHSCRIPT + done create_wrapper ${D}${bindir}/python${PYTHON_MAJMIN} TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo' PYTHONNOUSERSITE='1' } @@ -306,11 +312,8 @@ do_create_manifest() { } # bitbake python -c create_manifest -addtask do_create_manifest - # Make sure we have native python ready when we create a new manifest -do_create_manifest[depends] += "${PN}:do_prepare_recipe_sysroot" -do_create_manifest[depends] += "${PN}:do_patch" +addtask do_create_manifest after do_patch do_prepare_recipe_sysroot # manual dependency additions RRECOMMENDS_${PN}-core_append_class-nativesdk = " nativesdk-python3-modules" @@ -363,3 +366,9 @@ RDEPENDS_${PN}-dev = "" RDEPENDS_${PN}-tests_append_class-target = " ${MLPREFIX}bash" RDEPENDS_${PN}-tests_append_class-nativesdk = " ${MLPREFIX}bash" + +# Python's tests contain large numbers of files we don't need in the recipe sysroots +SYSROOT_PREPROCESS_FUNCS += " py3_sysroot_cleanup" +py3_sysroot_cleanup () { + rm -rf ${SYSROOT_DESTDIR}${libdir}/python${PYTHON_MAJMIN}/test +} |