blob: 57f1f54387065f08a8e6568d9f9fb0a610068117 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "libusb-0.1 compatibility layer for libusb1"
2DESCRIPTION = "libusb-0.1 compatible layer for libusb1, a drop-in replacement \
3that aims to look, feel and behave exactly like libusb-0.1"
4HOMEPAGE = "http://www.libusb.org/"
5BUGTRACKER = "http://www.libusb.org/report"
6SECTION = "libs"
7
Andrew Geissler9aee5002022-03-30 16:27:02 +00008LICENSE = "LGPL-2.1-or-later"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05009LIC_FILES_CHKSUM = "file://LICENSE;md5=f2ac5f3ac4835e8f91324a26a590a423"
10DEPENDS = "libusb1"
11
Andrew Geisslerfc113ea2023-03-31 09:59:46 -050012# libusb-compat dlopen() libusb1 so we need to explicitly RDEPENDS on it
13RDEPENDS:${PN} += "libusb1"
14
Patrick Williamsc124f4f2015-09-15 14:41:29 -050015# Few packages are known not to work with libusb-compat (e.g. libmtp-1.0.0),
16# so here libusb-0.1 is removed completely instead of adding virtual/libusb0.
17# Besides, libusb-0.1 uses a per 1ms polling that hurts a lot to power
18# consumption.
19PROVIDES = "libusb virtual/libusb0"
20BBCLASSEXTEND = "native nativesdk"
21
22PE = "1"
23
Andrew Geissler2ee498a2020-05-29 15:52:06 -050024SRC_URI = " \
Andrew Geissler595f6302022-01-24 19:11:47 +000025 git://github.com/libusb/libusb-compat-0.1.git;protocol=https;branch=master \
Andrew Geissler2ee498a2020-05-29 15:52:06 -050026 file://0001-usb.h-Include-sys-types.h.patch \
Andrew Geisslerfc113ea2023-03-31 09:59:46 -050027 file://0002-automake-make-example-programs-installable.patch \
28 file://run-ptest \
Andrew Geissler2ee498a2020-05-29 15:52:06 -050029"
Andrew Geisslerfc113ea2023-03-31 09:59:46 -050030SRCREV = "c497eff1ae8c4cfd4fdff370f04c78fa0584f4f3"
Andrew Geissler2ee498a2020-05-29 15:52:06 -050031S = "${WORKDIR}/git"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050032
Andrew Geissler2ee498a2020-05-29 15:52:06 -050033UPSTREAM_CHECK_URI = "https://github.com/libusb/libusb-compat-0.1/releases"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050034
Patrick Williamsc124f4f2015-09-15 14:41:29 -050035BINCONFIG = "${bindir}/libusb-config"
36
Andrew Geisslerfc113ea2023-03-31 09:59:46 -050037inherit autotools pkgconfig binconfig-disabled lib_package ptest
Patrick Williamsc124f4f2015-09-15 14:41:29 -050038
Andrew Geisslerfc113ea2023-03-31 09:59:46 -050039# examples are used as ptest so enable them at configuration if needed
40EXTRA_OECONF += "${@bb.utils.contains('PTEST_ENABLED', '1', '--enable-examples-build', '', d)}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050041
Andrew Geisslerfc113ea2023-03-31 09:59:46 -050042# Move test binaries out of bindir to avoid clashing with a "real" lsusb.
43do_install_ptest() {
44 for bin in lsusb testlibusb; do
45 mv ${D}${bindir}/$bin ${D}${PTEST_PATH}
46 done
Patrick Williamsc124f4f2015-09-15 14:41:29 -050047}