summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Orling <ticotimo@gmail.com>2022-02-23 14:09:13 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-02-25 15:06:46 +0000
commit19e83270d17984cf6b471c387eb08103816b359f (patch)
treef60f3a7e499a818fa047c829a24e5de1e4fa62b3
parent39b0d36b00d98a848297d0667c6cffc049d215e3 (diff)
downloadopenembedded-core-contrib-19e83270d17984cf6b471c387eb08103816b359f.tar.gz
python3-wheel-native: install ${bindir}/wheel
pip install would normally install [project.scripts] to ${D}${bindir} but our naïve bootstrapping only unzipps the wheel to ${D}${PYTHON_SITEPACKAGES_DIR}. Correct this by creating the equivalent script in do_install:class-native [YOCTO #14739] Signed-off-by: Tim Orling <tim.orling@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/python/python3-wheel_0.37.1.bb16
1 files changed, 16 insertions, 0 deletions
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 c7354c9d98..91bff82509 100644
--- a/meta/recipes-devtools/python/python3-wheel_0.37.1.bb
+++ b/meta/recipes-devtools/python/python3-wheel_0.37.1.bb
@@ -18,6 +18,22 @@ do_install:class-native () {
PYPA_WHEEL="${B}/dist/${PYPI_PACKAGE}-${PV}-*.whl"
unzip -d ${D}${PYTHON_SITEPACKAGES_DIR} ${PYPA_WHEEL} || \
bbfatal_log "Failed to install"
+
+ # pip install would normally generate [project.scripts] in ${bindir}
+ install -d ${D}/${bindir}
+ cat << EOF >> ${D}/${bindir}/wheel
+#!/bin/sh
+'''exec' ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} "\$0" "\$@"
+' '''
+# -*- coding: utf-8 -*-
+import re
+import sys
+from wheel.cli import main
+if __name__ == '__main__':
+ sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
+ sys.exit(main())
+EOF
+ chmod 0755 ${D}${bindir}/wheel
}
BBCLASSEXTEND = "native nativesdk"