diff --git a/sdk_container/src/third_party/portage-stable/dev-libs/libusb/Manifest b/sdk_container/src/third_party/portage-stable/dev-libs/libusb/Manifest index e5d7306711..f7d51a1058 100644 --- a/sdk_container/src/third_party/portage-stable/dev-libs/libusb/Manifest +++ b/sdk_container/src/third_party/portage-stable/dev-libs/libusb/Manifest @@ -1,3 +1,2 @@ -DIST libusb-1.0.19.tar.bz2 521496 BLAKE2B 9f38dcb8f053019511dc2eed93772183c5487917794abd2839e981924bf05e39aba5cee4fb9a366b78e4d265fb16a921fb64c9a083323993ce21543d37073720 SHA512 f42f0187bfec16ebabad64efef7a7651ee85dcf2af1b7cbe543b7de615f9c6432f7eea5fcc6b23335591dcad287c905eb9bd56199cc5d3b47435027ad678f2c1 -DIST libusb-1.0.20.tar.bz2 795247 BLAKE2B 9b3b4b9e372487ca355611917eb00a41d439df391796edf0b4fea28fcd88ca92214d05c4beb8eaf918028d833544e385e59ca38426880c293e070c5f1fc64647 SHA512 4230047dbc18db402f399a6b228f70da37ce4f9da9d57203e5c31cf0edec5ddd664865b4f16038a2ae72c26097e713b709b9e882a11b65a274e84993d617c765 -DIST libusb-1.0.21.tar.bz2 607417 BLAKE2B c76352a19f416ad27b8940e99f38878e248cdbc04ef97752f8c8468ab0391869ab611197e3e143d69e0e23563da59f1691c14fce72958fdf28ebf10dd8c1521b SHA512 015ca07bdb559aa40af5db1302ab0b1c8a30d593699fe2f3c9f45162673dc7b608cecc58d60fde8f3bde2a68370794a045e8efa48fc55402eece11261e525762 +DIST libusb-1.0.24.tar.bz2 606593 BLAKE2B f6188b5af1225cf8b6d1486b6efcf48e837ee4f2e3592adab3ae6aae0a74a67aa54f40f0dd547f951a194d40954f2ee33acf741d2eee0b8449ce64f2edcf1018 SHA512 5aea36a530aaa15c6dd656d0ed3ce204522c9946d8d39ffbb290dab4a98cda388a2598da4995123d1032324056090bd429e702459626d3e8d7daeebc4e7ff3dc +DIST libusb-1.0.25.tar.bz2 609127 BLAKE2B 3aecfbf9fc068fdfb8e612918bb895988f8400dc2c3ffd96a81792ab844d632f0c098947200512ddc37cfa9003956f8454c1d0362973a5d646a225f81cc2923b SHA512 f1e6e5577d4bd1ff136927dc66c615014a06ac332ddd797b1d1ad5f7b68e2405e66068dcb210e2f0ae3e31681603ef72efbd88bf7fbe0eb41ce700fdc3f92f9d diff --git a/sdk_container/src/third_party/portage-stable/dev-libs/libusb/files/libusb-1.0.24-multi_device_config_parsing.patch b/sdk_container/src/third_party/portage-stable/dev-libs/libusb/files/libusb-1.0.24-multi_device_config_parsing.patch new file mode 100644 index 0000000000..739d41c404 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-libs/libusb/files/libusb-1.0.24-multi_device_config_parsing.patch @@ -0,0 +1,65 @@ +From f6d2cb561402c3b6d3627c0eb89e009b503d9067 Mon Sep 17 00:00:00 2001 +From: Chris Dickens +Date: Sun, 13 Dec 2020 15:49:19 -0800 +Subject: [PATCH] linux_usbfs: Fix parsing of descriptors for + multi-configuration devices + +Commit e2be556bd2 ("linux_usbfs: Parse config descriptors during device +initialization") introduced a regression for devices with multiple +configurations. The logic that verifies the reported length of the +configuration descriptors failed to count the length of the +configuration descriptor itself and would truncate the actual length by +9 bytes, leading to a parsing error for subsequent descriptors. + +Closes #825 + +Signed-off-by: Chris Dickens +--- + libusb/os/linux_usbfs.c | 12 ++++++++---- + libusb/version_nano.h | 2 +- + 2 files changed, 9 insertions(+), 5 deletions(-) + +diff --git a/libusb/os/linux_usbfs.c b/libusb/os/linux_usbfs.c +index fb2ed53a..4d2dc8d6 100644 +--- a/libusb/os/linux_usbfs.c ++++ b/libusb/os/linux_usbfs.c +@@ -641,7 +641,12 @@ static int seek_to_next_config(struct libusb_context *ctx, + uint8_t *buffer, size_t len) + { + struct usbi_descriptor_header *header; +- int offset = 0; ++ int offset; ++ ++ /* Start seeking past the config descriptor */ ++ offset = LIBUSB_DT_CONFIG_SIZE; ++ buffer += LIBUSB_DT_CONFIG_SIZE; ++ len -= LIBUSB_DT_CONFIG_SIZE; + + while (len > 0) { + if (len < 2) { +@@ -718,7 +723,7 @@ static int parse_config_descriptors(struct libusb_device *dev) + } + + if (priv->sysfs_dir) { +- /* ++ /* + * In sysfs wTotalLength is ignored, instead the kernel returns a + * config descriptor with verified bLength fields, with descriptors + * with an invalid bLength removed. +@@ -727,8 +732,7 @@ static int parse_config_descriptors(struct libusb_device *dev) + int offset; + + if (num_configs > 1 && idx < num_configs - 1) { +- offset = seek_to_next_config(ctx, buffer + LIBUSB_DT_CONFIG_SIZE, +- remaining - LIBUSB_DT_CONFIG_SIZE); ++ offset = seek_to_next_config(ctx, buffer, remaining); + if (offset < 0) + return offset; + sysfs_config_len = (uint16_t)offset; +diff --git a/libusb/version_nano.h b/libusb/version_nano.h +index 61a0a700..578b0979 100644 +--- a/libusb/version_nano.h ++++ b/libusb/version_nano.h +@@ -1 +1 @@ +-#define LIBUSB_NANO 11584 ++#define LIBUSB_NANO 11586 diff --git a/sdk_container/src/third_party/portage-stable/dev-libs/libusb/files/libusb-1.0.25-fix-O3-warning.patch b/sdk_container/src/third_party/portage-stable/dev-libs/libusb/files/libusb-1.0.25-fix-O3-warning.patch new file mode 100644 index 0000000000..7270b057d1 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-libs/libusb/files/libusb-1.0.25-fix-O3-warning.patch @@ -0,0 +1,32 @@ +https://github.com/libusb/libusb/pull/1062 +https://github.com/libusb/libusb/issues/1063 +https://bugs.gentoo.org/832732 + +From 8bb81fe72286cdcb782c7af4f0d7ef715b2e137c Mon Sep 17 00:00:00 2001 +From: Yegor Yefremov +Date: Sun, 6 Feb 2022 07:12:14 +0100 +Subject: [PATCH] linux_usbfs: fix maybe-uninitialized error +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Initialize active_config to an invalid value to avoid the following +compilation error: + +os/linux_usbfs.c: In function ‘op_get_configuration’: +os/linux_usbfs.c:1452:12: error: ‘active_config’ may be used uninitialized in this function [-Werror=maybe-uninitialized] + 1452 | *config = (uint8_t)active_config; + +Signed-off-by: Yegor Yefremov +--- a/libusb/os/linux_usbfs.c ++++ b/libusb/os/linux_usbfs.c +@@ -1429,7 +1429,7 @@ static int op_get_configuration(struct libusb_device_handle *handle, + uint8_t *config) + { + struct linux_device_priv *priv = usbi_get_device_priv(handle->dev); +- int active_config; ++ int active_config = -1; /* to please compiler */ + int r; + + if (priv->sysfs_dir) { + diff --git a/sdk_container/src/third_party/portage-stable/dev-libs/libusb/libusb-1.0.19-r1.ebuild b/sdk_container/src/third_party/portage-stable/dev-libs/libusb/libusb-1.0.19-r1.ebuild deleted file mode 100644 index e6a4ae67ce..0000000000 --- a/sdk_container/src/third_party/portage-stable/dev-libs/libusb/libusb-1.0.19-r1.ebuild +++ /dev/null @@ -1,70 +0,0 @@ -# Copyright 1999-2016 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI=5 -inherit eutils toolchain-funcs multilib-minimal - -DESCRIPTION="Userspace access to USB devices" -HOMEPAGE="http://libusb.info/" -SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2" - -LICENSE="LGPL-2.1" -SLOT="1" -KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 -x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" -IUSE="debug doc examples static-libs test udev" - -RDEPEND="udev? ( >=virtual/libudev-208:=[${MULTILIB_USEDEP},static-libs?] ) - abi_x86_32? ( - !<=app-emulation/emul-linux-x86-baselibs-20130224-r7 - !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] - )" -DEPEND="${RDEPEND} - doc? ( app-doc/doxygen ) - !udev? ( virtual/os-headers )" - -multilib_src_configure() { - ECONF_SOURCE=${S} \ - econf \ - $(use_enable static-libs static) \ - $(use_enable udev) \ - $(use_enable debug debug-log) \ - $(use_enable test tests-build) -} - -multilib_src_compile() { - emake - - if multilib_is_native_abi; then - use doc && emake -C doc docs - fi -} - -multilib_src_test() { - emake check - - # noinst_PROGRAMS from tests/Makefile.am - tests/stress || die -} - -multilib_src_install() { - emake DESTDIR="${D}" install - - if multilib_is_native_abi; then - gen_usr_ldscript -a usb-1.0 - - use doc && dohtml doc/html/* - fi -} - -multilib_src_install_all() { - prune_libtool_files - - dodoc AUTHORS ChangeLog NEWS PORTING README TODO - - if use examples; then - insinto /usr/share/doc/${PF}/examples - doins examples/*.{c,h} - insinto /usr/share/doc/${PF}/examples/getopt - doins examples/getopt/*.{c,h} - fi -} diff --git a/sdk_container/src/third_party/portage-stable/dev-libs/libusb/libusb-1.0.20.ebuild b/sdk_container/src/third_party/portage-stable/dev-libs/libusb/libusb-1.0.20.ebuild deleted file mode 100644 index 5ac36c1e04..0000000000 --- a/sdk_container/src/third_party/portage-stable/dev-libs/libusb/libusb-1.0.20.ebuild +++ /dev/null @@ -1,71 +0,0 @@ -# Copyright 1999-2016 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI=5 -inherit eutils toolchain-funcs multilib-minimal - -DESCRIPTION="Userspace access to USB devices" -HOMEPAGE="http://libusb.info/ https://github.com/libusb/libusb" -SRC_URI="https://github.com/${PN}/${PN}/releases/download/v${PV}/${P}.tar.bz2" - -LICENSE="LGPL-2.1" -SLOT="1" -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 -x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" -IUSE="debug doc examples static-libs test udev" - -RDEPEND="udev? ( >=virtual/libudev-208:=[${MULTILIB_USEDEP},static-libs?] ) - abi_x86_32? ( - !<=app-emulation/emul-linux-x86-baselibs-20130224-r7 - !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] - )" -DEPEND="${RDEPEND} - doc? ( app-doc/doxygen ) - !udev? ( virtual/os-headers )" - -multilib_src_configure() { - ECONF_SOURCE=${S} \ - econf \ - $(use_enable static-libs static) \ - $(use_enable udev) \ - $(use_enable debug debug-log) \ - $(use_enable test tests-build) -} - -multilib_src_compile() { - # Bug 573802 - emake -j1 - - if multilib_is_native_abi; then - use doc && emake -C doc docs - fi -} - -multilib_src_test() { - emake check - - # noinst_PROGRAMS from tests/Makefile.am - tests/stress || die -} - -multilib_src_install() { - emake DESTDIR="${D}" install - - if multilib_is_native_abi; then - gen_usr_ldscript -a usb-1.0 - - use doc && dohtml doc/html/* - fi -} - -multilib_src_install_all() { - prune_libtool_files - - dodoc AUTHORS ChangeLog NEWS PORTING README TODO - - if use examples; then - insinto /usr/share/doc/${PF}/examples - doins examples/*.{c,h} - insinto /usr/share/doc/${PF}/examples/getopt - doins examples/getopt/*.{c,h} - fi -} diff --git a/sdk_container/src/third_party/portage-stable/dev-libs/libusb/libusb-1.0.21.ebuild b/sdk_container/src/third_party/portage-stable/dev-libs/libusb/libusb-1.0.21.ebuild deleted file mode 100644 index 18cbced9c9..0000000000 --- a/sdk_container/src/third_party/portage-stable/dev-libs/libusb/libusb-1.0.21.ebuild +++ /dev/null @@ -1,66 +0,0 @@ -# Copyright 1999-2018 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI=5 -inherit eutils toolchain-funcs multilib-minimal - -DESCRIPTION="Userspace access to USB devices" -HOMEPAGE="http://libusb.info/ https://github.com/libusb/libusb" -SRC_URI="https://github.com/${PN}/${PN}/releases/download/v${PV}/${P}.tar.bz2" - -LICENSE="LGPL-2.1" -SLOT="1" -KEYWORDS="alpha amd64 arm ~arm64 ~hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 -x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" -IUSE="debug doc examples static-libs test udev" - -RDEPEND="udev? ( >=virtual/libudev-208:=[${MULTILIB_USEDEP},static-libs?] )" -DEPEND="${RDEPEND} - doc? ( app-doc/doxygen ) - !udev? ( virtual/os-headers )" - -multilib_src_configure() { - ECONF_SOURCE=${S} \ - econf \ - $(use_enable static-libs static) \ - $(use_enable udev) \ - $(use_enable debug debug-log) \ - $(use_enable test tests-build) -} - -multilib_src_compile() { - emake - - if multilib_is_native_abi; then - use doc && emake -C doc docs - fi -} - -multilib_src_test() { - emake check - - # noinst_PROGRAMS from tests/Makefile.am - tests/stress || die -} - -multilib_src_install() { - emake DESTDIR="${D}" install - - if multilib_is_native_abi; then - gen_usr_ldscript -a usb-1.0 - - use doc && dohtml doc/html/* - fi -} - -multilib_src_install_all() { - prune_libtool_files - - dodoc AUTHORS ChangeLog NEWS PORTING README TODO - - if use examples; then - insinto /usr/share/doc/${PF}/examples - doins examples/*.{c,h} - insinto /usr/share/doc/${PF}/examples/getopt - doins examples/getopt/*.{c,h} - fi -} diff --git a/sdk_container/src/third_party/portage-stable/dev-libs/libusb/libusb-1.0.24-r2.ebuild b/sdk_container/src/third_party/portage-stable/dev-libs/libusb/libusb-1.0.24-r2.ebuild new file mode 100644 index 0000000000..c13d355add --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-libs/libusb/libusb-1.0.24-r2.ebuild @@ -0,0 +1,76 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +inherit multilib-minimal usr-ldscript + +DESCRIPTION="Userspace access to USB devices" +HOMEPAGE="https://libusb.info/ https://github.com/libusb/libusb" +SRC_URI="https://github.com/${PN}/${PN}/releases/download/v${PV}/${P}.tar.bz2" + +LICENSE="LGPL-2.1" +SLOT="1" +KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos" +IUSE="debug doc examples static-libs test udev" +RESTRICT="!test? ( test )" +REQUIRED_USE="static-libs? ( !udev )" + +RDEPEND="udev? ( >=virtual/libudev-208:=[${MULTILIB_USEDEP}] )" +DEPEND="${RDEPEND} + !udev? ( virtual/os-headers )" +BDEPEND="doc? ( app-doc/doxygen )" + +PATCHES=( + "${FILESDIR}/${P}-multi_device_config_parsing.patch" #759814 +) + +multilib_src_configure() { + local myeconfargs=( + $(use_enable static-libs static) + $(use_enable udev) + $(use_enable debug debug-log) + $(use_enable test tests-build) + ) + ECONF_SOURCE="${S}" econf "${myeconfargs[@]}" +} + +multilib_src_compile() { + emake + + if multilib_is_native_abi; then + use doc && emake -C doc + fi +} + +multilib_src_test() { + emake check + + # noinst_PROGRAMS from tests/Makefile.am + if [[ -e /dev/bus/usb ]]; then + tests/stress || die + else + # https://bugs.gentoo.org/824266 + ewarn "/dev/bus/usb does not exist, skipping stress test" + fi +} + +multilib_src_install() { + emake DESTDIR="${D}" install + + if multilib_is_native_abi; then + gen_usr_ldscript -a usb-1.0 + + use doc && dodoc -r doc/api-1.0 + fi +} + +multilib_src_install_all() { + find "${ED}" -type f -name "*.la" -delete || die + + dodoc AUTHORS ChangeLog NEWS PORTING README TODO + + if use examples; then + docinto examples + dodoc examples/*.{c,h} + fi +} diff --git a/sdk_container/src/third_party/portage-stable/dev-libs/libusb/libusb-1.0.25.ebuild b/sdk_container/src/third_party/portage-stable/dev-libs/libusb/libusb-1.0.25.ebuild new file mode 100644 index 0000000000..71c8364d0b --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-libs/libusb/libusb-1.0.25.ebuild @@ -0,0 +1,78 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit multilib-minimal usr-ldscript + +DESCRIPTION="Userspace access to USB devices" +HOMEPAGE="https://libusb.info/ https://github.com/libusb/libusb" +SRC_URI="https://github.com/${PN}/${PN}/releases/download/v${PV}/${P}.tar.bz2" + +LICENSE="LGPL-2.1" +SLOT="1" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos" +IUSE="debug doc examples static-libs test udev" +RESTRICT="!test? ( test )" +REQUIRED_USE="static-libs? ( !udev )" + +RDEPEND="udev? ( >=virtual/libudev-208:=[${MULTILIB_USEDEP}] )" +DEPEND="${RDEPEND} + !udev? ( virtual/os-headers )" +BDEPEND="doc? ( app-doc/doxygen )" + +PATCHES=( + "${FILESDIR}"/${P}-fix-O3-warning.patch +) + +multilib_src_configure() { + local myeconfargs=( + $(use_enable static-libs static) + $(use_enable udev) + $(use_enable debug debug-log) + $(use_enable test tests-build) + ) + + ECONF_SOURCE="${S}" econf "${myeconfargs[@]}" +} + +multilib_src_compile() { + emake + + if multilib_is_native_abi; then + use doc && emake -C doc + fi +} + +multilib_src_test() { + emake check + + # noinst_PROGRAMS from tests/Makefile.am + if [[ -e /dev/bus/usb ]]; then + tests/stress || die + else + # bug #824266 + ewarn "/dev/bus/usb does not exist, skipping stress test" + fi +} + +multilib_src_install() { + emake DESTDIR="${D}" install + + if multilib_is_native_abi; then + gen_usr_ldscript -a usb-1.0 + + use doc && dodoc -r doc/api-1.0 + fi +} + +multilib_src_install_all() { + find "${ED}" -type f -name "*.la" -delete || die + + dodoc AUTHORS ChangeLog NEWS PORTING README TODO + + if use examples; then + docinto examples + dodoc examples/*.{c,h} + fi +} diff --git a/sdk_container/src/third_party/portage-stable/dev-libs/libusb/metadata.xml b/sdk_container/src/third_party/portage-stable/dev-libs/libusb/metadata.xml index d66b26b86d..7875c78824 100644 --- a/sdk_container/src/third_party/portage-stable/dev-libs/libusb/metadata.xml +++ b/sdk_container/src/third_party/portage-stable/dev-libs/libusb/metadata.xml @@ -1,14 +1,10 @@ - - + + base-system@gentoo.org Gentoo Base System - - peter@stuge.se - Peter Stuge - libusb/libusb