From: Karol Lewandowski Date: Wed, 14 Sep 2022 21:41:47 +0000 (+0200) Subject: Merge tag 'v1.0.23' into tizen X-Git-Tag: accepted/tizen/unified/20230105.154718~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F40%2F281240%2F1;p=platform%2Fupstream%2Flibusb.git Merge tag 'v1.0.23' into tizen Change-Id: I6205f6d3a23077db72becca3e0964573d38b9f7c --- 170495d3601c32a7831fcaa065f4183c32bcb59b diff --cc configure.ac index caf9ed0,da8a158..179fff2 --- a/configure.ac +++ b/configure.ac @@@ -107,18 -107,7 +107,18 @@@ case $backend i linux) AC_DEFINE(OS_LINUX, 1, [Linux backend]) AC_SUBST(OS_LINUX) + + AC_ARG_ENABLE([usbhost_api], + [AC_HELP_STRING([--enable-usbhost-api], [Request to deviced to obtain dev node fds [default=no]])], + [], [enable_usbhost_api="no"]) + if test "x$enable_usbhost_api" = "xyes"; then + PKG_CHECK_MODULES([USBHOST_API], [dbus-1]) + AC_DEFINE(USE_USBHOST_API, 1, [Request to deviced to obtain dev node fds]) + fi + + AC_SUBST(USE_USBHOST_API) + - AC_SEARCH_LIBS([clock_gettime2], [rt], [], [], [-pthread]) + AC_SEARCH_LIBS([clock_gettime], [rt], [], [], [-pthread]) AC_ARG_ENABLE([udev], [AC_HELP_STRING([--enable-udev], [use udev for device enumeration and hotplug support (recommended) [default=yes]])], [], [enable_udev=yes]) diff --cc libusb/descriptor.c index 0e83094,53905e6..3cbbd4c --- a/libusb/descriptor.c +++ b/libusb/descriptor.c @@@ -228,10 -228,9 +228,10 @@@ static int parse_interface(libusb_conte while (size >= INTERFACE_DESC_LENGTH) { struct libusb_interface_descriptor *altsetting = (struct libusb_interface_descriptor *) usb_interface->altsetting; - altsetting = usbi_reallocf(altsetting, + /* can't use usbi_realloc() as we need to free libusb_interface_descriptor members - see clear_interface() */ + altsetting = realloc(altsetting, sizeof(struct libusb_interface_descriptor) * - (usb_interface->num_altsetting + 1)); + ((size_t)usb_interface->num_altsetting + 1)); if (!altsetting) { r = LIBUSB_ERROR_NO_MEM; goto err; diff --cc packaging/libusb.spec index 652c92e,0000000..85e6d53 mode 100755,000000..100755 --- a/packaging/libusb.spec +++ b/packaging/libusb.spec @@@ -1,70 -1,0 +1,70 @@@ +%define TIZEN_FEATURE_USBHOST_API on + +Name: libusb - Version: 1.0.22 ++Version: 1.0.23 +Release: 0 +License: LGPL-2.1+, MIT +Summary: USB Library +Url: http://www.libusb.org/ +Group: Base/Device Management +Source: %{name}-%{version}.tar.bz2 +Source1: baselibs.conf +Source1001: libusb.manifest +BuildRequires: pkg-config +BuildRequires: systemd-devel +%if %{?TIZEN_FEATURE_USBHOST_API} == on +BuildRequires: pkgconfig(dbus-1) +%endif + +%description +Libusb is a library that allows userspace access to USB devices. + +%package devel +Summary: USB Library +Group: Development/Libraries +Requires: glibc-devel +Requires: libusb = %{version} + +%description devel +Libusb is a library that allows userspace access to USB devices. + +%prep +%setup -q +cp %{SOURCE1001} . + +%build +%reconfigure\ + --with-pic\ +%if %{?TIZEN_FEATURE_USBHOST_API} == on + --enable-usbhost-api \ +%endif + --disable-static +make %{?_smp_mflags} + +%install +%make_install +# usbhost_module +mkdir -p %{buildroot}%{_prefix}/lib/udev/rules.d +install -m 644 udev/99-usbhost.rules %{buildroot}%{_prefix}/lib/udev/rules.d/99-usbhost.rules + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%files +%manifest %{name}.manifest +%defattr(-,root,root) +%license LICENSE.LGPL-2.1+ LICENSE.MIT +%{_libdir}/*.so.* +# usbhost_module +%{_prefix}/lib/udev/rules.d/99-usbhost.rules + +%files devel +%manifest %{name}.manifest +%defattr(-,root,root) +%license LICENSE.LGPL-2.1+ LICENSE.MIT +%{_includedir}/libusb-1.0 +%{_libdir}/*.so +%{_libdir}/pkgconfig/*.pc + +%changelog