Merge tag 'v1.0.23' into tizen 40/281240/1
authorKarol Lewandowski <k.lewandowsk@samsung.com>
Wed, 14 Sep 2022 21:41:47 +0000 (23:41 +0200)
committerKarol Lewandowski <k.lewandowsk@samsung.com>
Wed, 14 Sep 2022 21:41:47 +0000 (23:41 +0200)
Change-Id: I6205f6d3a23077db72becca3e0964573d38b9f7c

1  2 
configure.ac
libusb/descriptor.c
libusb/os/linux_usbfs.c
packaging/libusb.spec

diff --cc configure.ac
@@@ -107,18 -107,7 +107,18 @@@ case $backend i
  linux)
        AC_DEFINE(OS_LINUX, 1, [Linux backend])
        AC_SUBST(OS_LINUX)
-       AC_SEARCH_LIBS([clock_gettime2], [rt], [], [], [-pthread])
 +
 +      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_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])
@@@ -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;
Simple merge
index 652c92e,0000000..85e6d53
mode 100755,000000..100755
--- /dev/null
@@@ -1,70 -1,0 +1,70 @@@
- Version:        1.0.22
 +%define TIZEN_FEATURE_USBHOST_API on
 +
 +Name:           libusb
++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