1 SUMMARY = "C library and tools for interacting with the linux GPIO character device"
2 RECIPE_MAINTAINER = "Bartosz Golaszewski <brgl@bgdev.pl>"
4 inherit autotools pkgconfig ptest
7 https://www.kernel.org/pub/software/libs/libgpiod/libgpiod-${PV}.tar.xz \
11 PACKAGECONFIG[cxx] = "--enable-bindings-cxx,--disable-bindings-cxx"
13 # Enable cxx bindings by default.
16 ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)} \
19 # Always build tools - they don't have any additional
20 # requirements over the library.
21 EXTRA_OECONF = "--enable-tools"
23 DEPENDS += "autoconf-archive-native"
25 PACKAGES =+ "${PN}-tools libgpiodcxx"
26 FILES:${PN}-tools += " \
27 ${bindir}/gpiodetect \
33 FILES:libgpiodcxx = "${libdir}/libgpiodcxx.so.*"
35 RRECOMMENDS:${PN}-ptest += "coreutils"
38 rm -f ${D}${bindir}/gpiod-test
39 rm -f ${D}${bindir}/gpio-tools-test
40 rm -f ${D}${bindir}/gpio-tools-test.bats
41 rm -f ${D}${bindir}/gpiod-cxx-test
45 install -d ${D}${PTEST_PATH}/tests/
47 # These are the core C library tests
48 install -m 0755 ${B}/tests/.libs/gpiod-test ${D}${PTEST_PATH}/tests/
50 # Tools are always built so let's always install them for ptest even if
51 # we're not selecting libgpiod-tools.
52 for tool in ${FILES:${PN}-tools}; do
53 install ${B}/tools/.libs/$(basename $tool) ${D}${PTEST_PATH}/tests/
56 if ${@bb.utils.contains('PACKAGECONFIG', 'cxx', 'true', 'false', d)}; then
57 install -m 0755 ${B}/bindings/cxx/tests/.libs/gpiod-cxx-test ${D}${PTEST_PATH}/tests/