Reduce (but not completely eliminate yet) Python 2.x dependencies
cover Reduce (but not completely eliminate yet) Python 2.x dependencies
This patchset reduces the amount of Python 2.x dependencies in oe-core recipes. Several approaches were taken:
1) If a recipe needs Python 2 only during build to run python scripts, host python is used instead of natively build python.
2) If a recipe needs Python 2 at runtime because it packages some python scripts, those scripts are changed to run under Python 3 whenever possible, or are removed if they are not useful in embedded context.
3) Some py2 library recipes are removed altogether, because nothing is actually using them anymore.
There are still a few py2 holdouts:
- python-numpy (needed by a few recipes in meta-oe, shares code with python3-numpy)
- python-nose (dependency of python-numpy)
- python-scons (work to port it to py3 is ongoing now)
- python-setuptools (dependency of python-scons)
- bmap-tools
- ltp
- perf
- asciidoc
And a couple of packagegroups list python 2 as well:
- packagegroup-self-hosted
- packagegroup-core-lsb
Let's revisit the situation with the above in a year or so.
The following changes since commit c80cfab0828b653012e76eba86ed0d9084ff9d5b:
rpm: properly relocate additional native tools (2017-04-25 14:05:30 +0300)
are available in the git repository at:
git://git.yoctoproject.org/poky-contrib akanavin/package-version-updates
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=akanavin/package-version-updates
Alexander Kanavin (13):
asciidoc: drop distutils inherit, not actually required
bmap-tools: switch to taking source from git
mesa: remove the git recipe
mesa: drop pythonnative inherit
mklibs-native: remove native python dependency
webkitgtk: remove native python dependency
packagegroup-self-hosted: remove python-git dependency
python-pycurl: remove the recipe
python: remove unused 2.x versions of several packages
opkg-utils: move to Python 3
mc: do not package Python-based extfs helpers
parted: move test helper scripts to Python 3
kconfig-frontends: update to 4.10.0.1
.../packagegroups/packagegroup-self-hosted.bb | 2 -
.../files/0001-Fix-installation-of-.pc-files.patch | 29 ++++++
...Switch-utils-kconfig-diff-to-use-Python-3.patch | 26 +++++
...s_3.12.0.0.bb => kconfig-frontends_4.10.0.1.bb} | 8 +-
.../mklibs/mklibs-native_0.1.43.bb | 3 +-
...0001-Switch-all-scripts-to-use-Python-3.x.patch | 112 +++++++++++++++++++++
meta/recipes-devtools/opkg-utils/opkg-utils_git.bb | 5 +-
meta/recipes-devtools/python/python-async_0.6.2.bb | 5 -
meta/recipes-devtools/python/python-git_2.1.1.bb | 7 --
meta/recipes-devtools/python/python-gitdb_0.6.4.bb | 7 --
meta/recipes-devtools/python/python-mako_1.0.6.bb | 17 ----
.../python/python-pexpect_4.2.1.bb | 28 ------
.../python/python-ptyprocess_0.5.1.bb | 23 -----
meta/recipes-devtools/python/python-pycurl.inc | 31 ------
.../python/python-pycurl/no-static-link.patch | 17 ----
.../python/python-pycurl_7.21.5.bb | 3 -
meta/recipes-devtools/python/python-six_1.10.0.bb | 4 -
meta/recipes-devtools/python/python-smmap_0.9.0.bb | 5 -
.../python/python3-pycurl_7.21.5.bb | 5 -
meta/recipes-extended/asciidoc/asciidoc_8.6.9.bb | 2 +-
meta/recipes-extended/mc/mc_4.8.18.bb | 9 +-
.../packagegroup-core-full-cmdline.bb | 1 -
.../packagegroups/packagegroup-core-lsb.bb | 1 -
...-helper-scripts-used-only-in-tests-to-Pyt.patch | 44 ++++++++
meta/recipes-extended/parted/parted_3.2.bb | 3 +-
meta/recipes-graphics/mesa/mesa.inc | 2 +-
meta/recipes-graphics/mesa/mesa_git.bb | 22 ----
meta/recipes-sato/webkit/webkitgtk_2.14.5.bb | 7 +-
meta/recipes-support/bmap-tools/bmap-tools_3.2.bb | 9 +-
29 files changed, 233 insertions(+), 204 deletions(-)
create mode 100644 meta/recipes-devtools/kconfig-frontends/files/0001-Fix-installation-of-.pc-files.patch
create mode 100644 meta/recipes-devtools/kconfig-frontends/files/0001-Switch-utils-kconfig-diff-to-use-Python-3.patch
rename meta/recipes-devtools/kconfig-frontends/{kconfig-frontends_3.12.0.0.bb => kconfig-frontends_4.10.0.1.bb} (80%)
create mode 100644 meta/recipes-devtools/opkg-utils/opkg-utils/0001-Switch-all-scripts-to-use-Python-3.x.patch
delete mode 100644 meta/recipes-devtools/python/python-async_0.6.2.bb
delete mode 100644 meta/recipes-devtools/python/python-git_2.1.1.bb
delete mode 100644 meta/recipes-devtools/python/python-gitdb_0.6.4.bb
delete mode 100644 meta/recipes-devtools/python/python-mako_1.0.6.bb
delete mode 100644 meta/recipes-devtools/python/python-pexpect_4.2.1.bb
delete mode 100644 meta/recipes-devtools/python/python-ptyprocess_0.5.1.bb
delete mode 100644 meta/recipes-devtools/python/python-pycurl.inc
delete mode 100644 meta/recipes-devtools/python/python-pycurl/no-static-link.patch
delete mode 100644 meta/recipes-devtools/python/python-pycurl_7.21.5.bb
delete mode 100644 meta/recipes-devtools/python/python-six_1.10.0.bb
delete mode 100644 meta/recipes-devtools/python/python-smmap_0.9.0.bb
delete mode 100644 meta/recipes-devtools/python/python3-pycurl_7.21.5.bb
create mode 100644 meta/recipes-extended/parted/files/0001-Move-python-helper-scripts-used-only-in-tests-to-Pyt.patch
delete mode 100644 meta/recipes-graphics/mesa/mesa_git.bbSignature · 1 line
2.11.0
PATCH 1/13 asciidoc: drop distutils inherit, not actually required
--- meta/recipes-extended/asciidoc/asciidoc_8.6.9.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-extended/asciidoc/asciidoc_8.6.9.bb +1 -1
@@ -14,7 +14,7 @@ SRC_URI[sha256sum] = "78db9d0567c8ab6570a6eff7ffdf84eadd91f2dfc0a92a2d0105d323ca UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/asciidoc/files/" -inherit distutils autotools-brokensep +inherit autotools-brokensep export DESTDIR = "${D}" DEPENDS_class-native = "docbook-xml-dtd4-native"
Signature · 1 line
2.11.0
PATCH 2/13 bmap-tools: switch to taking source from git
In reply to Alexander KanavinThis is where new development happens; in particular Python 3.x support will first appear here:
https://github.com/01org/bmap-tools/issues/14
--- meta/recipes-support/bmap-tools/bmap-tools_3.2.bb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
meta/recipes-support/bmap-tools/bmap-tools_3.2.bb +5 -4
@@ -4,14 +4,15 @@ bmap. Bmaptool is a generic tool for creating the block map (bmap) for a file, \ and copying files using the block map. The idea is that large file containing \ unused blocks, like raw system image files, can be copied or flashed a lot \ faster with bmaptool than with traditional tools like "dd" or "cp"." -HOMEPAGE = "http://git.infradead.org/users/dedekind/bmap-tools.git" +HOMEPAGE = "https://github.com/01org/bmap-tools" SECTION = "console/utils" LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" -SRC_URI = "ftp://ftp.infradead.org/pub/${BPN}/${BPN}-${PV}.tgz" -SRC_URI[md5sum] = "92cdad1cb4dfa0cca7176c8e22752616" -SRC_URI[sha256sum] = "cc6c7f7dc0a37e2a32deb127308e24e6c4b80bfb54f3803c308efab02bf2d434" +SRC_URI = "git://github.com/01org/bmap-tools.git" +SRCREV = "96702a869220ab20830db916ec4ac595e1d97f92" + +S = "${WORKDIR}/git" RDEPENDS_${PN} = "python-core python-compression"
Signature · 1 line
2.11.0
PATCH 3/13 mesa: remove the git recipe
In reply to Alexander KanavinIt hasn't been touched in almost two years; clearly the idea of providing separate _git.bb recipes is not working.
--- meta/recipes-graphics/mesa/mesa_git.bb | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 meta/recipes-graphics/mesa/mesa_git.bb
meta/recipes-graphics/mesa/mesa_git.bb deleted +0 -22
@@ -1,22 +0,0 @@ -require ${BPN}.inc - -DEFAULT_PREFERENCE = "-1" - -SRCREV = "ea0d1f575c214c09ba3df12644a960e86e031766" -PV = "10.5.4+git${SRCPV}" - -SRC_URI = "git://anongit.freedesktop.org/git/mesa/mesa;branch=10.5" - -S = "${WORKDIR}/git" - -DEPENDS += "python-mako-native" - -inherit pythonnative - -#because we cannot rely on the fact that all apps will use pkgconfig, -#make eglplatform.h independent of MESA_EGL_NO_X11_HEADER -do_install_append() { - if ${@bb.utils.contains('PACKAGECONFIG', 'egl', 'true', 'false', d)}; then - sed -i -e 's/^#if defined(MESA_EGL_NO_X11_HEADERS)$/#if defined(MESA_EGL_NO_X11_HEADERS) || ${@bb.utils.contains('PACKAGECONFIG', 'x11', '0', '1', d)}/' ${D}${includedir}/EGL/eglplatform.h - fi -}
Signature · 1 line
2.11.0
PATCH 4/13 mesa: drop pythonnative inherit
In reply to Alexander KanavinMesa is perfectly capable of using host python nowadays.
--- meta/recipes-graphics/mesa/mesa.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-graphics/mesa/mesa.inc +1 -1
@@ -18,7 +18,7 @@ DEPENDS = "expat makedepend-native flex-native bison-native libxml2-native" PROVIDES = "virtual/libgl virtual/libgles1 virtual/libgles2 virtual/egl virtual/mesa" -inherit autotools pkgconfig pythonnative gettext distro_features_check +inherit autotools pkgconfig gettext distro_features_check REQUIRED_DISTRO_FEATURES = "opengl"
Signature · 1 line
2.11.0
PATCH 5/13 mklibs-native: remove native python dependency
In reply to Alexander KanavinIt's not actually required; host python is fine.
--- meta/recipes-devtools/mklibs/mklibs-native_0.1.43.bb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
meta/recipes-devtools/mklibs/mklibs-native_0.1.43.bb +1 -2
@@ -4,7 +4,6 @@ HOMEPAGE = "https://launchpad.net/mklibs" SECTION = "devel" LICENSE = "GPLv2+" LIC_FILES_CHKSUM = "file://debian/copyright;md5=98d31037b13d896e33890738ef01af64" -DEPENDS = "python-native" SRC_URI = "http://snapshot.debian.org/archive/debian/20161123T152011Z/pool/main/m/mklibs/mklibs_${PV}.tar.xz \ file://ac_init_fix.patch\
@@ -20,6 +19,6 @@ SRC_URI[sha256sum] = "6f0cf24ade13fff76e943c003413d85c3e497c984c95c1ecea1c9731ca UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/m/mklibs/" -inherit autotools gettext native pythonnative +inherit autotools gettext native S = "${WORKDIR}/mklibs"
Signature · 1 line
2.11.0
PATCH 6/13 webkitgtk: remove native python dependency
In reply to Alexander KanavinUsing host python seems to be fine.
--- meta/recipes-sato/webkit/webkitgtk_2.14.5.bb | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
meta/recipes-sato/webkit/webkitgtk_2.14.5.bb +1 -6
@@ -28,11 +28,6 @@ SRC_URI[sha256sum] = "3ca8f1c33a9b43d6c753dcac1c0788656930e06382b10fdf5c2805ea8f inherit cmake pkgconfig gobject-introspection perlnative distro_features_check upstream-version-is-even gtk-doc -# We cannot inherit pythonnative because that would conflict with inheriting python3native -# (which is done by gobject-introspection). But webkit only needs the path to native Python 2.x binary -# so we simply set it explicitly here. -EXTRANATIVEPATH += "python-native" - # depends on libxt REQUIRED_DISTRO_FEATURES = "x11"
@@ -41,7 +36,6 @@ DEPENDS = "zlib libsoup-2.4 curl libxml2 cairo libxslt libxt libidn gnutls \ pango icu bison-native gawk intltool-native libwebp \ atk udev harfbuzz jpeg libpng pulseaudio librsvg libtheora libvorbis libxcomposite libxtst \ ruby-native libnotify gstreamer1.0-plugins-bad \ - python-native \ " PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', 'wayland' ,d)} \
@@ -67,6 +61,7 @@ EXTRA_OECMAKE = " \ ${@bb.utils.contains('GI_DATA_ENABLED', 'True', '-DENABLE_INTROSPECTION=ON', '-DENABLE_INTROSPECTION=OFF', d)} \ ${@bb.utils.contains('GTKDOC_ENABLED', 'True', '-DENABLE_GTKDOC=ON', '-DENABLE_GTKDOC=OFF', d)} \ -DENABLE_MINIBROWSER=ON \ + -DPYTHON_EXECUTABLE=`which python` \ " # Javascript JIT is not supported on powerpc
Signature · 1 line
2.11.0
PATCH 7/13 packagegroup-self-hosted: remove python-git dependency
In reply to Alexander KanavinOnly python3-git is needed anymore.
--- meta/recipes-core/packagegroups/packagegroup-self-hosted.bb | 1 - 1 file changed, 1 deletion(-)
meta/recipes-core/packagegroups/packagegroup-self-hosted.bb +0 -1
@@ -151,7 +151,6 @@ RDEPENDS_packagegroup-self-hosted-extended = "\ perl-pod \ python \ python-modules \ - python-git \ python3 \ python3-modules \ python3-git \
Signature · 1 line
2.11.0
PATCH 8/13 python-pycurl: remove the recipe
In reply to Alexander KanavinNothing is using it in oe-core or meta-oe layers.
--- meta/recipes-devtools/python/python-pycurl.inc | 31 ---------------------- .../python/python-pycurl/no-static-link.patch | 17 ------------ .../python/python-pycurl_7.21.5.bb | 3 --- .../python/python3-pycurl_7.21.5.bb | 5 ---- 4 files changed, 56 deletions(-) delete mode 100644 meta/recipes-devtools/python/python-pycurl.inc delete mode 100644 meta/recipes-devtools/python/python-pycurl/no-static-link.patch delete mode 100644 meta/recipes-devtools/python/python-pycurl_7.21.5.bb delete mode 100644 meta/recipes-devtools/python/python3-pycurl_7.21.5.bb
meta/recipes-devtools/python/python-pycurl.inc deleted +0 -31
@@ -1,31 +0,0 @@ -SUMMARY = "Python bindings for libcurl" -HOMEPAGE = "http://pycurl.sourceforge.net/" -SECTION = "devel/python" -LICENSE = "LGPLv2.1+ | MIT" -LIC_FILES_CHKSUM = "file://README.rst;beginline=166;endline=182;md5=a84a1caa65b89d4584b693d3680062fb \ - file://COPYING-LGPL;md5=3579a9fd0221d49a237aaa33492f988c \ - file://COPYING-MIT;md5=b7e434aeb228ed731c00bcf177e79b19" - -DEPENDS = "curl ${PYTHON_PN}" -RDEPENDS_${PN} = "${PYTHON_PN}-core curl" -SRCNAME = "pycurl" - -SRC_URI = "\ - http://${SRCNAME}.sourceforge.net/download/${SRCNAME}-${PV}.tar.gz;name=archive \ - file://no-static-link.patch \ -" - -SRC_URI[archive.md5sum] = "bca7bf47320082588db544ced2ba8717" -SRC_URI[archive.sha256sum] = "8a1e0eb55573388275a1d6c2534ca4cfca5d7fa772b99b505c08fa149b27aed0" -S = "${WORKDIR}/${SRCNAME}-${PV}" - -BBCLASSEXTEND = "native" - -# Ensure the docstrings are generated as make clean will remove them -do_compile_prepend() { - ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py docstrings -} - -do_install_append() { - rm -rf ${D}${datadir}/share -}
meta/recipes-devtools/python/python-pycurl/no-static-link.patch deleted +0 -17
@@ -1,17 +0,0 @@ -Upstream-Status: Pending - -Signed-off-by: Laurentiu Palcu <[email protected]> -Signed-off-by: Maxin B. John <[email protected]> ---- -diff -Naur pycurl-7.19.5.2-orig/setup.py pycurl-7.19.5.2/setup.py ---- pycurl-7.19.5.2-orig/setup.py 2015-11-02 15:42:24.000000000 +0200 -+++ pycurl-7.19.5.2/setup.py 2015-11-02 17:59:36.121527273 +0200 -@@ -154,7 +154,7 @@ - optbuf = '' - sslhintbuf = '' - errtext = '' -- for option in ["--libs", "--static-libs"]: -+ for option in ["--libs"]: - p = subprocess.Popen((CURL_CONFIG, option), - stdout=subprocess.PIPE, stderr=subprocess.PIPE) - stdout, stderr = p.communicate()
meta/recipes-devtools/python/python-pycurl_7.21.5.bb deleted +0 -3
@@ -1,3 +0,0 @@ -require python-pycurl.inc - -inherit distutils
meta/recipes-devtools/python/python3-pycurl_7.21.5.bb deleted +0 -5
@@ -1,5 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/python-pycurl:" - -require python-pycurl.inc - -inherit distutils3
Signature · 1 line
2.11.0
PATCH 9/13 python: remove unused 2.x versions of several packages
In reply to Alexander KanavinNothing is using them in oe-core or meta-oe layers (except python-six is used by and provided in meta-oe, so there was recipe duplication).
--- meta/recipes-devtools/python/python-async_0.6.2.bb | 5 ---- meta/recipes-devtools/python/python-git_2.1.1.bb | 7 ------ meta/recipes-devtools/python/python-gitdb_0.6.4.bb | 7 ------ meta/recipes-devtools/python/python-mako_1.0.6.bb | 17 ------------- .../python/python-pexpect_4.2.1.bb | 28 ---------------------- .../python/python-ptyprocess_0.5.1.bb | 23 ------------------ meta/recipes-devtools/python/python-six_1.10.0.bb | 4 ---- meta/recipes-devtools/python/python-smmap_0.9.0.bb | 5 ---- 8 files changed, 96 deletions(-) delete mode 100644 meta/recipes-devtools/python/python-async_0.6.2.bb delete mode 100644 meta/recipes-devtools/python/python-git_2.1.1.bb delete mode 100644 meta/recipes-devtools/python/python-gitdb_0.6.4.bb delete mode 100644 meta/recipes-devtools/python/python-mako_1.0.6.bb delete mode 100644 meta/recipes-devtools/python/python-pexpect_4.2.1.bb delete mode 100644 meta/recipes-devtools/python/python-ptyprocess_0.5.1.bb delete mode 100644 meta/recipes-devtools/python/python-six_1.10.0.bb delete mode 100644 meta/recipes-devtools/python/python-smmap_0.9.0.bb
meta/recipes-devtools/python/python-async_0.6.2.bb deleted +0 -5
@@ -1,5 +0,0 @@ -require python-async.inc - -inherit setuptools - -RDEPENDS_${PN} += "python-threading python-lang"
meta/recipes-devtools/python/python-git_2.1.1.bb deleted +0 -7
@@ -1,7 +0,0 @@ -require python-git.inc - -DEPENDS = "python-gitdb" - -inherit setuptools - -RDEPENDS_${PN} += "python-gitdb python-lang python-io python-shell python-math python-re python-subprocess python-stringold python-unixadmin"
meta/recipes-devtools/python/python-gitdb_0.6.4.bb deleted +0 -7
@@ -1,7 +0,0 @@ -require python-gitdb.inc - -DEPENDS = "python-async python-smmap" - -inherit distutils - -RDEPENDS_${PN} += "python-smmap python-async python-mmap python-lang python-zlib python-io python-shell"
meta/recipes-devtools/python/python-mako_1.0.6.bb deleted +0 -17
@@ -1,17 +0,0 @@ -require python-mako.inc - -inherit setuptools - -RDEPENDS_${PN} = "python-threading \ - python-netclient \ - python-html \ -" -RDEPENDS_${PN}_class-native = "" - -BBCLASSEXTEND = "native nativesdk" - -# The same utility is packaged in python3-mako, so it would conflict -do_install_append() { - rm -f ${D}${bindir}/mako-render - rmdir ${D}${bindir} -}
meta/recipes-devtools/python/python-pexpect_4.2.1.bb deleted +0 -28
@@ -1,28 +0,0 @@ -SUMMARY = "A Pure Python Expect like Module for Python" -HOMEPAGE = "http://pexpect.readthedocs.org/" -SECTION = "devel/python" -LICENSE = "ISC" -LIC_FILES_CHKSUM = "file://LICENSE;md5=1c7a725251880af8c6a148181665385b" - -SRCNAME = "pexpect" - -SRC_URI = "https://files.pythonhosted.org/packages/source/p/${SRCNAME}/${SRCNAME}-${PV}.tar.gz" -SRC_URI[md5sum] = "3694410001a99dff83f0b500a1ca1c95" -SRC_URI[sha256sum] = "3d132465a75b57aa818341c6521392a06cc660feb3988d7f1074f39bd23c9a92" - -UPSTREAM_CHECK_URI = "https://pypi.python.org/pypi/pexpect" - -S = "${WORKDIR}/pexpect-${PV}" - -inherit setuptools - -RDEPENDS_${PN} = "\ - python-core \ - python-io \ - python-terminal \ - python-resource \ - python-fcntl \ - python-ptyprocess \ -" - -BBCLASSEXTEND = "native nativesdk"
meta/recipes-devtools/python/python-ptyprocess_0.5.1.bb deleted +0 -23
@@ -1,23 +0,0 @@ -SUMMARY = "Run a subprocess in a pseudo terminal" -HOMEPAGE = "http://ptyprocess.readthedocs.io/en/latest/" -SECTION = "devel/python" -LICENSE = "ISC" -LIC_FILES_CHKSUM = "file://LICENSE;md5=cfdcd51fa7d5808da4e74346ee394490" - -SRCNAME = "ptyprocess" - -SRC_URI = "https://files.pythonhosted.org/packages/source/p/${SRCNAME}/${SRCNAME}-${PV}.tar.gz" -SRC_URI[md5sum] = "94e537122914cc9ec9c1eadcd36e73a1" -SRC_URI[sha256sum] = "0530ce63a9295bfae7bd06edc02b6aa935619f486f0f1dc0972f516265ee81a6" - -UPSTREAM_CHECK_URI = "https://pypi.python.org/pypi/ptyprocess" - -S = "${WORKDIR}/${SRCNAME}-${PV}" - -inherit setuptools - -RDEPENDS_${PN} = "\ - python-core \ -" - -BBCLASSEXTEND = "native nativesdk"
meta/recipes-devtools/python/python-six_1.10.0.bb deleted +0 -4
@@ -1,4 +0,0 @@ -inherit setuptools -require python-six.inc - -RDEPENDS_${PN} += "python-io"
meta/recipes-devtools/python/python-smmap_0.9.0.bb deleted +0 -5
@@ -1,5 +0,0 @@ -require python-smmap.inc - -inherit setuptools - -RDEPENDS_${PN} += "python-codecs python-mmap python-lang"
Signature · 1 line
2.11.0
PATCH 10/13 opkg-utils: move to Python 3
In reply to Alexander KanavinThe scripts were fixed to be compatible with py3 some time ago, but the shebang continued to refer to python 2.x.
--- ...0001-Switch-all-scripts-to-use-Python-3.x.patch | 112 +++++++++++++++++++++ meta/recipes-devtools/opkg-utils/opkg-utils_git.bb | 5 +- 2 files changed, 115 insertions(+), 2 deletions(-) create mode 100644 meta/recipes-devtools/opkg-utils/opkg-utils/0001-Switch-all-scripts-to-use-Python-3.x.patch
meta/recipes-devtools/opkg-utils/opkg-utils/0001-Switch-all-scripts-to-use-Python-3.x.patch new file +112 -0
@@ -0,0 +1,112 @@ +From d42b23f4fb5d6bd58e92e995fe5befc76efbae0c Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <[email protected]> +Date: Thu, 27 Apr 2017 15:47:58 +0300 +Subject: [PATCH] Switch all scripts to use Python 3.x + +Upstream-Status: Pending +Signed-off-by: Alexander Kanavin <[email protected]> +--- + makePackage | 2 +- + opkg-compare-indexes | 2 +- + opkg-graph-deps | 2 +- + opkg-list-fields | 2 +- + opkg-make-index | 2 +- + opkg-show-deps | 2 +- + opkg-unbuild | 2 +- + opkg-update-index | 2 +- + opkg.py | 2 +- + 9 files changed, 9 insertions(+), 9 deletions(-) + +diff --git a/makePackage b/makePackage +index 4bdfc56..02124dd 100755 +--- a/makePackage ++++ b/makePackage +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/env python3 + + # The general algorithm this program follows goes like this: + # Run tar to extract control from control.tar.gz from the package. +diff --git a/opkg-compare-indexes b/opkg-compare-indexes +index b60d20a..80c1263 100755 +--- a/opkg-compare-indexes ++++ b/opkg-compare-indexes +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + from __future__ import absolute_import + from __future__ import print_function + +diff --git a/opkg-graph-deps b/opkg-graph-deps +index 6653fd5..f1e376a 100755 +--- a/opkg-graph-deps ++++ b/opkg-graph-deps +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + from __future__ import absolute_import + from __future__ import print_function + +diff --git a/opkg-list-fields b/opkg-list-fields +index c14a90f..24f7955 100755 +--- a/opkg-list-fields ++++ b/opkg-list-fields +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + from __future__ import absolute_import + from __future__ import print_function + +diff --git a/opkg-make-index b/opkg-make-index +index 3f757f6..2988f9f 100755 +--- a/opkg-make-index ++++ b/opkg-make-index +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + from __future__ import absolute_import + from __future__ import print_function + +diff --git a/opkg-show-deps b/opkg-show-deps +index 153f21e..4e18b4f 100755 +--- a/opkg-show-deps ++++ b/opkg-show-deps +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + from __future__ import absolute_import + from __future__ import print_function + +diff --git a/opkg-unbuild b/opkg-unbuild +index 4f36bec..57642c9 100755 +--- a/opkg-unbuild ++++ b/opkg-unbuild +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + from __future__ import absolute_import + from __future__ import print_function + +diff --git a/opkg-update-index b/opkg-update-index +index 341c1c2..7bff8a1 100755 +--- a/opkg-update-index ++++ b/opkg-update-index +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + from __future__ import absolute_import + + import sys, os +diff --git a/opkg.py b/opkg.py +index 2ecac8a..7e64de4 100644 +--- a/opkg.py ++++ b/opkg.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # Copyright (C) 2001 Alexander S. Guy <[email protected]> + # Andern Research Labs + # +-- +2.11.0 +
meta/recipes-devtools/opkg-utils/opkg-utils_git.bb +3 -2
@@ -4,13 +4,14 @@ SECTION = "base" HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/opkg-utils" LICENSE = "GPLv2+" LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ - file://opkg.py;beginline=1;endline=18;md5=15917491ad6bf7acc666ca5f7cc1e083" + file://opkg.py;beginline=2;endline=18;md5=63ce9e6bcc445181cd9e4baf4b4ccc35" PROVIDES += "${@bb.utils.contains('PACKAGECONFIG', 'update-alternatives', 'virtual/update-alternatives', '', d)}" SRCREV = "1a708fd73d10c2b7677dd4cc4e017746ebbb9166" PV = "0.3.4+git${SRCPV}" SRC_URI = "git://git.yoctoproject.org/opkg-utils \ + file://0001-Switch-all-scripts-to-use-Python-3.x.patch \ " SRC_URI_append_class-native = " file://tar_ignore_error.patch"
@@ -18,7 +19,7 @@ S = "${WORKDIR}/git" TARGET_CC_ARCH += "${LDFLAGS}" -PYTHONRDEPS = "python python-shell python-io python-math python-crypt python-logging python-fcntl python-subprocess python-pickle python-compression python-textutils python-stringold" +PYTHONRDEPS = "python3 python3-shell python3-io python3-math python3-crypt python3-logging python3-fcntl python3-subprocess python3-pickle python3-compression python3-textutils python3-stringold" PYTHONRDEPS_class-native = "" PACKAGECONFIG = "python update-alternatives"
Signature · 1 line
2.11.0
PATCH 11/13 mc: do not package Python-based extfs helpers
In reply to Alexander KanavinThey have not been ported to Python 3, and they are for browsing Amazon s3+ and Commodore 64/128 emulator filesystems - hardly consequential.
--- meta/recipes-core/packagegroups/packagegroup-self-hosted.bb | 1 - meta/recipes-extended/mc/mc_4.8.18.bb | 9 +++------ .../packagegroups/packagegroup-core-full-cmdline.bb | 1 - meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb | 1 - 4 files changed, 3 insertions(+), 9 deletions(-)
meta/recipes-core/packagegroups/packagegroup-self-hosted.bb +0 -1
@@ -42,7 +42,6 @@ RDEPENDS_packagegroup-self-hosted-host-tools = "\ mc-fish \ mc-helpers \ mc-helpers-perl \ - mc-helpers-python \ parted \ ${PSEUDO} \ screen \
meta/recipes-extended/mc/mc_4.8.18.bb +3 -6
@@ -27,10 +27,11 @@ CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl'" do_install_append () { sed -i -e '1s,#!.*perl,#!${bindir}/env perl,' ${D}${libexecdir}/mc/extfs.d/* - sed -i -e '1s,#!.*python,#!${bindir}/env python,' ${D}${libexecdir}/mc/extfs.d/* + + rm ${D}${libexecdir}/mc/extfs.d/s3+ ${D}${libexecdir}/mc/extfs.d/uc1541 } -PACKAGES =+ "${BPN}-helpers-perl ${BPN}-helpers-python ${BPN}-helpers ${BPN}-fish" +PACKAGES =+ "${BPN}-helpers-perl ${BPN}-helpers ${BPN}-fish" SUMMARY_${BPN}-helpers-perl = "Midnight Commander Perl-based helper scripts" FILES_${BPN}-helpers-perl = "${libexecdir}/mc/extfs.d/a+ ${libexecdir}/mc/extfs.d/apt+ \
@@ -41,10 +42,6 @@ FILES_${BPN}-helpers-perl = "${libexecdir}/mc/extfs.d/a+ ${libexecdir}/mc/extfs. ${libexecdir}/mc/extfs.d/uzip" RDEPENDS_${BPN}-helpers-perl = "perl" -SUMMARY_${BPN}-helpers-python = "Midnight Commander Python-based helper scripts" -FILES_${BPN}-helpers-python = "${libexecdir}/mc/extfs.d/s3+ ${libexecdir}/mc/extfs.d/uc1541" -RDEPENDS_${BPN}-helpers-python = "python" - SUMMARY_${BPN}-helpers = "Midnight Commander shell helper scripts" FILES_${BPN}-helpers = "${libexecdir}/mc/extfs.d/* ${libexecdir}/mc/ext.d/*"
meta/recipes-extended/packagegroups/packagegroup-core-full-cmdline.bb +0 -1
@@ -86,7 +86,6 @@ RDEPENDS_packagegroup-core-full-cmdline-utils = "\ mc-fish \ mc-helpers \ mc-helpers-perl \ - mc-helpers-python \ mktemp \ ncurses \ net-tools \
meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb +0 -1
@@ -66,7 +66,6 @@ RDEPENDS_packagegroup-core-sys-extended = "\ mc-fish \ mc-helpers \ mc-helpers-perl \ - mc-helpers-python \ mdadm \ minicom \ neon \
Signature · 1 line
2.11.0
PATCH 12/13 parted: move test helper scripts to Python 3
In reply to Alexander Kanavin--- ...-helper-scripts-used-only-in-tests-to-Pyt.patch | 44 ++++++++++++++++++++++ meta/recipes-extended/parted/parted_3.2.bb | 3 +- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-extended/parted/files/0001-Move-python-helper-scripts-used-only-in-tests-to-Pyt.patch
meta/recipes-extended/parted/files/0001-Move-python-helper-scripts-used-only-in-tests-to-Pyt.patch new file +44 -0
@@ -0,0 +1,44 @@ +From 6e82af54714392dcdf74a8aedaae7de7d0af1080 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <[email protected]> +Date: Thu, 27 Apr 2017 16:37:24 +0300 +Subject: [PATCH] Move python helper scripts (used only in tests) to Python 3 + +Upstream-Status: Pending +Signed-off-by: Alexander Kanavin <[email protected]> +--- + tests/gpt-header-move | 2 +- + tests/msdos-overlap | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/tests/gpt-header-move b/tests/gpt-header-move +index 05cdc65..3cbcb7e 100755 +--- a/tests/gpt-header-move ++++ b/tests/gpt-header-move +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/env python3 + + # open img file, subtract 33 from altlba address, and move the last 33 sectors + # back by 33 sectors +diff --git a/tests/msdos-overlap b/tests/msdos-overlap +index 5bddfb0..3de7d2e 100755 +--- a/tests/msdos-overlap ++++ b/tests/msdos-overlap +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/env python3 + """ + Write an overlapping partition to a msdos disk + +@@ -14,7 +14,7 @@ BAD_ENTRY = (0x72, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + OFFSET = 0x1b8 + + if len(sys.argv) < 2: +- print "%s: <image or device>" ++ print("%s: <image or device>") + sys.exit(1) + + data = "".join(chr(c) for c in BAD_ENTRY) +-- +2.11.0 +
meta/recipes-extended/parted/parted_3.2.bb +2 -1
@@ -14,6 +14,7 @@ SRC_URI = "${GNU_MIRROR}/parted/parted-${PV}.tar.xz \ file://0001-Include-fcntl.h-in-platform_defs.h.patch \ file://0001-Unset-need_charset_alias-when-building-for-musl.patch \ file://0002-libparted_fs_resize-link-against-libuuid-explicitly-.patch \ + file://0001-Move-python-helper-scripts-used-only-in-tests-to-Pyt.patch \ file://parted-3.2-sysmacros.patch \ file://run-ptest \ file://Makefile \
@@ -46,4 +47,4 @@ do_install_ptest() { sed -e 's| ../parted||' -i $t/tests/*.sh } -RDEPENDS_${PN}-ptest = "bash coreutils perl util-linux-losetup python" +RDEPENDS_${PN}-ptest = "bash coreutils perl util-linux-losetup python3"
Signature · 1 line
2.11.0
PATCH 13/13 kconfig-frontends: update to 4.10.0.1
In reply to Alexander KanavinAdd a couple of patches:
- move python script to use Python 3
- fix .pc file installation path
---
.../files/0001-Fix-installation-of-.pc-files.patch | 29 ++++++++++++++++++++++
...Switch-utils-kconfig-diff-to-use-Python-3.patch | 26 +++++++++++++++++++
...s_3.12.0.0.bb => kconfig-frontends_4.10.0.1.bb} | 8 +++---
3 files changed, 60 insertions(+), 3 deletions(-)
create mode 100644 meta/recipes-devtools/kconfig-frontends/files/0001-Fix-installation-of-.pc-files.patch
create mode 100644 meta/recipes-devtools/kconfig-frontends/files/0001-Switch-utils-kconfig-diff-to-use-Python-3.patch
rename meta/recipes-devtools/kconfig-frontends/{kconfig-frontends_3.12.0.0.bb => kconfig-frontends_4.10.0.1.bb} (80%)meta/recipes-devtools/kconfig-frontends/files/0001-Fix-installation-of-.pc-files.patch new file +29 -0
@@ -0,0 +1,29 @@ +From 80c16b1f39402e8ce33600e5f297920a6d603090 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <[email protected]> +Date: Thu, 27 Apr 2017 16:57:06 +0300 +Subject: [PATCH] Fix installation of .pc files + +They go to prefix/pkgconfig/, not prefix/pkg-config. + +Upstream-Status: Pending +Signed-off-by: Alexander Kanavin <[email protected]> +--- + Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile.am b/Makefile.am +index 058690a..f9e9b7b 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -107,7 +107,7 @@ EXTRA_DIST += \ + libs/parser/yconf.y.patch + + # libs/parser/kconfig-parser.pc generated by AC_CONFIG_FILES in configure.ac +-pkgconfigdir = $(libdir)/pkg-config ++pkgconfigdir = $(libdir)/pkgconfig + pkgconfig_DATA = libs/parser/kconfig-parser.pc + DISTCLEANFILES += libs/parser/kconfig-parser.pc + EXTRA_DIST += libs/parser/kconfig-parser.pc.in +-- +2.11.0 +
meta/recipes-devtools/kconfig-frontends/files/0001-Switch-utils-kconfig-diff-to-use-Python-3.patch new file +26 -0
@@ -0,0 +1,26 @@ +From 3b9b0f82c33f793a14d44bf06b6c8136bc3fc4bf Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <[email protected]> +Date: Thu, 27 Apr 2017 16:48:42 +0300 +Subject: [PATCH] Switch utils/kconfig-diff to use Python 3 + +The script supports it, but continues to refer to 2.x in shebang. + +Upstream-Status: Pending +Signed-off-by: Alexander Kanavin <[email protected]> +--- + utils/kconfig-diff | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/utils/kconfig-diff b/utils/kconfig-diff +index 0db267d..19189f3 100755 +--- a/utils/kconfig-diff ++++ b/utils/kconfig-diff +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/env python3 + # + # diffconfig - a tool to compare .config files. + # +-- +2.11.0 +
meta/recipes-devtools/kconfig-frontends/kconfig-frontends_4.10.0.1.bb renamed from meta/recipes-devtools/kconfig-frontends/kconfig-frontends_3.12.0.0.bb +5 -3
@@ -12,10 +12,12 @@ LICENSE = "GPL-2.0" LIC_FILES_CHKSUM = "file://COPYING;md5=9b8cf60ff39767ff04b671fca8302408" SECTION = "devel" DEPENDS += "ncurses flex bison gperf-native" -RDEPENDS_${PN} += "python bash" -SRC_URI = "git://ymorin.is-a-geek.org/kconfig-frontends" +RDEPENDS_${PN} += "python3 bash" +SRC_URI = "git://ymorin.is-a-geek.org/kconfig-frontends;branch=4.10.x \ + file://0001-Fix-installation-of-.pc-files.patch \ + file://0001-Switch-utils-kconfig-diff-to-use-Python-3.patch" -SRCREV = "75d35b172fc0f7b6620dd659af41f2ce04edc4e6" +SRCREV = "f8ffe5e1c6f183cb7d5d515aa9381b7557de654e" S = "${WORKDIR}/git"
Signature · 1 line
2.11.0
Quoted 4 lines · Alexander Kanavin
And a couple of packagegroups list python 2 as well:
- packagegroup-self-hosted
- packagegroup-core-lsb
selfhosted will need it as long as we need it, and I can't imagine LSB has dropped py2...
Ross