diff options
author | Ross Burton <ross.burton@intel.com> | 2020-01-17 14:16:32 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-01-19 13:24:38 +0000 |
commit | 2ed5d927ca9b88d3964ada990ef46cdd38ec4b1e (patch) | |
tree | 2110d3e9381867553c69ae5c743887e1caa97926 /meta/classes | |
parent | 2b5cf2a067cb6d9ca32d851dacdc1aff0cbfe904 (diff) | |
download | poky-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')
-rw-r--r-- | meta/classes/distutils-base.bbclass | 4 | ||||
-rw-r--r-- | meta/classes/distutils.bbclass | 87 | ||||
-rw-r--r-- | meta/classes/python-dir.bbclass | 5 | ||||
-rw-r--r-- | meta/classes/pythonnative.bbclass | 27 | ||||
-rw-r--r-- | meta/classes/setuptools.bbclass | 3 |
5 files changed, 0 insertions, 126 deletions
diff --git a/meta/classes/distutils-base.bbclass b/meta/classes/distutils-base.bbclass deleted file mode 100644 index 9f398d7051..0000000000 --- a/meta/classes/distutils-base.bbclass +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | DEPENDS += "${@["${PYTHON_PN}-native ${PYTHON_PN}", ""][(d.getVar('PACKAGES') == '')]}" | ||
2 | RDEPENDS_${PN} += "${@['', '${PYTHON_PN}-core']['${CLASSOVERRIDE}' == 'class-target']}" | ||
3 | |||
4 | inherit distutils-common-base pythonnative | ||
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 @@ | |||
1 | inherit distutils-base | ||
2 | |||
3 | DISTUTILS_BUILD_ARGS ?= "" | ||
4 | DISTUTILS_STAGE_HEADERS_ARGS ?= "--install-dir=${STAGING_INCDIR}/${PYTHON_DIR}" | ||
5 | DISTUTILS_STAGE_ALL_ARGS ?= "--prefix=${STAGING_DIR_HOST}${prefix} \ | ||
6 | --install-data=${STAGING_DATADIR}" | ||
7 | DISTUTILS_INSTALL_ARGS ?= "--root=${D} \ | ||
8 | --prefix=${prefix} \ | ||
9 | --install-lib=${PYTHON_SITEPACKAGES_DIR} \ | ||
10 | --install-data=${datadir}" | ||
11 | |||
12 | DISTUTILS_PYTHON = "python" | ||
13 | DISTUTILS_PYTHON_class-native = "nativepython" | ||
14 | |||
15 | distutils_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 | |||
22 | distutils_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 | |||
30 | distutils_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 | |||
36 | distutils_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 | |||
45 | distutils_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 | |||
85 | EXPORT_FUNCTIONS do_configure do_compile do_install | ||
86 | |||
87 | export LDSHARED="${CCLD} -shared" | ||
diff --git a/meta/classes/python-dir.bbclass b/meta/classes/python-dir.bbclass deleted file mode 100644 index a11dc350be..0000000000 --- a/meta/classes/python-dir.bbclass +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | PYTHON_BASEVERSION = "2.7" | ||
2 | PYTHON_ABI = "" | ||
3 | PYTHON_DIR = "python${PYTHON_BASEVERSION}" | ||
4 | PYTHON_PN = "python" | ||
5 | PYTHON_SITEPACKAGES_DIR = "${libdir}/${PYTHON_DIR}/site-packages" | ||
diff --git a/meta/classes/pythonnative.bbclass b/meta/classes/pythonnative.bbclass deleted file mode 100644 index 0e9019d1e2..0000000000 --- a/meta/classes/pythonnative.bbclass +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | |||
2 | inherit python-dir | ||
3 | |||
4 | PYTHON="${STAGING_BINDIR_NATIVE}/python-native/python" | ||
5 | # PYTHON_EXECUTABLE is used by cmake | ||
6 | PYTHON_EXECUTABLE="${PYTHON}" | ||
7 | EXTRANATIVEPATH += "python-native" | ||
8 | DEPENDS_append = " python-native " | ||
9 | |||
10 | # python-config and other scripts are using distutils modules | ||
11 | # which we patch to access these variables | ||
12 | export STAGING_INCDIR | ||
13 | export STAGING_LIBDIR | ||
14 | |||
15 | # Packages can use | ||
16 | # find_package(PythonInterp REQUIRED) | ||
17 | # find_package(PythonLibs REQUIRED) | ||
18 | # which ends up using libs/includes from build host | ||
19 | # Therefore pre-empt that effort | ||
20 | export PYTHON_LIBRARY="${STAGING_LIBDIR}/lib${PYTHON_DIR}${PYTHON_ABI}.so" | ||
21 | export PYTHON_INCLUDE_DIR="${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI}" | ||
22 | |||
23 | # suppress host user's site-packages dirs. | ||
24 | export PYTHONNOUSERSITE = "1" | ||
25 | |||
26 | # autoconf macros will use their internal default preference otherwise | ||
27 | export PYTHON | ||
diff --git a/meta/classes/setuptools.bbclass b/meta/classes/setuptools.bbclass deleted file mode 100644 index a923ea3c4a..0000000000 --- a/meta/classes/setuptools.bbclass +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | inherit distutils | ||
2 | |||
3 | DEPENDS += "python-setuptools-native" | ||