blob: 9b907a263192326c7756658c6c163c0c6bf89c96 [file] [log] [blame]
Brad Bishop6e60e8b2018-02-01 10:27:11 -05001SUMMARY = "The PyPA recommended tool for installing Python packages"
2sHOMEPAGEsss = "https://pypi.python.org/pypi/pip"
3SECTION = "devel/python"
4LICENSE = "MIT"
5LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=25fba45109565f87de20bae85bc39452"
6
7SRCNAME = "pip"
8DEPENDS += "python3 python3-setuptools-native"
9
10SRC_URI = "https://files.pythonhosted.org/packages/source/p/${SRCNAME}/${SRCNAME}-${PV}.tar.gz"
11
12SRC_URI[md5sum] = "35f01da33009719497f01a4ba69d63c9"
13SRC_URI[sha256sum] = "09f243e1a7b461f654c26a725fa373211bb7ff17a9300058b205c61658ca940d"
14
15UPSTREAM_CHECK_URI = "https://pypi.python.org/pypi/pip"
16
17S = "${WORKDIR}/${SRCNAME}-${PV}"
18
19inherit distutils3
20
21DISTUTILS_INSTALL_ARGS += "--install-lib=${D}${PYTHON_SITEPACKAGES_DIR}"
22
23do_install_prepend() {
24 install -d ${D}${PYTHON_SITEPACKAGES_DIR}
25}
26
27# Use setuptools site.py instead, avoid shared state issue
28do_install_append() {
29 rm ${D}${PYTHON_SITEPACKAGES_DIR}/site.py
30 rm ${D}${PYTHON_SITEPACKAGES_DIR}/__pycache__/site.cpython-*.pyc
31
32 # Install as pip3 and leave pip2 as default
33 rm ${D}/${bindir}/pip
34
35 # Installed eggs need to be passed directly to the interpreter via a pth file
36 echo "./${SRCNAME}-${PV}-py${PYTHON_BASEVERSION}.egg" > ${D}${PYTHON_SITEPACKAGES_DIR}/${SRCNAME}-${PV}.pth
37
38 # Make sure we use /usr/bin/env python3
39 for PYTHSCRIPT in `grep -rIl ${bindir} ${D}${bindir}/pip3*`; do
40 sed -i -e '1s|^#!.*|#!/usr/bin/env python3|' $PYTHSCRIPT
41 done
42}
43
44RDEPENDS_${PN} = "\
45 python3-compile \
46 python3-io \
47 python3-enum \
48 python3-html \
49 python3-json \
50 python3-netserver \
51 python3-setuptools \
52 python3-unixadmin \
53 python3-xmlrpc \
54"
55
Brad Bishopd7bf8c12018-02-25 22:55:05 -050056BBCLASSEXTEND = "native nativesdk"