mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-21 19:20:08 +02:00
libusb_compat: bump version (#5631)
This commit is contained in:
@@ -5,18 +5,17 @@ libusb-compat is a wrapper library for software that use the 0.1 API."
|
||||
HOMEPAGE="https://libusb.info/"
|
||||
COPYRIGHT="2008 Daniel Drake"
|
||||
LICENSE="GNU LGPL v2"
|
||||
REVISION="7"
|
||||
SOURCE_URI="ftp://sourceforge.mirrorservice.org/sites/downloads.sourceforge.net/l/li/libusb/libusb-compat-0.1/libusb-compat-0.1.5/libusb-compat-0.1.5.tar.bz2"
|
||||
CHECKSUM_SHA256="404ef4b6b324be79ac1bfb3d839eac860fbc929e6acb1ef88793a6ea328bc55a"
|
||||
SOURCE_DIR="libusb-compat-$portVersion"
|
||||
PATCHES="libusb_compat-0.1.5.patchset"
|
||||
REVISION="1"
|
||||
SOURCE_URI="https://github.com/libusb/libusb-compat-0.1/archive/v$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="d9ca58ec05ba5a29646a7549b9c2c02475a7ed86637337a4ee35b5d559de6e0d"
|
||||
SOURCE_DIR="libusb-compat-0.1-$portVersion"
|
||||
PATCHES="libusb_compat-$portVersion.patchset"
|
||||
|
||||
ARCHITECTURES="x86 x86_64 x86_gcc2"
|
||||
ARCHITECTURES="!x86_gcc2 x86_64"
|
||||
SECONDARY_ARCHITECTURES="x86"
|
||||
|
||||
PROVIDES="
|
||||
libusb_compat$secondaryArchSuffix = $portVersion
|
||||
cmd:libusb_config$secondaryArchSuffix = $portVersion
|
||||
lib:libusb$secondaryArchSuffix = $portVersion
|
||||
lib:libusb_0.1$secondaryArchSuffix = $portVersion
|
||||
"
|
||||
@@ -27,6 +26,7 @@ REQUIRES="
|
||||
|
||||
PROVIDES_devel="
|
||||
libusb_compat${secondaryArchSuffix}_devel = $portVersion
|
||||
cmd:libusb_config$secondaryArchSuffix = $portVersion
|
||||
devel:libusb$secondaryArchSuffix = $portVersion
|
||||
devel:libusb_0.1${secondaryArchSuffix} = $portVersion
|
||||
"
|
||||
@@ -40,11 +40,11 @@ BUILD_REQUIRES="
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
cmd:aclocal
|
||||
cmd:autoconf
|
||||
cmd:autoreconf
|
||||
cmd:automake
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
cmd:ld$secondaryArchSuffix
|
||||
cmd:libtool
|
||||
cmd:libtool$secondaryArchSuffix
|
||||
cmd:make
|
||||
cmd:pkg_config$secondaryArchSuffix
|
||||
cmd:sed
|
||||
@@ -52,10 +52,8 @@ BUILD_PREREQUIRES="
|
||||
|
||||
BUILD()
|
||||
{
|
||||
aclocal
|
||||
automake
|
||||
#sh bootstrap.sh
|
||||
runConfigure ./configure
|
||||
autoreconf -vfi
|
||||
runConfigure ./configure --enable-static=no
|
||||
make $jobArgs
|
||||
}
|
||||
|
||||
@@ -67,9 +65,15 @@ INSTALL()
|
||||
|
||||
# set up the develop directory correctly
|
||||
prepareInstalledDevelLibs libusb-0.1 libusb
|
||||
fixPkgconfig libusb-0.1
|
||||
fixPkgconfig
|
||||
|
||||
# devel package
|
||||
packageEntries devel \
|
||||
$developDir
|
||||
$developDir \
|
||||
$binDir
|
||||
}
|
||||
|
||||
TEST()
|
||||
{
|
||||
make check
|
||||
}
|
||||
@@ -1,98 +1,14 @@
|
||||
From ef2cc8b06a71405324cd2d497815f88cff4a0c63 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= <revol@free.fr>
|
||||
Date: Fri, 7 Nov 2014 23:21:52 +0100
|
||||
Subject: [PATCH 1/4] Drop unsupported gcc2 flags
|
||||
|
||||
---
|
||||
configure.ac | 2 +-
|
||||
libusb/Makefile.am | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index debfef2..397098d 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -56,7 +56,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], inline_cflags="-fgnu89-inline", inline_
|
||||
CFLAGS="$saved_cflags"
|
||||
|
||||
AC_DEFINE([API_EXPORTED], [__attribute__((visibility("default")))], [Default visibility])
|
||||
-AM_CFLAGS="-std=gnu99 $inline_cflags -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow"
|
||||
+AM_CFLAGS="-std=gnu89 $inline_cflags -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wshadow"
|
||||
AC_SUBST(AM_CFLAGS)
|
||||
|
||||
AC_CONFIG_FILES([libusb.pc] [libusb-config] [Makefile] [libusb/Makefile] [examples/Makefile])
|
||||
diff --git a/libusb/Makefile.am b/libusb/Makefile.am
|
||||
index 33a609a..b72849e 100644
|
||||
--- a/libusb/Makefile.am
|
||||
+++ b/libusb/Makefile.am
|
||||
@@ -2,7 +2,7 @@ include_HEADERS = usb.h
|
||||
lib_LTLIBRARIES = libusb.la
|
||||
|
||||
libusb_la_SOURCES = core.c usbi.h
|
||||
-libusb_la_CFLAGS = -fvisibility=hidden $(AM_CFLAGS) $(LIBUSB_1_0_CFLAGS)
|
||||
+libusb_la_CFLAGS = $(AM_CFLAGS) $(LIBUSB_1_0_CFLAGS)
|
||||
libusb_la_LIBADD = $(LIBUSB_1_0_LIBS)
|
||||
libusb_la_LDFLAGS = -version-info $(LT_MAJOR):$(LT_REVISION):$(LT_AGE) \
|
||||
-release 0.1
|
||||
--
|
||||
1.8.3.4
|
||||
|
||||
|
||||
From 225917ef9cac34dee263448081cd7db00a9fa45a Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= <revol@free.fr>
|
||||
Date: Sat, 8 Nov 2014 01:10:41 +0100
|
||||
Subject: [PATCH 2/4] C89
|
||||
|
||||
gcc2 requires C89
|
||||
---
|
||||
libusb/core.c | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/libusb/core.c b/libusb/core.c
|
||||
index c0ccb1f..63567c5 100644
|
||||
--- a/libusb/core.c
|
||||
+++ b/libusb/core.c
|
||||
@@ -210,8 +210,8 @@ static int find_busses(struct usb_bus **ret)
|
||||
|
||||
/* if we already know about it, continue */
|
||||
if (busses) {
|
||||
- bus = busses;
|
||||
int found = 0;
|
||||
+ bus = busses;
|
||||
do {
|
||||
if (bus_num == bus->location) {
|
||||
found = 1;
|
||||
@@ -661,9 +661,10 @@ API_EXPORTED struct usb_bus *usb_get_busses(void)
|
||||
API_EXPORTED usb_dev_handle *usb_open(struct usb_device *dev)
|
||||
{
|
||||
int r;
|
||||
+ usb_dev_handle *udev;
|
||||
usbi_dbg("");
|
||||
|
||||
- usb_dev_handle *udev = malloc(sizeof(*udev));
|
||||
+ udev = malloc(sizeof(*udev));
|
||||
if (!udev)
|
||||
return NULL;
|
||||
|
||||
--
|
||||
1.8.3.4
|
||||
|
||||
|
||||
From 5afdd1723f5d7cfae10c48a5ede37a42cacad733 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= <revol@free.fr>
|
||||
From 8dabf0752e23efc3a6723274a7262e318c041cd9 Mon Sep 17 00:00:00 2001
|
||||
From: Francois Revol <revol@free.fr>
|
||||
Date: Mon, 11 Aug 2014 19:20:13 +0200
|
||||
Subject: [PATCH 3/4] Work around ugly return -EFOO constructs
|
||||
Subject: Work around ugly return -EFOO constructs
|
||||
|
||||
Apps will also need to be fixed...
|
||||
---
|
||||
libusb/core.c | 39 ++++++++++++++++++++++-----------------
|
||||
1 file changed, 22 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/libusb/core.c b/libusb/core.c
|
||||
index 63567c5..c6fa4bb 100644
|
||||
index 3bc9c25..b709d98 100644
|
||||
--- a/libusb/core.c
|
||||
+++ b/libusb/core.c
|
||||
@@ -58,7 +58,12 @@ enum usbi_log_level {
|
||||
@@ -72,7 +72,12 @@ enum usbi_log_level {
|
||||
|
||||
API_EXPORTED struct usb_bus *usb_busses = NULL;
|
||||
|
||||
@@ -104,9 +20,19 @@ index 63567c5..c6fa4bb 100644
|
||||
+#endif
|
||||
+#define compat_err(e) (ret_err(errno=libusb_to_errno(e)))
|
||||
|
||||
static int libusb_to_errno(int result)
|
||||
{
|
||||
@@ -244,7 +249,7 @@ err:
|
||||
#ifdef LIBUSB_1_0_SONAME
|
||||
static void __attribute__ ((constructor)) _usb_init (void)
|
||||
@@ -233,8 +238,8 @@ static int find_busses(struct usb_bus **ret)
|
||||
|
||||
/* if we already know about it, continue */
|
||||
if (busses) {
|
||||
- bus = busses;
|
||||
int found = 0;
|
||||
+ bus = busses;
|
||||
do {
|
||||
if (bus_num == bus->location) {
|
||||
found = 1;
|
||||
@@ -267,7 +272,7 @@ err:
|
||||
free(bus);
|
||||
bus = tbus;
|
||||
}
|
||||
@@ -115,7 +41,7 @@ index 63567c5..c6fa4bb 100644
|
||||
}
|
||||
|
||||
API_EXPORTED int usb_find_busses(void)
|
||||
@@ -352,7 +357,7 @@ err:
|
||||
@@ -375,7 +380,7 @@ err:
|
||||
free(dev);
|
||||
dev = tdev;
|
||||
}
|
||||
@@ -124,7 +50,7 @@ index 63567c5..c6fa4bb 100644
|
||||
}
|
||||
|
||||
static void clear_endpoint_descriptor(struct usb_endpoint_descriptor *ep)
|
||||
@@ -411,7 +416,7 @@ static int copy_endpoint_descriptor(struct usb_endpoint_descriptor *dest,
|
||||
@@ -434,7 +439,7 @@ static int copy_endpoint_descriptor(struct usb_endpoint_descriptor *dest,
|
||||
if (src->extra_length) {
|
||||
dest->extra = malloc(src->extra_length);
|
||||
if (!dest->extra)
|
||||
@@ -133,7 +59,7 @@ index 63567c5..c6fa4bb 100644
|
||||
memcpy(dest->extra, src->extra, src->extra_length);
|
||||
}
|
||||
|
||||
@@ -428,7 +433,7 @@ static int copy_interface_descriptor(struct usb_interface_descriptor *dest,
|
||||
@@ -451,7 +456,7 @@ static int copy_interface_descriptor(struct usb_interface_descriptor *dest,
|
||||
memcpy(dest, src, USB_DT_INTERFACE_SIZE);
|
||||
dest->endpoint = malloc(alloc_size);
|
||||
if (!dest->endpoint)
|
||||
@@ -142,7 +68,7 @@ index 63567c5..c6fa4bb 100644
|
||||
memset(dest->endpoint, 0, alloc_size);
|
||||
|
||||
for (i = 0; i < num_endpoints; i++) {
|
||||
@@ -444,7 +449,7 @@ static int copy_interface_descriptor(struct usb_interface_descriptor *dest,
|
||||
@@ -467,7 +472,7 @@ static int copy_interface_descriptor(struct usb_interface_descriptor *dest,
|
||||
dest->extra = malloc(src->extra_length);
|
||||
if (!dest->extra) {
|
||||
clear_interface_descriptor(dest);
|
||||
@@ -151,7 +77,7 @@ index 63567c5..c6fa4bb 100644
|
||||
}
|
||||
memcpy(dest->extra, src->extra, src->extra_length);
|
||||
}
|
||||
@@ -463,7 +468,7 @@ static int copy_interface(struct usb_interface *dest,
|
||||
@@ -486,7 +491,7 @@ static int copy_interface(struct usb_interface *dest,
|
||||
dest->num_altsetting = num_altsetting;
|
||||
dest->altsetting = malloc(alloc_size);
|
||||
if (!dest->altsetting)
|
||||
@@ -160,7 +86,7 @@ index 63567c5..c6fa4bb 100644
|
||||
memset(dest->altsetting, 0, alloc_size);
|
||||
|
||||
for (i = 0; i < num_altsetting; i++) {
|
||||
@@ -488,7 +493,7 @@ static int copy_config_descriptor(struct usb_config_descriptor *dest,
|
||||
@@ -511,7 +516,7 @@ static int copy_config_descriptor(struct usb_config_descriptor *dest,
|
||||
memcpy(dest, src, USB_DT_CONFIG_SIZE);
|
||||
dest->interface = malloc(alloc_size);
|
||||
if (!dest->interface)
|
||||
@@ -169,7 +95,7 @@ index 63567c5..c6fa4bb 100644
|
||||
memset(dest->interface, 0, alloc_size);
|
||||
|
||||
for (i = 0; i < num_interfaces; i++) {
|
||||
@@ -504,7 +509,7 @@ static int copy_config_descriptor(struct usb_config_descriptor *dest,
|
||||
@@ -527,7 +532,7 @@ static int copy_config_descriptor(struct usb_config_descriptor *dest,
|
||||
dest->extra = malloc(src->extra_length);
|
||||
if (!dest->extra) {
|
||||
clear_config_descriptor(dest);
|
||||
@@ -178,7 +104,7 @@ index 63567c5..c6fa4bb 100644
|
||||
}
|
||||
memcpy(dest->extra, src->extra, src->extra_length);
|
||||
}
|
||||
@@ -532,7 +537,7 @@ static int initialize_device(struct usb_device *dev)
|
||||
@@ -555,7 +560,7 @@ static int initialize_device(struct usb_device *dev)
|
||||
alloc_size = sizeof(struct usb_config_descriptor) * num_configurations;
|
||||
dev->config = malloc(alloc_size);
|
||||
if (!dev->config)
|
||||
@@ -187,7 +113,19 @@ index 63567c5..c6fa4bb 100644
|
||||
memset(dev->config, 0, alloc_size);
|
||||
|
||||
/* even though structures are identical, we can't just use libusb-1.0's
|
||||
@@ -734,7 +739,7 @@ API_EXPORTED int usb_set_altinterface(usb_dev_handle *dev, int alternate)
|
||||
@@ -684,9 +689,10 @@ API_EXPORTED struct usb_bus *usb_get_busses(void)
|
||||
API_EXPORTED usb_dev_handle *usb_open(struct usb_device *dev)
|
||||
{
|
||||
int r;
|
||||
+ usb_dev_handle *udev;
|
||||
usbi_dbg("");
|
||||
|
||||
- usb_dev_handle *udev = malloc(sizeof(*udev));
|
||||
+ udev = malloc(sizeof(*udev));
|
||||
if (!udev)
|
||||
return NULL;
|
||||
|
||||
@@ -756,7 +762,7 @@ API_EXPORTED int usb_set_altinterface(usb_dev_handle *dev, int alternate)
|
||||
{
|
||||
usbi_dbg("alternate %d", alternate);
|
||||
if (dev->last_claimed_interface < 0)
|
||||
@@ -196,7 +134,7 @@ index 63567c5..c6fa4bb 100644
|
||||
|
||||
return compat_err(libusb_set_interface_alt_setting(dev->handle,
|
||||
dev->last_claimed_interface, alternate));
|
||||
@@ -919,7 +924,7 @@ API_EXPORTED int usb_get_driver_np(usb_dev_handle *dev, int interface,
|
||||
@@ -941,7 +947,7 @@ API_EXPORTED int usb_get_driver_np(usb_dev_handle *dev, int interface,
|
||||
snprintf(name, namelen, "dummy");
|
||||
return 0;
|
||||
} else if (r == 0) {
|
||||
@@ -205,7 +143,7 @@ index 63567c5..c6fa4bb 100644
|
||||
} else {
|
||||
return compat_err(r);
|
||||
}
|
||||
@@ -932,17 +937,17 @@ API_EXPORTED int usb_detach_kernel_driver_np(usb_dev_handle *dev, int interface)
|
||||
@@ -954,17 +960,17 @@ API_EXPORTED int usb_detach_kernel_driver_np(usb_dev_handle *dev, int interface)
|
||||
case LIBUSB_SUCCESS:
|
||||
return 0;
|
||||
case LIBUSB_ERROR_NOT_FOUND:
|
||||
@@ -229,24 +167,21 @@ index 63567c5..c6fa4bb 100644
|
||||
}
|
||||
|
||||
--
|
||||
1.8.3.4
|
||||
2.30.0
|
||||
|
||||
|
||||
From a625234d9147126e19757fa40a65d97df5f2099d Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= <revol@free.fr>
|
||||
From 12f2c6869b129ea00f84addc4c96f0593f5155ec Mon Sep 17 00:00:00 2001
|
||||
From: Francois Revol <revol@free.fr>
|
||||
Date: Sun, 9 Nov 2014 01:51:32 +0100
|
||||
Subject: [PATCH 4/4] Add stdint.h so we get u_int*_t
|
||||
Subject: Add stdint.h so we get u_int*_t
|
||||
|
||||
---
|
||||
libusb/usb.h | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/libusb/usb.h b/libusb/usb.h
|
||||
index 84e730f..a02049b 100644
|
||||
index fa0e6c6..9774902 100644
|
||||
--- a/libusb/usb.h
|
||||
+++ b/libusb/usb.h
|
||||
@@ -26,6 +26,7 @@
|
||||
#define __USB_H__
|
||||
@@ -27,6 +27,7 @@
|
||||
#define USB_H
|
||||
|
||||
#include <unistd.h>
|
||||
+#include <stdint.h>
|
||||
@@ -254,5 +189,5 @@ index 84e730f..a02049b 100644
|
||||
#include <limits.h>
|
||||
|
||||
--
|
||||
1.8.3.4
|
||||
2.30.0
|
||||
|
||||
Reference in New Issue
Block a user