Andrew Geissler | a2681d9 | 2020-10-16 10:17:07 -0500 | [diff] [blame] | 1 | SUMMARY = "C library and tools for interacting with the linux GPIO character device" |
Andrew Geissler | 6972109 | 2021-07-23 12:57:00 -0400 | [diff] [blame] | 2 | AUTHOR = "Bartosz Golaszewski <brgl@bgdev.pl>" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 3 | |
Andrew Geissler | a2681d9 | 2020-10-16 10:17:07 -0500 | [diff] [blame] | 4 | LICENSE = "LGPLv2.1+" |
| 5 | LIC_FILES_CHKSUM = "file://COPYING;md5=2caced0b25dfefd4c601d92bd15116de" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 6 | |
Andrew Geissler | 6972109 | 2021-07-23 12:57:00 -0400 | [diff] [blame] | 7 | SRC_URI = " \ |
| 8 | https://www.kernel.org/pub/software/libs/${BPN}/${BP}.tar.xz \ |
| 9 | file://run-ptest \ |
Andrew Geissler | ac970dd | 2021-02-12 15:32:45 -0600 | [diff] [blame] | 10 | " |
| 11 | |
Andrew Geissler | 32b1199 | 2021-03-31 13:37:05 -0500 | [diff] [blame] | 12 | SRC_URI[md5sum] = "28e79f6f70fee1da9079558d8b7b3736" |
| 13 | SRC_URI[sha256sum] = "841be9d788f00bab08ef22c4be5c39866f0e46cb100a3ae49ed816ac9c5dddc7" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 14 | |
Andrew Geissler | ac970dd | 2021-02-12 15:32:45 -0600 | [diff] [blame] | 15 | inherit autotools pkgconfig python3native ptest |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 16 | |
Andrew Geissler | 6972109 | 2021-07-23 12:57:00 -0400 | [diff] [blame] | 17 | PACKAGECONFIG[tests] = "--enable-tests,--disable-tests,kmod udev glib-2.0 catch2,bats python3-packaging" |
Andrew Geissler | a2681d9 | 2020-10-16 10:17:07 -0500 | [diff] [blame] | 18 | PACKAGECONFIG[cxx] = "--enable-bindings-cxx,--disable-bindings-cxx" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 19 | PACKAGECONFIG[python3] = "--enable-bindings-python,--disable-bindings-python,python3" |
| 20 | |
Andrew Geissler | a2681d9 | 2020-10-16 10:17:07 -0500 | [diff] [blame] | 21 | # Enable cxx bindings by default. |
| 22 | PACKAGECONFIG ?= "cxx" |
| 23 | |
| 24 | # Always build tools - they don't have any additional |
| 25 | # requirements over the library. |
| 26 | EXTRA_OECONF = "--enable-tools" |
| 27 | |
| 28 | DEPENDS += "autoconf-archive-native" |
| 29 | |
Andrew Geissler | 6972109 | 2021-07-23 12:57:00 -0400 | [diff] [blame] | 30 | PACKAGES =+ "${PN}-tools libgpiodcxx ${PN}-python" |
| 31 | FILES_${PN}-tools = " \ |
| 32 | ${bindir}/gpiodetect \ |
| 33 | ${bindir}/gpioinfo \ |
| 34 | ${bindir}/gpioget \ |
| 35 | ${bindir}/gpioset \ |
| 36 | ${bindir}/gpiofind \ |
| 37 | ${bindir}/gpiomon \ |
| 38 | " |
| 39 | FILES_${PN}-ptest += " \ |
| 40 | ${bindir}/gpiod-test \ |
| 41 | ${bindir}/gpio-tools-test \ |
| 42 | ${bindir}/gpio-tools-test.bats \ |
| 43 | ${bindir}/gpiod-cxx-test \ |
| 44 | ${bindir}/gpiod_py_test.py \ |
| 45 | ${libdir}/libgpiomockup.so.* \ |
| 46 | " |
Andrew Geissler | a2681d9 | 2020-10-16 10:17:07 -0500 | [diff] [blame] | 47 | FILES_libgpiodcxx = "${libdir}/libgpiodcxx.so.*" |
Andrew Geissler | 97771a3 | 2021-03-05 15:23:11 -0600 | [diff] [blame] | 48 | FILES_${PN}-python = "${PYTHON_SITEPACKAGES_DIR}/*.so" |
| 49 | FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a" |
Andrew Geissler | 6972109 | 2021-07-23 12:57:00 -0400 | [diff] [blame] | 50 | |
| 51 | RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'python3', '${PN}-python', '', d)}" |
| 52 | RRECOMMENDS_${PN}-ptest += "kernel-module-gpio-mockup" |
Andrew Geissler | ac970dd | 2021-02-12 15:32:45 -0600 | [diff] [blame] | 53 | |
| 54 | PACKAGECONFIG_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'tests', '', d)}" |
| 55 | |
| 56 | do_install_ptest() { |
Andrew Geissler | 6972109 | 2021-07-23 12:57:00 -0400 | [diff] [blame] | 57 | install -d ${D}${PTEST_PATH}/tests |
| 58 | |
| 59 | # These are the core C library tests |
| 60 | install -m 0755 ${B}/tests/.libs/gpiod-test ${D}${PTEST_PATH}/tests/ |
| 61 | |
| 62 | # Tools are always built so let's always install them for ptest even if |
| 63 | # we're not selecting libgpiod-tools. |
| 64 | install -m 0755 ${S}/tools/gpio-tools-test ${D}${PTEST_PATH}/tests/ |
| 65 | install -m 0755 ${S}/tools/gpio-tools-test.bats ${D}${PTEST_PATH}/tests/ |
| 66 | for tool in ${FILES_${PN}-tools}; do |
| 67 | install ${B}/tools/.libs/$(basename $tool) ${D}${PTEST_PATH}/tests/ |
| 68 | done |
| 69 | |
| 70 | if ${@bb.utils.contains('PACKAGECONFIG', 'cxx', 'true', 'false', d)}; then |
| 71 | install -m 0755 ${B}/bindings/cxx/tests/.libs/gpiod-cxx-test ${D}${PTEST_PATH}/tests/ |
| 72 | fi |
| 73 | |
| 74 | if ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'true', 'false', d)}; then |
| 75 | install -m 0755 ${S}/bindings/python/tests/gpiod_py_test.py ${D}${PTEST_PATH}/tests/ |
| 76 | fi |
Andrew Geissler | ac970dd | 2021-02-12 15:32:45 -0600 | [diff] [blame] | 77 | } |