I'm having a very hard time trying to find an example of building in a custom python module into Yocto (more specifically Xilinx's Petalinux) that will install into the python site-packages directory so I can write Python scripts on-target using my module.
This is what I have so far:
Directory tree
(in project-spec/meta-user/recipes-apps)
├── foo-python ├── files │ └── foo-python.py └── foo-python.bb
foo-python.bb
#
# This file is the foo-python recipe.
#
SUMMARY = "Simple foo-python application"
SECTION = "PETALINUX/apps"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI = "file://foo-python.py"
RDEPENDS:${PN} = "python3-core"
S = "${WORKDIR}"
do_install() {
install -d ${D}${PYTHON_SITEPACKAGES_DIR}/${PN}
install -m 0644 foo-python.py ${D}${PYTHON_SITEPACKAGES_DIR}/${PN}/
}
FILES_${PN} += "${PYTHON_SITEPACKAGES_DIR}/${PN}/*"
Error
When I bitbake my recipe (Petalinux-build), I get the following error:
NOTE: Executing Tasks ERROR: foo-python-1.0-r0 do_package: QA Issue: foo-python: Files/directories were installed but not shipped in any package:
/foo-python
/foo-python/foo-python.py
Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install. foo-python: 2 installed and not shipped files. [installed-vs-shipped] ERROR: foo-python-1.0-r0 do_package: Fatal QA errors found, failing task.
- I apologize in advance, I'm only familiar with Petalinux, and don't know where Petalinux ends, and Yocto/Bitbake overlaps.
- I can find examples online of how to add python modules from open-embedded layers, but I can't find a single example of adding a custom python module as installable python into site-packages.
FILES_${PN} += "${PYTHON_SITEPACKAGES_DIR}/${PN}/*", it should be:FILES_${PN} += "${D}${PYTHON_SITEPACKAGES_DIR}/${PN}/*