summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorTim Orling <ticotimo@gmail.com>2022-02-23 14:09:10 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-02-25 15:07:50 +0000
commit3a4f842307e5cdf40b48baeac0f15e5bbee43760 (patch)
tree12e3a517ae41c568150b6bfbcb1501705878c7fb /meta
parentd98a804617e93d929d0386d0c1dca85d36b6a475 (diff)
downloadpoky-3a4f842307e5cdf40b48baeac0f15e5bbee43760.tar.gz
python3-pip-native: install scripts in ${bindir}
The naïve approach of simply unzipping the built wheel is not sufficient. 'pip install' would normally have created the [console_scripts] from entry-points.txt in ${D}${bindir}. For bootstrapping purposes, hardcode the scripts and install them into ${D}${bindir}. Skip the ${bindir}/pip variant. [YOCTO #14739] (From OE-Core rev: 5b58328b610273fea42c144cd590e638c0dc1e4e) Signed-off-by: Tim Orling <tim.orling@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-devtools/python/python3-pip_22.0.3.bb17
1 files changed, 17 insertions, 0 deletions
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 023ab41810..e02ea5bd3d 100644
--- a/meta/recipes-devtools/python/python3-pip_22.0.3.bb
+++ b/meta/recipes-devtools/python/python3-pip_22.0.3.bb
@@ -24,6 +24,23 @@ do_install:class-native() {
24 install -d ${D}${PYTHON_SITEPACKAGES_DIR} 24 install -d ${D}${PYTHON_SITEPACKAGES_DIR}
25 unzip -d ${D}${PYTHON_SITEPACKAGES_DIR} ${PYPA_WHEEL} || \ 25 unzip -d ${D}${PYTHON_SITEPACKAGES_DIR} ${PYPA_WHEEL} || \
26 bbfatal_log "Failed to unzip wheel: ${PYPA_WHEEL}. Check the logs." 26 bbfatal_log "Failed to unzip wheel: ${PYPA_WHEEL}. Check the logs."
27
28 # pip install would normally generate [console_scripts] in ${bindir}
29 install -d ${D}/${bindir}
30 # We will skip the ${bindir}/pip variant as we would just remove it in the do_install:append
31 cat << EOF >> ${D}/${bindir}/pip3 | tee ${D}/${bindir}/pip${PYTHON_BASEVERSION}
32#!/bin/sh
33'''exec' ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} "\$0" "\$@"
34' '''
35# -*- coding: utf-8 -*-
36import re
37import sys
38from pip._internal.cli.main import main
39if __name__ == '__main__':
40 sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
41 sys.exit(main())
42EOF
43 chmod 0755 ${D}${bindir}/pip3 ${D}${bindir}/pip${PYTHON_BASEVERSION}
27} 44}
28 45
29do_install:append() { 46do_install:append() {