Andrew Geissler | 6aa7eec | 2023-03-03 12:41:14 -0600 | [diff] [blame] | 1 | SUMMARY = "C library and tools for interacting with the linux GPIO character device" |
| 2 | AUTHOR = "Bartosz Golaszewski <brgl@bgdev.pl>" |
| 3 | |
| 4 | require libgpiod-src.inc |
| 5 | |
| 6 | inherit autotools pkgconfig ptest |
| 7 | |
| 8 | SRC_URI += "file://run-ptest" |
| 9 | |
| 10 | PACKAGECONFIG[cxx] = "--enable-bindings-cxx,--disable-bindings-cxx" |
| 11 | |
| 12 | # Enable cxx bindings by default. |
| 13 | PACKAGECONFIG ?= " \ |
| 14 | cxx \ |
| 15 | ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)} \ |
| 16 | " |
| 17 | |
| 18 | # Always build tools - they don't have any additional |
| 19 | # requirements over the library. |
| 20 | EXTRA_OECONF = "--enable-tools" |
| 21 | |
| 22 | DEPENDS += "autoconf-archive-native" |
| 23 | |
| 24 | PACKAGES =+ "${PN}-tools libgpiodcxx" |
| 25 | FILES:${PN}-tools += " \ |
| 26 | ${bindir}/gpiodetect \ |
| 27 | ${bindir}/gpioinfo \ |
| 28 | ${bindir}/gpioget \ |
| 29 | ${bindir}/gpioset \ |
| 30 | ${bindir}/gpiomon \ |
| 31 | " |
| 32 | FILES:${PN}-ptest += " \ |
| 33 | ${bindir}/gpiod-test \ |
| 34 | ${bindir}/gpio-tools-test \ |
| 35 | ${bindir}/gpio-tools-test.bats \ |
| 36 | ${bindir}/gpiod-cxx-test \ |
| 37 | " |
| 38 | FILES:libgpiodcxx = "${libdir}/libgpiodcxx.so.*" |
| 39 | |
| 40 | RRECOMMENDS:${PN}-ptest += "coreutils" |
| 41 | RDEPENDS:${PN}-ptest += "bats" |
| 42 | |
| 43 | do_install_ptest() { |
| 44 | install -d ${D}${PTEST_PATH}/tests/ |
| 45 | |
| 46 | # These are the core C library tests |
| 47 | install -m 0755 ${B}/tests/.libs/gpiod-test ${D}${PTEST_PATH}/tests/ |
| 48 | |
| 49 | # Tools are always built so let's always install them for ptest even if |
| 50 | # we're not selecting libgpiod-tools. |
| 51 | install -m 0755 ${S}/tools/gpio-tools-test ${D}${PTEST_PATH}/tests/ |
| 52 | install -m 0755 ${S}/tools/gpio-tools-test.bats ${D}${PTEST_PATH}/tests/ |
| 53 | for tool in ${FILES:${PN}-tools}; do |
| 54 | install ${B}/tools/.libs/$(basename $tool) ${D}${PTEST_PATH}/tests/ |
| 55 | done |
| 56 | |
| 57 | if ${@bb.utils.contains('PACKAGECONFIG', 'cxx', 'true', 'false', d)}; then |
| 58 | install -m 0755 ${B}/bindings/cxx/tests/.libs/gpiod-cxx-test ${D}${PTEST_PATH}/tests/ |
| 59 | fi |
| 60 | } |
| 61 | |