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" |
Patrick Williams | b542dec | 2023-06-09 01:26:37 -0500 | [diff] [blame] | 2 | RECIPE_MAINTAINER = "Bartosz Golaszewski <brgl@bgdev.pl>" |
Andrew Geissler | 6aa7eec | 2023-03-03 12:41:14 -0600 | [diff] [blame] | 3 | |
Andrew Geissler | 6aa7eec | 2023-03-03 12:41:14 -0600 | [diff] [blame] | 4 | inherit autotools pkgconfig ptest |
| 5 | |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 6 | SRC_URI += " \ |
| 7 | https://www.kernel.org/pub/software/libs/libgpiod/libgpiod-${PV}.tar.xz \ |
| 8 | file://run-ptest \ |
| 9 | " |
Andrew Geissler | 6aa7eec | 2023-03-03 12:41:14 -0600 | [diff] [blame] | 10 | |
| 11 | PACKAGECONFIG[cxx] = "--enable-bindings-cxx,--disable-bindings-cxx" |
| 12 | |
| 13 | # Enable cxx bindings by default. |
| 14 | PACKAGECONFIG ?= " \ |
| 15 | cxx \ |
| 16 | ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)} \ |
| 17 | " |
| 18 | |
| 19 | # Always build tools - they don't have any additional |
| 20 | # requirements over the library. |
| 21 | EXTRA_OECONF = "--enable-tools" |
| 22 | |
| 23 | DEPENDS += "autoconf-archive-native" |
| 24 | |
| 25 | PACKAGES =+ "${PN}-tools libgpiodcxx" |
| 26 | FILES:${PN}-tools += " \ |
| 27 | ${bindir}/gpiodetect \ |
| 28 | ${bindir}/gpioinfo \ |
| 29 | ${bindir}/gpioget \ |
| 30 | ${bindir}/gpioset \ |
| 31 | ${bindir}/gpiomon \ |
| 32 | " |
Andrew Geissler | 6aa7eec | 2023-03-03 12:41:14 -0600 | [diff] [blame] | 33 | FILES:libgpiodcxx = "${libdir}/libgpiodcxx.so.*" |
| 34 | |
| 35 | RRECOMMENDS:${PN}-ptest += "coreutils" |
Andrew Geissler | 6aa7eec | 2023-03-03 12:41:14 -0600 | [diff] [blame] | 36 | |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 37 | do_install:append() { |
| 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 |
| 42 | } |
| 43 | |
Andrew Geissler | 6aa7eec | 2023-03-03 12:41:14 -0600 | [diff] [blame] | 44 | do_install_ptest() { |
| 45 | install -d ${D}${PTEST_PATH}/tests/ |
| 46 | |
| 47 | # These are the core C library tests |
| 48 | install -m 0755 ${B}/tests/.libs/gpiod-test ${D}${PTEST_PATH}/tests/ |
| 49 | |
| 50 | # Tools are always built so let's always install them for ptest even if |
| 51 | # we're not selecting libgpiod-tools. |
Andrew Geissler | 6aa7eec | 2023-03-03 12:41:14 -0600 | [diff] [blame] | 52 | for tool in ${FILES:${PN}-tools}; do |
| 53 | install ${B}/tools/.libs/$(basename $tool) ${D}${PTEST_PATH}/tests/ |
| 54 | done |
| 55 | |
| 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/ |
| 58 | fi |
| 59 | } |
| 60 | |