blob: 2155101d305871d6d67781ec9b325da00bca1ccc [file] [log] [blame]
Andrew Geissler595f6302022-01-24 19:11:47 +00001SUMMARY = "Download, build, install, upgrade, and uninstall Python packages"
2HOMEPAGE = "https://pypi.org/project/setuptools"
3SECTION = "devel/python"
4LICENSE = "MIT"
5LIC_FILES_CHKSUM = "file://LICENSE;beginline=1;endline=19;md5=7a7126e068206290f3fe9f8d6c713ea6"
6
Andrew Geissler7e0e3c02022-02-25 20:34:39 +00007inherit pypi setuptools_build_meta
Andrew Geissler595f6302022-01-24 19:11:47 +00008
9SRC_URI:append:class-native = " file://0001-conditionally-do-not-fetch-code-by-easy_install.patch"
10
11SRC_URI += "\
12 file://0001-change-shebang-to-python3.patch \
13 file://0001-_distutils-sysconfig-append-STAGING_LIBDIR-python-sy.patch \
14"
15
16SRC_URI[sha256sum] = "d144f85102f999444d06f9c0e8c737fd0194f10f2f7e5fdb77573f6e2fa4fad0"
17
18DEPENDS += "${PYTHON_PN}"
19
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000020# Avoid dependency loop; we bootstrap -native
21DEPENDS:remove:class-native = "python3-pip-native python3-setuptools-native"
22DEPENDS:append:class-native = " unzip-native"
23
24PYPA_WHEEL ?= "${B}/dist/${PYPI_PACKAGE}-${PV}-*.whl"
25
26do_install:class-native() {
27 # Bootstrap to prevent dependency loop in python3-pip-native
28 install -d ${D}${PYTHON_SITEPACKAGES_DIR}
29 unzip -d ${D}${PYTHON_SITEPACKAGES_DIR} ${PYPA_WHEEL} || \
30 bbfatal_log "Failed to unzip wheel: ${PYPA_WHEEL}. Check the logs."
31}
32
Andrew Geissler595f6302022-01-24 19:11:47 +000033RDEPENDS:${PN} = "\
34 ${PYTHON_PN}-2to3 \
35 ${PYTHON_PN}-compile \
36 ${PYTHON_PN}-compression \
37 ${PYTHON_PN}-ctypes \
38 ${PYTHON_PN}-email \
39 ${PYTHON_PN}-html \
40 ${PYTHON_PN}-json \
41 ${PYTHON_PN}-netserver \
42 ${PYTHON_PN}-numbers \
43 ${PYTHON_PN}-pickle \
44 ${PYTHON_PN}-pkg-resources \
45 ${PYTHON_PN}-pkgutil \
46 ${PYTHON_PN}-plistlib \
47 ${PYTHON_PN}-shell \
48 ${PYTHON_PN}-stringold \
49 ${PYTHON_PN}-threading \
50 ${PYTHON_PN}-unittest \
51 ${PYTHON_PN}-xml \
52"
53
Andrew Geissler595f6302022-01-24 19:11:47 +000054BBCLASSEXTEND = "native nativesdk"
55
56# The pkg-resources module can be used by itself, without the package downloader
57# and easy_install. Ship it in a separate package so that it can be used by
58# minimal distributions.
59PACKAGES =+ "${PYTHON_PN}-pkg-resources "
60FILES:${PYTHON_PN}-pkg-resources = "${PYTHON_SITEPACKAGES_DIR}/pkg_resources/*"
61RDEPENDS:${PYTHON_PN}-pkg-resources = "\
62 ${PYTHON_PN}-compression \
63 ${PYTHON_PN}-email \
64 ${PYTHON_PN}-plistlib \
65 ${PYTHON_PN}-pprint \
66"