如何在yocto/openembedded项目中添加更多python模块? [英] How do I add more python modules to my yocto/openembedded project?

查看:564
本文介绍了如何在yocto/openembedded项目中添加更多python模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在yocto/openembedded项目中添加更多的python模块,但是我不确定该怎么做?我希望添加flask及其依赖项.

I wish to add more python modules to my yocto/openembedded project but I am unsure how to? I wish to add flask and its dependencies.

推荐答案

一些在meta文件夹中具有相应配方的python软件包,例如Enum类:

some python packages having corresponding recipes in the meta folders, like Enum class for example:

meta-openembedded/meta-python/recipes-devtools/python/python-enum34_1.1.6.bb

许多有用的类都不可用,但是python应用程序可能需要一些有用的类.习惯于在引导平台上使用pip安装缺少的软件包?但是如果目标产品未连接IP网络怎么办?解决方案是实施新配方并至少添加到平台元层.示例是模块keyboard的配方,可用于拦截按键/按钮触摸事件:

unfortunately lot's of useful classes aren't available, but some might be needed for the python application. get used of installing missing packages using pip already on booted platform? but what if the target product is not IP network connected? the solution is to implement a new recipe and add to the platform meta layer (at least). Example is a recipe for the module keyboard useful for intercepting keys/buttons touch events:

  1. 使用PyPi网站确定该软件包是否可用:

https://pypi.org/project/keyboard/

  1. 可在软件包说明页面上下载下载档案:

https://github.com/boppreh/keyboard/archive/master.zip

  1. 收集一些填写新食谱所需的有用信息:

  1. collect some useful information required to fill-out a new recipe:

  • 摘要-可以从包装说明页面获取
  • HOMEPAGE-github或bitbucket或sourceforge等上的项目URL
  • 许可证-验证许可证类型
  • 通过对位于软件包根目录中的现有LICENSEREADMEPKG-INFO文件(最好)执行md5sum(最好)来执行
  • LIC_FILES_CHKSUM
  • SRC_URI [md5sum]-是存档本身的md5sum.在支持脚本inherit pypi
  • 的帮助下,它将自动用于在pypi服务器上发现和下载存档.
  • PYPI_PACKAGE_EXT-如果软件包不是tar.gz,则要求提供正确的扩展名
  • SUMMARY - could be obtained from the package description page
  • HOMEPAGE - the project URL on github or bitbucket or sourceforge, etc
  • LICENSE - verify license type
  • LIC_FILES_CHKSUM by executing md5sum on existing LICENSE or README or PKG-INFO file located in the root of the package (preferrably)
  • SRC_URI[md5sum] - is md5sum of the archive itself. it will be used to discover and download archive on pypi server automatically with the help of supporting script inherit pypi
  • PYPI_PACKAGE_EXT - if the package is not tar.gz require to supply the correct extension

创建缺少的python-keyboard_0.13.1.bb食谱:

`

SUMMARY = "Hook and simulate keyboard events on Windows and Linux"
HOMEPAGE = "https://github.com/boppreh/keyboard"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://PKG-INFO;md5=9bc8ba91101e2f378a65d36f675c88b7"

SRC_URI[md5sum] = "d4b90e53bbde888e7b7a5a95fe580a30"
SRC_URI += "file://add_missing_CHANGES_md.patch"

PYPI_PACKAGE = "keyboard"

PYPI_PACKAGE_EXT = "zip"

inherit pypi
inherit setuptools

BBCLASSEXTEND = "native nativesdk"

`

  1. 该软件包已通过添加
  2. 进行了修补

SRC_URI += "file://add_missing_CHANGES_md.patch"

指向该配方(此步骤是可选的).补丁本身必须放在与配方名称匹配的配方旁边的文件夹中,但不能使用版本:

directive to the recipe due to missing CHANGES.md file used by setup.py script to identify package version (this step is optional). the patch itself has to be placed inside the folder next to the recipe matching recipe name but without version:

python-keyboard

这篇关于如何在yocto/openembedded项目中添加更多python模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆