diff options
Diffstat (limited to 'meta-oe/recipes-support/libgpiod/libgpiod.inc')
-rw-r--r-- | meta-oe/recipes-support/libgpiod/libgpiod.inc | 66 |
1 files changed, 56 insertions, 10 deletions
diff --git a/meta-oe/recipes-support/libgpiod/libgpiod.inc b/meta-oe/recipes-support/libgpiod/libgpiod.inc index 89679cb919..cb19bc5fb8 100644 --- a/meta-oe/recipes-support/libgpiod/libgpiod.inc +++ b/meta-oe/recipes-support/libgpiod/libgpiod.inc @@ -1,18 +1,64 @@ SUMMARY = "C library and tools for interacting with the linux GPIO character device" +AUTHOR = "Bartosz Golaszewski <brgl@bgdev.pl>" +RECIPE_MAINTAINER = "Bartosz Golaszewski <brgl@bgdev.pl>" -LICENSE = "LGPLv2.1+" -LIC_FILES_CHKSUM = "file://COPYING;md5=2caced0b25dfefd4c601d92bd15116de" +inherit autotools pkgconfig ptest -SRC_URI = "https://www.kernel.org/pub/software/libs/libgpiod/${BP}.tar.xz" +SRC_URI += " \ + https://www.kernel.org/pub/software/libs/libgpiod/libgpiod-${PV}.tar.xz \ + file://run-ptest \ +" -inherit autotools pkgconfig +PACKAGECONFIG[cxx] = "--enable-bindings-cxx,--disable-bindings-cxx" -PACKAGECONFIG[tests] = "--enable-tests,--disable-tests,kmod udev" -PACKAGECONFIG[tools] = "--enable-tools,--disable-tools," +# Enable cxx bindings by default. +PACKAGECONFIG ?= " \ + cxx \ + ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)} \ +" -PACKAGES =+ " ${PN}-tools" +# Always build tools - they don't have any additional +# requirements over the library. +EXTRA_OECONF = "--enable-tools" -FILES_${PN}-tools = "${bindir}/*" +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" +RDEPENDS:${PN}-ptest += "${@bb.utils.contains('PTEST_ENABLED', '1', 'bats', '', d)}" + +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. + install -m 0755 ${S}/tools/gpio-tools-test ${D}${PTEST_PATH}/tests/ + install -m 0755 ${S}/tools/gpio-tools-test.bats ${D}${PTEST_PATH}/tests/ + 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 +} -RRECOMMENDS_TOOLS = "${@bb.utils.contains('PACKAGECONFIG', 'tools', '${PN}-tools', '',d)}" -RRECOMMENDS_${PN} += "${RRECOMMENDS_TOOLS}" |