summaryrefslogtreecommitdiffstats
path: root/meta-egvirt/recipes-support/libgpiod/libgpiod.inc
diff options
context:
space:
mode:
authorMichele Paolino <m.paolino@virtualopensystems.com>2023-11-14 18:07:09 +0100
committerMichele Paolino <m.paolino@virtualopensystems.com>2023-12-13 10:27:55 +0000
commitb05512b81bbe1c90b71da9c571e742f162fc0575 (patch)
treedea9b67ff4dae3e227943382dd7b0b0565dc39d1 /meta-egvirt/recipes-support/libgpiod/libgpiod.inc
parent31d4011207be008333c1945f18bb922b13816462 (diff)
CAN, GPIO, RNG vhost-devices for virtio-loopback [v6]quillback_16.92.0quillback/16.92.016.92.0
This patch adds key components of the viritio-loopback architecture: - kernel-module-virtio-loopback: the virtio loopback kernel driver - CAN, GPIO and RNG vhost-user devices from meta-virtualization (commit a215d8320edee0a317a6511e7e2efa5bba867486) Notes: - libgpiod, comes from meta-openembedded commit 3029554ceb0b0bb52a8d8ec3f0a75c5113662fe6 - cleaned eg-virt from unused drivers (kernel-module-virtio-video) Bug-AGL: SPEC-4834 V2 changes: - related meta-virtualization commit message added in the cover letter - updated libgpio recipe to v2.1 - SPEC reference added in cover letter v3 - add vhost-device-can preliminary version. This is placed here with the objective to share the link when proposing the new device to the rust-vmm/vhost-device community - remove cargo-update-recipe-crates includes in bb file because it is not supported by the rust mixin layer - vhost-device folder README changes v4 - fixed libgpiod required version - tested ref hw and qemu x86/64 builds - vsock, scsi and i2c rust devices removed from the build as they are not yet integrated in virtiod-loopback - cleaned-up kernel modules kernel-module-virtio-video and gstreamer1.0-plugins-bad - virtio-loopback-driver set to 2-or-later v5 - Merge with Jan-Simon version v4: - remove broken kernel-module-virtio-video - use FEATURE_PACKAGES instead of IMAGE_INSTALL:append - rename virtio-loopback-driver.bb to kernel-module-virtio-loopback_git.bb for consistency v6 - adding version in the title - removing MODULE_GIT_REPOSITORY in kernel-modules Change-Id: Id6cc58e777b9edad03b6c50d0dddaac8601edeaf Signed-off-by: Michele Paolino <m.paolino@virtualopensystems.com> Signed-off-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
Diffstat (limited to 'meta-egvirt/recipes-support/libgpiod/libgpiod.inc')
-rw-r--r--meta-egvirt/recipes-support/libgpiod/libgpiod.inc59
1 files changed, 59 insertions, 0 deletions
diff --git a/meta-egvirt/recipes-support/libgpiod/libgpiod.inc b/meta-egvirt/recipes-support/libgpiod/libgpiod.inc
new file mode 100644
index 00000000..0edb429f
--- /dev/null
+++ b/meta-egvirt/recipes-support/libgpiod/libgpiod.inc
@@ -0,0 +1,59 @@
+SUMMARY = "C library and tools for interacting with the linux GPIO character device"
+RECIPE_MAINTAINER = "Bartosz Golaszewski <brgl@bgdev.pl>"
+
+inherit autotools pkgconfig ptest
+
+SRC_URI += " \
+ https://www.kernel.org/pub/software/libs/libgpiod/libgpiod-${PV}.tar.xz \
+ file://run-ptest \
+"
+
+PACKAGECONFIG[cxx] = "--enable-bindings-cxx,--disable-bindings-cxx"
+
+# Enable cxx bindings by default.
+PACKAGECONFIG ?= " \
+ cxx \
+ ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)} \
+"
+
+# Always build tools - they don't have any additional
+# requirements over the library.
+EXTRA_OECONF = "--enable-tools"
+
+DEPENDS += "autoconf-archive-native"
+
+PACKAGES =+ "${PN}-tools libgpiodcxx"
+FILES:${PN}-tools += " \
+ ${bindir}/gpiodetect \
+ ${bindir}/gpioinfo \
+ ${bindir}/gpioget \
+ ${bindir}/gpioset \
+ ${bindir}/gpiomon \
+"
+FILES:libgpiodcxx = "${libdir}/libgpiodcxx.so.*"
+
+RRECOMMENDS:${PN}-ptest += "coreutils"
+
+do_install:append() {
+ rm -f ${D}${bindir}/gpiod-test
+ rm -f ${D}${bindir}/gpio-tools-test
+ rm -f ${D}${bindir}/gpio-tools-test.bats
+ rm -f ${D}${bindir}/gpiod-cxx-test
+}
+
+do_install_ptest() {
+ install -d ${D}${PTEST_PATH}/tests/
+
+ # These are the core C library tests
+ install -m 0755 ${B}/tests/.libs/gpiod-test ${D}${PTEST_PATH}/tests/
+
+ # Tools are always built so let's always install them for ptest even if
+ # we're not selecting libgpiod-tools.
+ for tool in ${FILES:${PN}-tools}; do
+ install ${B}/tools/.libs/$(basename $tool) ${D}${PTEST_PATH}/tests/
+ done
+
+ if ${@bb.utils.contains('PACKAGECONFIG', 'cxx', 'true', 'false', d)}; then
+ install -m 0755 ${B}/bindings/cxx/tests/.libs/gpiod-cxx-test ${D}${PTEST_PATH}/tests/
+ fi
+}