mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 00:20:08 +00:00
python: remove Python 2 and all supporting classes
Python 2 ceased being maintained on the 1st January 2020. We've already removed all users of it from oe-core so the final step is to move the recipe and supporting classes to meta-python2. The following are removed in this commit: - python and python-native 2.7.17 - python-setuptools - The classes pythonnative, pythondir, distutils, setuptools (From OE-Core rev: 390f3edabfb1f68ed9766245291c5f44ea00cc38) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
2b5cf2a067
commit
2ed5d927ca
@@ -1,4 +0,0 @@
|
||||
DEPENDS += "${@["${PYTHON_PN}-native ${PYTHON_PN}", ""][(d.getVar('PACKAGES') == '')]}"
|
||||
RDEPENDS_${PN} += "${@['', '${PYTHON_PN}-core']['${CLASSOVERRIDE}' == 'class-target']}"
|
||||
|
||||
inherit distutils-common-base pythonnative
|
||||
@@ -1,87 +0,0 @@
|
||||
inherit distutils-base
|
||||
|
||||
DISTUTILS_BUILD_ARGS ?= ""
|
||||
DISTUTILS_STAGE_HEADERS_ARGS ?= "--install-dir=${STAGING_INCDIR}/${PYTHON_DIR}"
|
||||
DISTUTILS_STAGE_ALL_ARGS ?= "--prefix=${STAGING_DIR_HOST}${prefix} \
|
||||
--install-data=${STAGING_DATADIR}"
|
||||
DISTUTILS_INSTALL_ARGS ?= "--root=${D} \
|
||||
--prefix=${prefix} \
|
||||
--install-lib=${PYTHON_SITEPACKAGES_DIR} \
|
||||
--install-data=${datadir}"
|
||||
|
||||
DISTUTILS_PYTHON = "python"
|
||||
DISTUTILS_PYTHON_class-native = "nativepython"
|
||||
|
||||
distutils_do_configure() {
|
||||
if [ "${CLEANBROKEN}" != "1" ] ; then
|
||||
NO_FETCH_BUILD=1 \
|
||||
${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py clean ${DISTUTILS_BUILD_ARGS}
|
||||
fi
|
||||
}
|
||||
|
||||
distutils_do_compile() {
|
||||
NO_FETCH_BUILD=1 \
|
||||
STAGING_INCDIR=${STAGING_INCDIR} \
|
||||
STAGING_LIBDIR=${STAGING_LIBDIR} \
|
||||
${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py build ${DISTUTILS_BUILD_ARGS} || \
|
||||
bbfatal_log "'${PYTHON_PN} setup.py build ${DISTUTILS_BUILD_ARGS}' execution failed."
|
||||
}
|
||||
|
||||
distutils_stage_headers() {
|
||||
install -d ${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR}
|
||||
${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install_headers ${DISTUTILS_STAGE_HEADERS_ARGS} || \
|
||||
bbfatal_log "'${PYTHON_PN} setup.py install_headers ${DISTUTILS_STAGE_HEADERS_ARGS}' execution for stage_headers failed."
|
||||
}
|
||||
|
||||
distutils_stage_all() {
|
||||
STAGING_INCDIR=${STAGING_INCDIR} \
|
||||
STAGING_LIBDIR=${STAGING_LIBDIR} \
|
||||
install -d ${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR}
|
||||
PYTHONPATH=${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR} \
|
||||
${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install ${DISTUTILS_STAGE_ALL_ARGS} || \
|
||||
bbfatal_log "'${PYTHON_PN} setup.py install ${DISTUTILS_STAGE_ALL_ARGS}' execution for stage_all failed."
|
||||
}
|
||||
|
||||
distutils_do_install() {
|
||||
install -d ${D}${PYTHON_SITEPACKAGES_DIR}
|
||||
STAGING_INCDIR=${STAGING_INCDIR} \
|
||||
STAGING_LIBDIR=${STAGING_LIBDIR} \
|
||||
PYTHONPATH=${D}${PYTHON_SITEPACKAGES_DIR} \
|
||||
${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install ${DISTUTILS_INSTALL_ARGS} || \
|
||||
bbfatal_log "'${PYTHON_PN} setup.py install ${DISTUTILS_INSTALL_ARGS}' execution failed."
|
||||
|
||||
# support filenames with *spaces*
|
||||
# only modify file if it contains path and recompile it
|
||||
find ${D} -name "*.py" -exec grep -q ${D} {} \; \
|
||||
-exec sed -i -e s:${D}::g {} \; \
|
||||
-exec ${STAGING_BINDIR_NATIVE}/python-native/python -mcompileall {} \;
|
||||
|
||||
for i in ${D}${bindir}/* ${D}${sbindir}/*; do
|
||||
if [ -f "$i" ]; then
|
||||
sed -i -e s:${PYTHON}:${USRBINPATH}/env\ ${DISTUTILS_PYTHON}:g $i
|
||||
sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i
|
||||
fi
|
||||
done
|
||||
|
||||
rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/easy-install.pth
|
||||
rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/site.py*
|
||||
|
||||
#
|
||||
# FIXME: Bandaid against wrong datadir computation
|
||||
#
|
||||
if [ -e ${D}${datadir}/share ]; then
|
||||
mv -f ${D}${datadir}/share/* ${D}${datadir}/
|
||||
rmdir ${D}${datadir}/share
|
||||
fi
|
||||
|
||||
# Fix backport modules
|
||||
if [ -e ${STAGING_LIBDIR}/${PYTHON_DIR}/site-packages/backports/__init__.py ] &&
|
||||
[ -e ${D}${PYTHON_SITEPACKAGES_DIR}/backports/__init__.py ]; then
|
||||
rm ${D}${PYTHON_SITEPACKAGES_DIR}/backports/__init__.py;
|
||||
rm ${D}${PYTHON_SITEPACKAGES_DIR}/backports/__init__.pyc;
|
||||
fi
|
||||
}
|
||||
|
||||
EXPORT_FUNCTIONS do_configure do_compile do_install
|
||||
|
||||
export LDSHARED="${CCLD} -shared"
|
||||
@@ -1,5 +0,0 @@
|
||||
PYTHON_BASEVERSION = "2.7"
|
||||
PYTHON_ABI = ""
|
||||
PYTHON_DIR = "python${PYTHON_BASEVERSION}"
|
||||
PYTHON_PN = "python"
|
||||
PYTHON_SITEPACKAGES_DIR = "${libdir}/${PYTHON_DIR}/site-packages"
|
||||
@@ -1,27 +0,0 @@
|
||||
|
||||
inherit python-dir
|
||||
|
||||
PYTHON="${STAGING_BINDIR_NATIVE}/python-native/python"
|
||||
# PYTHON_EXECUTABLE is used by cmake
|
||||
PYTHON_EXECUTABLE="${PYTHON}"
|
||||
EXTRANATIVEPATH += "python-native"
|
||||
DEPENDS_append = " python-native "
|
||||
|
||||
# python-config and other scripts are using distutils modules
|
||||
# which we patch to access these variables
|
||||
export STAGING_INCDIR
|
||||
export STAGING_LIBDIR
|
||||
|
||||
# Packages can use
|
||||
# find_package(PythonInterp REQUIRED)
|
||||
# find_package(PythonLibs REQUIRED)
|
||||
# which ends up using libs/includes from build host
|
||||
# Therefore pre-empt that effort
|
||||
export PYTHON_LIBRARY="${STAGING_LIBDIR}/lib${PYTHON_DIR}${PYTHON_ABI}.so"
|
||||
export PYTHON_INCLUDE_DIR="${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI}"
|
||||
|
||||
# suppress host user's site-packages dirs.
|
||||
export PYTHONNOUSERSITE = "1"
|
||||
|
||||
# autoconf macros will use their internal default preference otherwise
|
||||
export PYTHON
|
||||
@@ -1,3 +0,0 @@
|
||||
inherit distutils
|
||||
|
||||
DEPENDS += "python-setuptools-native"
|
||||
Reference in New Issue
Block a user