summaryrefslogtreecommitdiffstats
path: root/meta/classes/distutils.bbclass
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2020-01-17 14:16:32 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-01-19 13:24:38 +0000
commit2ed5d927ca9b88d3964ada990ef46cdd38ec4b1e (patch)
tree2110d3e9381867553c69ae5c743887e1caa97926 /meta/classes/distutils.bbclass
parent2b5cf2a067cb6d9ca32d851dacdc1aff0cbfe904 (diff)
downloadpoky-2ed5d927ca9b88d3964ada990ef46cdd38ec4b1e.tar.gz
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>
Diffstat (limited to 'meta/classes/distutils.bbclass')
-rw-r--r--meta/classes/distutils.bbclass87
1 files changed, 0 insertions, 87 deletions
diff --git a/meta/classes/distutils.bbclass b/meta/classes/distutils.bbclass
deleted file mode 100644
index 3759b58263..0000000000
--- a/meta/classes/distutils.bbclass
+++ /dev/null
@@ -1,87 +0,0 @@
1inherit distutils-base
2
3DISTUTILS_BUILD_ARGS ?= ""
4DISTUTILS_STAGE_HEADERS_ARGS ?= "--install-dir=${STAGING_INCDIR}/${PYTHON_DIR}"
5DISTUTILS_STAGE_ALL_ARGS ?= "--prefix=${STAGING_DIR_HOST}${prefix} \
6 --install-data=${STAGING_DATADIR}"
7DISTUTILS_INSTALL_ARGS ?= "--root=${D} \
8 --prefix=${prefix} \
9 --install-lib=${PYTHON_SITEPACKAGES_DIR} \
10 --install-data=${datadir}"
11
12DISTUTILS_PYTHON = "python"
13DISTUTILS_PYTHON_class-native = "nativepython"
14
15distutils_do_configure() {
16 if [ "${CLEANBROKEN}" != "1" ] ; then
17 NO_FETCH_BUILD=1 \
18 ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py clean ${DISTUTILS_BUILD_ARGS}
19 fi
20}
21
22distutils_do_compile() {
23 NO_FETCH_BUILD=1 \
24 STAGING_INCDIR=${STAGING_INCDIR} \
25 STAGING_LIBDIR=${STAGING_LIBDIR} \
26 ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py build ${DISTUTILS_BUILD_ARGS} || \
27 bbfatal_log "'${PYTHON_PN} setup.py build ${DISTUTILS_BUILD_ARGS}' execution failed."
28}
29
30distutils_stage_headers() {
31 install -d ${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR}
32 ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install_headers ${DISTUTILS_STAGE_HEADERS_ARGS} || \
33 bbfatal_log "'${PYTHON_PN} setup.py install_headers ${DISTUTILS_STAGE_HEADERS_ARGS}' execution for stage_headers failed."
34}
35
36distutils_stage_all() {
37 STAGING_INCDIR=${STAGING_INCDIR} \
38 STAGING_LIBDIR=${STAGING_LIBDIR} \
39 install -d ${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR}
40 PYTHONPATH=${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR} \
41 ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install ${DISTUTILS_STAGE_ALL_ARGS} || \
42 bbfatal_log "'${PYTHON_PN} setup.py install ${DISTUTILS_STAGE_ALL_ARGS}' execution for stage_all failed."
43}
44
45distutils_do_install() {
46 install -d ${D}${PYTHON_SITEPACKAGES_DIR}
47 STAGING_INCDIR=${STAGING_INCDIR} \
48 STAGING_LIBDIR=${STAGING_LIBDIR} \
49 PYTHONPATH=${D}${PYTHON_SITEPACKAGES_DIR} \
50 ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install ${DISTUTILS_INSTALL_ARGS} || \
51 bbfatal_log "'${PYTHON_PN} setup.py install ${DISTUTILS_INSTALL_ARGS}' execution failed."
52
53 # support filenames with *spaces*
54 # only modify file if it contains path and recompile it
55 find ${D} -name "*.py" -exec grep -q ${D} {} \; \
56 -exec sed -i -e s:${D}::g {} \; \
57 -exec ${STAGING_BINDIR_NATIVE}/python-native/python -mcompileall {} \;
58
59 for i in ${D}${bindir}/* ${D}${sbindir}/*; do
60 if [ -f "$i" ]; then
61 sed -i -e s:${PYTHON}:${USRBINPATH}/env\ ${DISTUTILS_PYTHON}:g $i
62 sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i
63 fi
64 done
65
66 rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/easy-install.pth
67 rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/site.py*
68
69 #
70 # FIXME: Bandaid against wrong datadir computation
71 #
72 if [ -e ${D}${datadir}/share ]; then
73 mv -f ${D}${datadir}/share/* ${D}${datadir}/
74 rmdir ${D}${datadir}/share
75 fi
76
77 # Fix backport modules
78 if [ -e ${STAGING_LIBDIR}/${PYTHON_DIR}/site-packages/backports/__init__.py ] &&
79 [ -e ${D}${PYTHON_SITEPACKAGES_DIR}/backports/__init__.py ]; then
80 rm ${D}${PYTHON_SITEPACKAGES_DIR}/backports/__init__.py;
81 rm ${D}${PYTHON_SITEPACKAGES_DIR}/backports/__init__.pyc;
82 fi
83}
84
85EXPORT_FUNCTIONS do_configure do_compile do_install
86
87export LDSHARED="${CCLD} -shared"