diff options
3 files changed, 50 insertions, 1 deletions
diff --git a/meta-oe/recipes-support/libusb/libusb-compat/0002-automake-make-example-programs-installable.patch b/meta-oe/recipes-support/libusb/libusb-compat/0002-automake-make-example-programs-installable.patch new file mode 100644 index 0000000000..faf532cad2 --- /dev/null +++ b/meta-oe/recipes-support/libusb/libusb-compat/0002-automake-make-example-programs-installable.patch | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | From 9dcdfa716e3c3831d9b70472b39dab2fd370f503 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Yoann Congal <yoann.congal@smile.fr> | ||
| 3 | Date: Sun, 26 Feb 2023 16:04:35 +0100 | ||
| 4 | Subject: [PATCH] automake: make example programs installable | ||
| 5 | |||
| 6 | The example programs are used as tests for ptest, so we need a way to | ||
| 7 | install them on the rootfs. | ||
| 8 | |||
| 9 | Upstream-Status: Inappropriate [oe-core specific] | ||
| 10 | --- | ||
| 11 | examples/Makefile.am | 2 +- | ||
| 12 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 13 | |||
| 14 | diff --git a/examples/Makefile.am b/examples/Makefile.am | ||
| 15 | index 9bd3efc..f4324c2 100644 | ||
| 16 | --- a/examples/Makefile.am | ||
| 17 | +++ b/examples/Makefile.am | ||
| 18 | @@ -1,5 +1,5 @@ | ||
| 19 | AM_CPPFLAGS = -I$(top_srcdir)/libusb | ||
| 20 | -noinst_PROGRAMS = lsusb testlibusb | ||
| 21 | +bin_PROGRAMS = lsusb testlibusb | ||
| 22 | |||
| 23 | lsusb_SOURCES = lsusb.c | ||
| 24 | lsusb_LDADD = ../libusb/libusb.la | ||
diff --git a/meta-oe/recipes-support/libusb/libusb-compat/run-ptest b/meta-oe/recipes-support/libusb/libusb-compat/run-ptest new file mode 100644 index 0000000000..901662d696 --- /dev/null +++ b/meta-oe/recipes-support/libusb/libusb-compat/run-ptest | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | rc=0 | ||
| 4 | for TEST in lsusb testlibusb; do | ||
| 5 | if ! ./$TEST ; then | ||
| 6 | echo "FAIL: $TEST" | ||
| 7 | rc=$((rc + 1)) | ||
| 8 | else | ||
| 9 | echo "PASS: $TEST" | ||
| 10 | fi | ||
| 11 | done | ||
| 12 | |||
| 13 | # return number of failed tests | ||
| 14 | exit $rc | ||
diff --git a/meta-oe/recipes-support/libusb/libusb-compat_0.1.8.bb b/meta-oe/recipes-support/libusb/libusb-compat_0.1.8.bb index 884b1bbb24..bfafdae7a4 100644 --- a/meta-oe/recipes-support/libusb/libusb-compat_0.1.8.bb +++ b/meta-oe/recipes-support/libusb/libusb-compat_0.1.8.bb | |||
| @@ -21,6 +21,8 @@ PE = "1" | |||
| 21 | SRC_URI = " \ | 21 | SRC_URI = " \ |
| 22 | git://github.com/libusb/libusb-compat-0.1.git;protocol=https;branch=master \ | 22 | git://github.com/libusb/libusb-compat-0.1.git;protocol=https;branch=master \ |
| 23 | file://0001-usb.h-Include-sys-types.h.patch \ | 23 | file://0001-usb.h-Include-sys-types.h.patch \ |
| 24 | file://0002-automake-make-example-programs-installable.patch \ | ||
| 25 | file://run-ptest \ | ||
| 24 | " | 26 | " |
| 25 | SRCREV = "c497eff1ae8c4cfd4fdff370f04c78fa0584f4f3" | 27 | SRCREV = "c497eff1ae8c4cfd4fdff370f04c78fa0584f4f3" |
| 26 | S = "${WORKDIR}/git" | 28 | S = "${WORKDIR}/git" |
| @@ -29,5 +31,14 @@ UPSTREAM_CHECK_URI = "https://github.com/libusb/libusb-compat-0.1/releases" | |||
| 29 | 31 | ||
| 30 | BINCONFIG = "${bindir}/libusb-config" | 32 | BINCONFIG = "${bindir}/libusb-config" |
| 31 | 33 | ||
| 32 | inherit autotools pkgconfig binconfig-disabled lib_package | 34 | inherit autotools pkgconfig binconfig-disabled lib_package ptest |
| 33 | 35 | ||
| 36 | # examples are used as ptest so enable them at configuration if needed | ||
| 37 | EXTRA_OECONF += "${@bb.utils.contains('PTEST_ENABLED', '1', '--enable-examples-build', '', d)}" | ||
| 38 | |||
| 39 | # Move test binaries out of bindir to avoid clashing with a "real" lsusb. | ||
| 40 | do_install_ptest() { | ||
| 41 | for bin in lsusb testlibusb; do | ||
| 42 | mv ${D}${bindir}/$bin ${D}${PTEST_PATH} | ||
| 43 | done | ||
| 44 | } | ||
