我正在尝试为 github (Aravis) 的库编写自定义配方。构建/安装步骤是使用介子和忍者完成的。
$ meson build
$ cd build
$ ninja
$ ninja install
在编写/添加配方之前,我已在自定义中添加了介子、忍者和依赖项
layer.conf
。然后,在系统上,我克隆了该库,编译它并运行一些测试。一切工作正常,所以我确信介子、忍者和所有依赖项都已就位(在系统级别)。
现在我已经写好了食谱
SUMMARY = "Aravis, Your industrial vision library"
LICENSE = "LGPL-2.1"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/LGPL-2.1-only;md5=1a6d268fd218675ffea8be556788b780"
inherit systemd
SRC_URI = "https://github.com/AravisProject/aravis/archive/refs/tags/0.8.22.tar.gz"
SRC_URI[md5sum] = "8d24f794b1c5160f21c2b0d77764c86d"
DEPENDS=" \
gstreamer1.0 \
gstreamer1.0-plugins-base \
libxml2 \
glib-2.0 \
glib-2.0-native \
zlib \
libusb1 \
gtk-doc \
gobject-introspection \
intltool-native \
meson \
"
S = "${WORKDIR}/aravis-0.8.22"
do_configure() {
( cd ${S}
meson build )
}
do_build() {
( cd ${S}/build
ninja )
}
do_install () {
( cd ${S}/build
ninja install )
}
do_configure()
步骤失败并出现 meson: not found
错误。我还不知道忍者(没有达到do_build()
),但它也可能会失败。
如何在编译级别使用介子和忍者工具?
作为盲测,我尝试重建工具链(
bitbake meta-toolchain-qt5
),希望这些工具能够在下一个映像构建中添加,但没有成功。
编辑
我还注意到 meson 和 ninja 已经在我的 sdk 中可用(使用上述命令构建后安装在主机上用于交叉编译的
bitbake meta-toolchain-qt5
)。
mix@SWDEV1:/opt/fsl-imx-xwayland/5.10-hardknott/sysroots/x86_64-pokysdk-linux$ find . -name ninja
./usr/bin/ninja
mix@SWDEV1:/opt/fsl-imx-xwayland/5.10-hardknott/sysroots/x86_64-pokysdk-linux$ find . -name meson
./usr/share/meson
./usr/bin/meson
工具可用。我只需要了解如何使用它们。
发现问题了。
我做的另一个测试是添加
inherit meson
并删除自定义任务,但没有运气。
再测试一下,我发现问题出在菜谱名称上,那就是
aravis_%.bb
。由于我没有定义配方版本,所以生成的构建路径是tmp/work/cortexa53-crypto-poky-linux/aravis/%_r0/
,看起来介子不喜欢%
这个角色。
所以我编辑了我的食谱,以便定义版本
SUMMARY = "Aravis, Your industrial vision library"
LICENSE = "LGPL-2.1"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/LGPL-2.1-only;md5=1a6d268fd218675ffea8be556788b780"
PV = "0.8.22"
SRC_URI = "https://github.com/AravisProject/aravis/archive/refs/tags/${PV}.tar.gz"
SRC_URI[md5sum] = "8d24f794b1c5160f21c2b0d77764c86d"
DEPENDS=" \
gstreamer1.0 \
gstreamer1.0-plugins-base \
libxml2 \
glib-2.0 \
glib-2.0-native \
zlib \
libusb1 \
gtk-doc \
gobject-introspection \
intltool-native \
"
S = "${WORKDIR}/aravis-${PV}"
inherit meson
现在将编译并安装库。
感谢您最初的回答 il_mix,它帮助我制作了适用于 Yocto 4.0 (Kirkstone).
的食谱的更新版本我已将文件标记为 aravis_git.bb 并将其放置在食谱多媒体下我自己的图层中。
此版本使用更新的许可和
SRCREV
提交而不是 .tar.gz 存档。
EXTRA_OEMESON
用于打开/关闭 Aravis 提供的选项。
我已经关闭了文档、快速心跳、内省、测试、查看器。
如果您要启用提供 libgstaravis.0.8.so 的 gst-plugin 选项,则需要 FILES
。
SUMMARY = "Video acquisition for Genicam compliant cameras"
DESCRIPTION = "Aravis is a glib/gobject based library for video acquisition using Genicam compliant cameras. It currently implements the gigabit ethernet and USB3 protocols used by industrial cameras."
LICENSE = "LGPL-2.1-only"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/LGPL-2.1-only;md5=1a6d268fd218675ffea8be556788b780"
# Modify these as desired
# Current Aravis version = 0.8.26
PV = "1.0+git${SRCPV}"
SRC_URI = "git://github.com/AravisProject/aravis.git;branch=main;protocol=https"
SRCREV = "e977fa4eedc8c4f4747ff370d53621b369930fe9"
S = "${WORKDIR}/git"
DEPENDS = " \
zlib \
libxml2 \
glib-2.0 \
glib-2.0-native \
libusb1 \
gstreamer1.0 \
gstreamer1.0-plugins-base \
"
# These options are found in AravisProject/aravis meson_options.txt
EXTRA_OEMESON += "-Ddocumentation=disabled \
-Dfast-heartbeat=false \
-Dgst-plugin=enabled \
-Dintrospection=disabled \
-Dpacket-socket=enabled \
-Dtests=false \
-Dusb=enabled \
-Dviewer=disabled"
#gst-plugin = Do we want to make a gstreamer plugin version of Aravis for GStreamer use?
FILES:${PN} += " \
${libdir}/gstreamer-1.0/libgstaravis.0.8.so \
"
inherit meson pkgconfig