diff options
-rw-r--r-- | meta-oe/recipes-support/libgpiod/libgpiod-1.6.4/run-ptest (renamed from meta-oe/recipes-support/libgpiod/files/run-ptest) | 0 | ||||
-rw-r--r-- | meta-oe/recipes-support/libgpiod/libgpiod-2.0-rc2/run-ptest | 24 | ||||
-rw-r--r-- | meta-oe/recipes-support/libgpiod/libgpiod-src.inc | 1 | ||||
-rw-r--r-- | meta-oe/recipes-support/libgpiod/libgpiod.inc | 61 | ||||
-rw-r--r-- | meta-oe/recipes-support/libgpiod/libgpiod_1.6.4.bb | 56 | ||||
-rw-r--r-- | meta-oe/recipes-support/libgpiod/libgpiod_2.0-rc2.bb | 21 |
6 files changed, 113 insertions, 50 deletions
diff --git a/meta-oe/recipes-support/libgpiod/files/run-ptest b/meta-oe/recipes-support/libgpiod/libgpiod-1.6.4/run-ptest index 61b9b69fc6..61b9b69fc6 100644 --- a/meta-oe/recipes-support/libgpiod/files/run-ptest +++ b/meta-oe/recipes-support/libgpiod/libgpiod-1.6.4/run-ptest | |||
diff --git a/meta-oe/recipes-support/libgpiod/libgpiod-2.0-rc2/run-ptest b/meta-oe/recipes-support/libgpiod/libgpiod-2.0-rc2/run-ptest new file mode 100644 index 0000000000..9475f02535 --- /dev/null +++ b/meta-oe/recipes-support/libgpiod/libgpiod-2.0-rc2/run-ptest | |||
@@ -0,0 +1,24 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | testbins="gpiod-test gpio-tools-test gpiod-cxx-test" | ||
4 | |||
5 | ptestdir=$(dirname "$(readlink -f "$0")") | ||
6 | cd $ptestdir/tests | ||
7 | |||
8 | # libgpiod v2 uses gpio-sim - a configfs-based testing module. We need to | ||
9 | # make sure configfs is mounted before running any tests. | ||
10 | modprobe configfs | ||
11 | mountpoint /sys/kernel/config > /dev/null || mount -t configfs configfs /sys/kernel/config | ||
12 | |||
13 | for testbin in $testbins; do | ||
14 | if test -e ./$testbin; then | ||
15 | ./$testbin > ./$testbin.out 2>&1 | ||
16 | if [ $? -ne 0 ]; then | ||
17 | echo "FAIL: $testbin" | ||
18 | else | ||
19 | echo "PASS: $testbin" | ||
20 | fi | ||
21 | else | ||
22 | echo "SKIP: $testbin" | ||
23 | fi | ||
24 | done | ||
diff --git a/meta-oe/recipes-support/libgpiod/libgpiod-src.inc b/meta-oe/recipes-support/libgpiod/libgpiod-src.inc new file mode 100644 index 0000000000..6bab4c1f42 --- /dev/null +++ b/meta-oe/recipes-support/libgpiod/libgpiod-src.inc | |||
@@ -0,0 +1 @@ | |||
SRC_URI += "https://www.kernel.org/pub/software/libs/libgpiod/libgpiod-${PV}.tar.xz" | |||
diff --git a/meta-oe/recipes-support/libgpiod/libgpiod.inc b/meta-oe/recipes-support/libgpiod/libgpiod.inc new file mode 100644 index 0000000000..abb6544ec2 --- /dev/null +++ b/meta-oe/recipes-support/libgpiod/libgpiod.inc | |||
@@ -0,0 +1,61 @@ | |||
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 | |||
diff --git a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.4.bb b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.4.bb index 70a77c8834..df0e3f104a 100644 --- a/meta-oe/recipes-support/libgpiod/libgpiod_1.6.4.bb +++ b/meta-oe/recipes-support/libgpiod/libgpiod_1.6.4.bb | |||
@@ -1,80 +1,36 @@ | |||
1 | SUMMARY = "C library and tools for interacting with the linux GPIO character device" | 1 | require libgpiod.inc |
2 | AUTHOR = "Bartosz Golaszewski <brgl@bgdev.pl>" | ||
3 | 2 | ||
4 | LICENSE = "LGPL-2.1-or-later" | 3 | LICENSE = "LGPL-2.1-or-later" |
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=2caced0b25dfefd4c601d92bd15116de" | 4 | LIC_FILES_CHKSUM = "file://COPYING;md5=2caced0b25dfefd4c601d92bd15116de" |
6 | 5 | ||
7 | SRC_URI = " \ | ||
8 | https://www.kernel.org/pub/software/libs/${BPN}/${BP}.tar.xz \ | ||
9 | file://run-ptest \ | ||
10 | " | ||
11 | |||
12 | SRC_URI[md5sum] = "7a2cca6ead9296c27e877070dd8853bc" | ||
13 | SRC_URI[sha256sum] = "7b146e12f28fbca3df7557f176eb778c5ccf952ca464698dba8a61b2e1e3f9b5" | 6 | SRC_URI[sha256sum] = "7b146e12f28fbca3df7557f176eb778c5ccf952ca464698dba8a61b2e1e3f9b5" |
14 | 7 | ||
15 | inherit autotools pkgconfig python3native ptest | 8 | inherit python3native |
16 | 9 | ||
17 | PACKAGECONFIG[tests] = "--enable-tests,--disable-tests,kmod udev glib-2.0 catch2" | 10 | PACKAGECONFIG[tests] = "--enable-tests,--disable-tests,kmod udev glib-2.0 catch2" |
18 | PACKAGECONFIG[cxx] = "--enable-bindings-cxx,--disable-bindings-cxx" | ||
19 | PACKAGECONFIG[python3] = "--enable-bindings-python,--disable-bindings-python,python3" | 11 | PACKAGECONFIG[python3] = "--enable-bindings-python,--disable-bindings-python,python3" |
20 | 12 | ||
21 | # Enable cxx bindings by default. | ||
22 | PACKAGECONFIG ?= "cxx \ | ||
23 | ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)}" | ||
24 | |||
25 | # Always build tools - they don't have any additional | 13 | # Always build tools - they don't have any additional |
26 | # requirements over the library. | 14 | # requirements over the library. |
27 | EXTRA_OECONF = "--enable-tools" | 15 | EXTRA_OECONF = "--enable-tools" |
28 | 16 | ||
29 | DEPENDS += "autoconf-archive-native" | 17 | PACKAGES =+ "${PN}-python" |
30 | 18 | FILES:${PN}-tools += "${bindir}/gpiofind" | |
31 | PACKAGES =+ "${PN}-tools libgpiodcxx ${PN}-python" | ||
32 | FILES:${PN}-tools = " \ | ||
33 | ${bindir}/gpiodetect \ | ||
34 | ${bindir}/gpioinfo \ | ||
35 | ${bindir}/gpioget \ | ||
36 | ${bindir}/gpioset \ | ||
37 | ${bindir}/gpiofind \ | ||
38 | ${bindir}/gpiomon \ | ||
39 | " | ||
40 | FILES:${PN}-ptest += " \ | 19 | FILES:${PN}-ptest += " \ |
41 | ${bindir}/gpiod-test \ | ||
42 | ${bindir}/gpio-tools-test \ | ||
43 | ${bindir}/gpio-tools-test.bats \ | ||
44 | ${bindir}/gpiod-cxx-test \ | ||
45 | ${bindir}/gpiod_py_test.py \ | 20 | ${bindir}/gpiod_py_test.py \ |
46 | ${libdir}/libgpiomockup.so.* \ | 21 | ${libdir}/libgpiomockup.so.* \ |
47 | " | 22 | " |
48 | FILES:libgpiodcxx = "${libdir}/libgpiodcxx.so.*" | ||
49 | FILES:${PN}-python = "${PYTHON_SITEPACKAGES_DIR}/*.so" | 23 | FILES:${PN}-python = "${PYTHON_SITEPACKAGES_DIR}/*.so" |
50 | FILES:${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a" | 24 | FILES:${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a" |
51 | 25 | ||
52 | RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'python3', '${PN}-python', '', d)}" | 26 | RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'python3', '${PN}-python', '', d)}" |
53 | RRECOMMENDS:${PN}-ptest += " \ | 27 | RRECOMMENDS:${PN}-ptest += " \ |
54 | kernel-module-gpio-mockup \ | 28 | kernel-module-gpio-mockup \ |
55 | coreutils \ | ||
56 | ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-unittest', '', d)} \ | 29 | ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-unittest', '', d)} \ |
57 | " | 30 | " |
58 | RDEPENDS:${PN}-ptest += "bats python3-packaging" | 31 | RDEPENDS:${PN}-ptest += "python3-packaging" |
59 | |||
60 | do_install_ptest() { | ||
61 | install -d ${D}${PTEST_PATH}/tests | ||
62 | |||
63 | # These are the core C library tests | ||
64 | install -m 0755 ${B}/tests/.libs/gpiod-test ${D}${PTEST_PATH}/tests/ | ||
65 | |||
66 | # Tools are always built so let's always install them for ptest even if | ||
67 | # we're not selecting libgpiod-tools. | ||
68 | install -m 0755 ${S}/tools/gpio-tools-test ${D}${PTEST_PATH}/tests/ | ||
69 | install -m 0755 ${S}/tools/gpio-tools-test.bats ${D}${PTEST_PATH}/tests/ | ||
70 | for tool in ${FILES:${PN}-tools}; do | ||
71 | install ${B}/tools/.libs/$(basename $tool) ${D}${PTEST_PATH}/tests/ | ||
72 | done | ||
73 | |||
74 | if ${@bb.utils.contains('PACKAGECONFIG', 'cxx', 'true', 'false', d)}; then | ||
75 | install -m 0755 ${B}/bindings/cxx/tests/.libs/gpiod-cxx-test ${D}${PTEST_PATH}/tests/ | ||
76 | fi | ||
77 | 32 | ||
33 | do_install_ptest:append() { | ||
78 | if ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'true', 'false', d)}; then | 34 | if ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'true', 'false', d)}; then |
79 | install -m 0755 ${S}/bindings/python/tests/gpiod_py_test.py ${D}${PTEST_PATH}/tests/ | 35 | install -m 0755 ${S}/bindings/python/tests/gpiod_py_test.py ${D}${PTEST_PATH}/tests/ |
80 | fi | 36 | fi |
diff --git a/meta-oe/recipes-support/libgpiod/libgpiod_2.0-rc2.bb b/meta-oe/recipes-support/libgpiod/libgpiod_2.0-rc2.bb new file mode 100644 index 0000000000..158175cdbb --- /dev/null +++ b/meta-oe/recipes-support/libgpiod/libgpiod_2.0-rc2.bb | |||
@@ -0,0 +1,21 @@ | |||
1 | require libgpiod.inc | ||
2 | |||
3 | LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later & CC-BY-SA-4.0" | ||
4 | LIC_FILES_CHKSUM = " \ | ||
5 | file://LICENSES/GPL-2.0-or-later.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ | ||
6 | file://LICENSES/LGPL-2.1-or-later.txt;md5=4b54a1fd55a448865a0b32d41598759d \ | ||
7 | file://LICENSES/CC-BY-SA-4.0.txt;md5=fba3b94d88bfb9b81369b869a1e9a20f \ | ||
8 | " | ||
9 | |||
10 | SRC_URI[sha256sum] = "1b931bfabef897911e59d45c80b8930c43fa72f08aab9c03e8dfd4005881c09e" | ||
11 | |||
12 | S = "${WORKDIR}/libgpiod-2.0" | ||
13 | |||
14 | # We must enable gpioset-interactive for all gpio-tools tests to pass | ||
15 | PACKAGECONFIG[tests] = "--enable-tests --enable-gpioset-interactive,--disable-tests,kmod util-linux glib-2.0 catch2 libedit" | ||
16 | PACKAGECONFIG[gpioset-interactive] = "--enable-gpioset-interactive,--disable-gpioset-interactive,libedit" | ||
17 | |||
18 | FILES:${PN}-tools += "${bindir}/gpionotify" | ||
19 | FILES:${PN}-ptest += "${libdir}/libgpiosim.so.*" | ||
20 | |||
21 | RRECOMMENDS:${PN}-ptest += "kernel-module-gpio-sim" | ||