diff options
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/classes/python_pep517.bbclass | 27 | ||||
| -rw-r--r-- | meta/recipes-devtools/python/python3-flit-core_3.7.1.bb | 2 | ||||
| -rw-r--r-- | meta/recipes-devtools/python/python3-pip_22.0.3.bb | 35 | ||||
| -rw-r--r-- | meta/recipes-devtools/python/python3-setuptools_59.5.0.bb | 12 | ||||
| -rw-r--r-- | meta/recipes-devtools/python/python3-wheel_0.37.1.bb | 26 |
5 files changed, 18 insertions, 84 deletions
diff --git a/meta/classes/python_pep517.bbclass b/meta/classes/python_pep517.bbclass index 756333bcf2..ac7c1e44c6 100644 --- a/meta/classes/python_pep517.bbclass +++ b/meta/classes/python_pep517.bbclass | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | # Common infrastructure for Python packages that use PEP-517 compliant packaging. | 1 | # Common infrastructure for Python packages that use PEP-517 compliant packaging. |
| 2 | # https://www.python.org/dev/peps/pep-0517/ | 2 | # https://www.python.org/dev/peps/pep-0517/ |
| 3 | 3 | ||
| 4 | DEPENDS:append = " python3-pip-native" | 4 | DEPENDS:append = " python3-installer-native" |
| 5 | 5 | ||
| 6 | # Where to execute the build process from | 6 | # Where to execute the build process from |
| 7 | PEP517_SOURCE_PATH ?= "${S}" | 7 | PEP517_SOURCE_PATH ?= "${S}" |
| @@ -11,19 +11,11 @@ PEP517_SOURCE_PATH ?= "${S}" | |||
| 11 | # a recipe wants to install prebuilt wheels. | 11 | # a recipe wants to install prebuilt wheels. |
| 12 | PEP517_WHEEL_PATH ?= "${WORKDIR}/dist" | 12 | PEP517_WHEEL_PATH ?= "${WORKDIR}/dist" |
| 13 | 13 | ||
| 14 | PIP_INSTALL_ARGS = "\ | ||
| 15 | -vvvv \ | ||
| 16 | --ignore-installed \ | ||
| 17 | --no-cache \ | ||
| 18 | --no-deps \ | ||
| 19 | --no-index \ | ||
| 20 | --root=${D} \ | ||
| 21 | --prefix=${prefix} \ | ||
| 22 | " | ||
| 23 | |||
| 24 | PEP517_INSTALL_PYTHON = "python3" | 14 | PEP517_INSTALL_PYTHON = "python3" |
| 25 | PEP517_INSTALL_PYTHON:class-native = "nativepython3" | 15 | PEP517_INSTALL_PYTHON:class-native = "nativepython3" |
| 26 | 16 | ||
| 17 | INSTALL_WHEEL_COMPILE_BYTECODE ?= "--compile-bytecode=0" | ||
| 18 | |||
| 27 | python_pep517_do_install () { | 19 | python_pep517_do_install () { |
| 28 | COUNT=$(find ${PEP517_WHEEL_PATH} -name '*.whl' | wc -l) | 20 | COUNT=$(find ${PEP517_WHEEL_PATH} -name '*.whl' | wc -l) |
| 29 | if test $COUNT -eq 0; then | 21 | if test $COUNT -eq 0; then |
| @@ -32,18 +24,7 @@ python_pep517_do_install () { | |||
| 32 | bbfatal More than one wheel found in ${PEP517_WHEEL_PATH}, this should not happen | 24 | bbfatal More than one wheel found in ${PEP517_WHEEL_PATH}, this should not happen |
| 33 | fi | 25 | fi |
| 34 | 26 | ||
| 35 | nativepython3 -m pip install ${PIP_INSTALL_ARGS} ${PEP517_WHEEL_PATH}/*.whl | 27 | nativepython3 -m installer ${INSTALL_WHEEL_COMPILE_BYTECODE} --interpreter "${USRBINPATH}/env ${PEP517_INSTALL_PYTHON}" --destdir=${D} ${PEP517_WHEEL_PATH}/*.whl |
| 36 | |||
| 37 | cd ${D} | ||
| 38 | for i in ${D}${bindir}/* ${D}${sbindir}/*; do | ||
| 39 | if [ -f "$i" ]; then | ||
| 40 | sed -i -e "1s,#!.*nativepython3,#!${USRBINPATH}/env ${PEP517_INSTALL_PYTHON}," $i | ||
| 41 | sed -i -e "s:${PYTHON}:${USRBINPATH}/env\ ${PEP517_INSTALL_PYTHON}:g" $i | ||
| 42 | sed -i -e "s:${STAGING_BINDIR_NATIVE}:${bindir}:g" $i | ||
| 43 | # Not everything we find may be Python, so ignore errors | ||
| 44 | nativepython3 -mpy_compile $(realpath --relative-to=${D} $i) || true | ||
| 45 | fi | ||
| 46 | done | ||
| 47 | } | 28 | } |
| 48 | 29 | ||
| 49 | # A manual do_install that just uses unzip for bootstrapping purposes. Callers should DEPEND on unzip-native. | 30 | # A manual do_install that just uses unzip for bootstrapping purposes. Callers should DEPEND on unzip-native. |
diff --git a/meta/recipes-devtools/python/python3-flit-core_3.7.1.bb b/meta/recipes-devtools/python/python3-flit-core_3.7.1.bb index b12b8e42d7..dc815acf08 100644 --- a/meta/recipes-devtools/python/python3-flit-core_3.7.1.bb +++ b/meta/recipes-devtools/python/python3-flit-core_3.7.1.bb | |||
| @@ -13,7 +13,7 @@ SRC_URI[sha256sum] = "3c9bd9c140515bfe62dd938c6610d10d6efb9e35cc647fc614fe5fb3a5 | |||
| 13 | inherit pypi flit_core | 13 | inherit pypi flit_core |
| 14 | 14 | ||
| 15 | # Need to install by hand as there's a dependency loop | 15 | # Need to install by hand as there's a dependency loop |
| 16 | DEPENDS:remove:class-native = " python3-pip-native" | 16 | DEPENDS:remove:class-native = " python3-installer-native" |
| 17 | DEPENDS:append:class-native = " unzip-native" | 17 | DEPENDS:append:class-native = " unzip-native" |
| 18 | 18 | ||
| 19 | # We need the full flit tarball | 19 | # We need the full flit tarball |
diff --git a/meta/recipes-devtools/python/python3-pip_22.0.3.bb b/meta/recipes-devtools/python/python3-pip_22.0.3.bb index bfeeee789c..9ca8fbc1e5 100644 --- a/meta/recipes-devtools/python/python3-pip_22.0.3.bb +++ b/meta/recipes-devtools/python/python3-pip_22.0.3.bb | |||
| @@ -6,43 +6,14 @@ LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=63ec52baf95163b597008bb46db68030" | |||
| 6 | 6 | ||
| 7 | inherit pypi setuptools_build_meta | 7 | inherit pypi setuptools_build_meta |
| 8 | 8 | ||
| 9 | DEPENDS += "python3" | ||
| 10 | |||
| 11 | # To avoid a dependency loop; we bootstrap -native | ||
| 12 | DEPENDS:remove:class-native = "python3-pip-native" | ||
| 13 | DEPENDS:append:class-native = " unzip-native" | ||
| 14 | |||
| 15 | SRC_URI += "file://0001-change-shebang-to-python3.patch" | 9 | SRC_URI += "file://0001-change-shebang-to-python3.patch" |
| 16 | SRC_URI += "file://no_shebang_mangling.patch" | 10 | SRC_URI += "file://no_shebang_mangling.patch" |
| 17 | SRC_URI += "file://reproducible.patch" | 11 | SRC_URI += "file://reproducible.patch" |
| 18 | 12 | ||
| 19 | SRC_URI[sha256sum] = "f29d589df8c8ab99c060e68ad294c4a9ed896624f6368c5349d70aa581b333d0" | 13 | SRC_URI[sha256sum] = "f29d589df8c8ab99c060e68ad294c4a9ed896624f6368c5349d70aa581b333d0" |
| 20 | 14 | ||
| 21 | do_install:class-native() { | ||
| 22 | python_pep517_do_bootstrap_install | ||
| 23 | |||
| 24 | # pip install would normally generate [console_scripts] in ${bindir} | ||
| 25 | install -d ${D}/${bindir} | ||
| 26 | # We will skip the ${bindir}/pip variant as we would just remove it in the do_install:append | ||
| 27 | cat << EOF >> ${D}/${bindir}/pip3 | tee ${D}/${bindir}/pip${PYTHON_BASEVERSION} | ||
| 28 | #!/bin/sh | ||
| 29 | '''exec' ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} "\$0" "\$@" | ||
| 30 | ' ''' | ||
| 31 | # -*- coding: utf-8 -*- | ||
| 32 | import re | ||
| 33 | import sys | ||
| 34 | from pip._internal.cli.main import main | ||
| 35 | if __name__ == '__main__': | ||
| 36 | sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) | ||
| 37 | sys.exit(main()) | ||
| 38 | EOF | ||
| 39 | chmod 0755 ${D}${bindir}/pip3 ${D}${bindir}/pip${PYTHON_BASEVERSION} | ||
| 40 | } | ||
| 41 | |||
| 42 | do_install:append() { | 15 | do_install:append() { |
| 43 | if [ -e ${D}/${bindir}/pip ]; then | 16 | rm -f ${D}/${bindir}/pip |
| 44 | rm ${D}/${bindir}/pip | ||
| 45 | fi | ||
| 46 | } | 17 | } |
| 47 | 18 | ||
| 48 | RDEPENDS:${PN} = "\ | 19 | RDEPENDS:${PN} = "\ |
| @@ -59,3 +30,7 @@ RDEPENDS:${PN} = "\ | |||
| 59 | " | 30 | " |
| 60 | 31 | ||
| 61 | BBCLASSEXTEND = "native nativesdk" | 32 | BBCLASSEXTEND = "native nativesdk" |
| 33 | |||
| 34 | # This used to use the bootstrap install which didn't compile. Until we bump the | ||
| 35 | # tmpdir version we can't compile the native otherwise the sysroot unpack fails | ||
| 36 | INSTALL_WHEEL_COMPILE_BYTECODE:class-native = "--no-compile-bytecode" | ||
diff --git a/meta/recipes-devtools/python/python3-setuptools_59.5.0.bb b/meta/recipes-devtools/python/python3-setuptools_59.5.0.bb index d93972b9a0..35bec19e33 100644 --- a/meta/recipes-devtools/python/python3-setuptools_59.5.0.bb +++ b/meta/recipes-devtools/python/python3-setuptools_59.5.0.bb | |||
| @@ -17,14 +17,6 @@ SRC_URI[sha256sum] = "d144f85102f999444d06f9c0e8c737fd0194f10f2f7e5fdb77573f6e2f | |||
| 17 | 17 | ||
| 18 | DEPENDS += "${PYTHON_PN}" | 18 | DEPENDS += "${PYTHON_PN}" |
| 19 | 19 | ||
| 20 | # Avoid dependency loop; we bootstrap -native | ||
| 21 | DEPENDS:remove:class-native = "python3-pip-native python3-setuptools-native" | ||
| 22 | DEPENDS:append:class-native = " unzip-native" | ||
| 23 | |||
| 24 | do_install:class-native() { | ||
| 25 | python_pep517_do_bootstrap_install | ||
| 26 | } | ||
| 27 | |||
| 28 | RDEPENDS:${PN} = "\ | 20 | RDEPENDS:${PN} = "\ |
| 29 | ${PYTHON_PN}-2to3 \ | 21 | ${PYTHON_PN}-2to3 \ |
| 30 | ${PYTHON_PN}-compile \ | 22 | ${PYTHON_PN}-compile \ |
| @@ -59,3 +51,7 @@ RDEPENDS:${PYTHON_PN}-pkg-resources = "\ | |||
| 59 | ${PYTHON_PN}-plistlib \ | 51 | ${PYTHON_PN}-plistlib \ |
| 60 | ${PYTHON_PN}-pprint \ | 52 | ${PYTHON_PN}-pprint \ |
| 61 | " | 53 | " |
| 54 | |||
| 55 | # This used to use the bootstrap install which didn't compile. Until we bump the | ||
| 56 | # tmpdir version we can't compile the native otherwise the sysroot unpack fails | ||
| 57 | INSTALL_WHEEL_COMPILE_BYTECODE:class-native = "--no-compile-bytecode" | ||
diff --git a/meta/recipes-devtools/python/python3-wheel_0.37.1.bb b/meta/recipes-devtools/python/python3-wheel_0.37.1.bb index a339e65824..efd6c2f968 100644 --- a/meta/recipes-devtools/python/python3-wheel_0.37.1.bb +++ b/meta/recipes-devtools/python/python3-wheel_0.37.1.bb | |||
| @@ -10,26 +10,8 @@ inherit flit_core pypi | |||
| 10 | 10 | ||
| 11 | SRC_URI += " file://0001-Backport-pyproject.toml-from-flit-backend-branch.patch" | 11 | SRC_URI += " file://0001-Backport-pyproject.toml-from-flit-backend-branch.patch" |
| 12 | 12 | ||
| 13 | DEPENDS:remove:class-native = "python3-pip-native" | ||
| 14 | |||
| 15 | do_install:class-native () { | ||
| 16 | python_pep517_do_bootstrap_install | ||
| 17 | |||
| 18 | # pip install would normally generate [project.scripts] in ${bindir} | ||
| 19 | install -d ${D}/${bindir} | ||
| 20 | cat << EOF >> ${D}/${bindir}/wheel | ||
| 21 | #!/bin/sh | ||
| 22 | '''exec' ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} "\$0" "\$@" | ||
| 23 | ' ''' | ||
| 24 | # -*- coding: utf-8 -*- | ||
| 25 | import re | ||
| 26 | import sys | ||
| 27 | from wheel.cli import main | ||
| 28 | if __name__ == '__main__': | ||
| 29 | sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) | ||
| 30 | sys.exit(main()) | ||
| 31 | EOF | ||
| 32 | chmod 0755 ${D}${bindir}/wheel | ||
| 33 | } | ||
| 34 | |||
| 35 | BBCLASSEXTEND = "native nativesdk" | 13 | BBCLASSEXTEND = "native nativesdk" |
| 14 | |||
| 15 | # This used to use the bootstrap install which didn't compile. Until we bump the | ||
| 16 | # tmpdir version we can't compile the native otherwise the sysroot unpack fails | ||
| 17 | INSTALL_WHEEL_COMPILE_BYTECODE:class-native = "--no-compile-bytecode" | ||
