meta-zephyr-sdk: rework hidapi recipe

Pull in hidapi_git.bb recipe from upstream meta-openembedded repo.

hidapi need a udev version so we use eudev and eudev will pull in kmod.
We add eudev_%.bbappend and kmod_git.bbappend to enable building those
recipes for a native-sdk (had a patch to the poky repo to handle this
before).

Finally, pull in hidapi via the openocd recipe and don't explicitly
list in hosttools-tarball recipe.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2020-07-15 00:46:54 -05:00 committed by Kumar Gala
parent e72f967738
commit 5150ae121e
8 changed files with 22 additions and 2072 deletions

View File

@ -0,0 +1 @@
BBCLASSEXTEND = "nativesdk"

View File

@ -1,16 +0,0 @@
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -62,9 +62,9 @@
threads="pthreads"
# HIDAPI/hidraw libs
- PKG_CHECK_MODULES([libudev], [libudev], true, [hidapi_lib_error libudev])
- LIBS_HIDRAW_PR+=" $libudev_LIBS"
- CFLAGS_HIDRAW+=" $libudev_CFLAGS"
+# PKG_CHECK_MODULES([libudev], [libudev], true, [hidapi_lib_error libudev])
+# LIBS_HIDRAW_PR+=" $libudev_LIBS"
+# CFLAGS_HIDRAW+=" $libudev_CFLAGS"
# HIDAPI/libusb libs
AC_CHECK_LIB([rt], [clock_gettime], [LIBS_LIBUSB_PRIVATE+=" -lrt"], [hidapi_lib_error librt])

File diff suppressed because it is too large Load Diff

View File

@ -1,55 +0,0 @@
SUMMARY = "HIDAPI is a library which allows an application to interface with USB and Bluetooth HID-Class devices"
HOMEPAGE = "https://github.com/signal11/hidapi"
SECTION = "libs"
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://LICENSE-bsd.txt;md5=b5fa085ce0926bb50d0621620a82361f"
DEPENDS += "udev libusb1"
RDEPENDS_${PN} += "udev"
PR = "r0"
SRCREV = "b5b2e1779b6cd2edda3066bbbf0921a2d6b1c3c0"
SRC_URI = "git://github.com/signal11/hidapi.git;protocol=https \
file://libusb.h \
"
BBCLASSEXTEND += " native nativesdk"
S = "${WORKDIR}/git"
inherit autotools pkgconfig
EXTRA_OECONF = " --libdir=${base_libdir}"
do_configure() {
cd ${S}
./bootstrap
export PKG_CONFIG_DIR=
export PKG_CONFIG_LIBDIR=${prefix}/lib/pkgconfig:${prefix}/share/pkgconfig
export PKG_CONFIG_SYSROOT_DIR=${prefix}
oe_runconf ${EXTRA_OECONF}
}
do_compile() {
cp ${WORKDIR}/libusb.h* ${S}/libusb
cd ${S}/linux
make Makefile-manual
}
do_install() {
cd ${S}/linux
oe_runmake DESTDIR=${D} install
# pkgconfig is needed to keep OpenOCD happy.
# (OpenOCD searches for HIDAPI via pkgconfig)
install -d ${D}${libdir}/pkgconfig
cp ${S}/pc/hidapi-hidraw.pc ${D}${libdir}/pkgconfig
#rm ${D}${includedir}/hidapi/hidapi.h
}
FILES_${PN} += "${base_libdir}/*.so.*"
FILES_${PN}-dev += "${base_libdir}/*.so ${base_libdir}/*.a"
FILES_${PN}-dev += "${includedir}"

View File

@ -11,7 +11,6 @@ TOOLCHAIN_HOST_TASK ?= "\
nativesdk-openocd \
nativesdk-bossa \
nativesdk-dtc \
nativesdk-hidapi-libraw \
"
TOOLCHAIN_OUTPUTNAME ?= "${DISTRO}-${SDKMACHINE}-hosttools-standalone-${DISTRO_VERSION}"

View File

@ -1,7 +1,7 @@
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
DEPENDS = "libusb-compat hidapi-libraw"
RDEPENDS_${PN} = "libusb1 hidapi-libraw"
DEPENDS = "libusb-compat hidapi"
RDEPENDS_${PN} = "libusb1 hidapi"
# The various arc files are based on the commit e781e73a39bc5c845b73dc96b751d867278a7583
# of https://github.com/foss-for-synopsys-dwc-arc-processors/openocd

View File

@ -0,0 +1 @@
BBCLASSEXTEND = "nativesdk"

View File

@ -0,0 +1,18 @@
SUMMARY = "A Simple library for communicating with USB and Bluetooth HID devices"
AUTHOR = "Alan Ott"
HOMEPAGE = "http://www.signal11.us/oss/hidapi/"
SECTION = "libs"
LICENSE = "BSD-3-Clause | GPLv3"
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=7c3949a631240cb6c31c50f3eb696077"
DEPENDS = "libusb udev"
BBCLASSEXTEND += " native nativesdk"
inherit autotools pkgconfig
SRC_URI = "git://github.com/libusb/hidapi.git;protocol=https"
PV = "0.9.0"
SRCREV = "7da5cc91fc0d2dbe4df4f08cd31f6ca1a262418f"
S = "${WORKDIR}/git"