23119779 Upgrade libopenusb to 1.1.11
authorEsha Wang <esha.wang@oracle.com>
Tue, 06 Dec 2016 09:37:42 -0800
changeset 7440 41dd20eda9f0
parent 7439 8fc7a20cd091
child 7441 043570f550ea
23119779 Upgrade libopenusb to 1.1.11
components/openusb/Makefile
components/openusb/openusb.p5m
components/openusb/patches/Makefile.in.patch
components/openusb/patches/emulation.c.patch
components/openusb/patches/testopenusb.patch
--- a/components/openusb/Makefile	Mon Dec 05 14:36:48 2016 -0800
+++ b/components/openusb/Makefile	Tue Dec 06 09:37:42 2016 -0800
@@ -27,17 +27,16 @@
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		openusb
-COMPONENT_VERSION=	1.0.1
+COMPONENT_VERSION=	1.1.11
 COMPONENT_SRC_NAME=	libopenusb
 COMPONENT_PROJECT_URL=	http://openusb.sourceforge.net/
 COMPONENT_ARCHIVE_HASH=	\
-    sha256:031098c376f16f6030c4dbd553266e107b39d1f7b3fc366f8f7fd412d3d7c3ad
-COMPONENT_ARCHIVE_URL=	http://sourceforge.net/projects/openusb/files/$(COMPONENT_NAME)/libopenusb%201.0.1/$(COMPONENT_ARCHIVE)/download
+    sha256:434242e758155aba6e4ddd28460dc9a2565c44bb8861a35ceaf7a6bbcae4aa1e
+COMPONENT_ARCHIVE_URL= https://sourceforge.net/projects/openusb/files/libopenusb/libopenusb-$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)/download	
 COMPONENT_BUGDB=	library/libopenusb
 
-TPNO=			8843
+TPNO=			32726
 
-TEST_TARGET= $(NO_TESTS)
 include $(WS_MAKE_RULES)/common.mk
 
 # keep traditional GNU semantics for inline functions so we don't lose
--- a/components/openusb/openusb.p5m	Mon Dec 05 14:36:48 2016 -0800
+++ b/components/openusb/openusb.p5m	Tue Dec 06 09:37:42 2016 -0800
@@ -18,7 +18,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 #
 
 <transform file path=usr.*/man/.+ -> default mangler.man.stability volatile>
@@ -39,13 +39,13 @@
 
 
 file path=usr/include/openusb.h
-link path=usr/lib/$(MACH64)/libopenusb.so target=libopenusb.so.0.0.1
-link path=usr/lib/$(MACH64)/libopenusb.so.0 target=libopenusb.so.0.0.1
-file path=usr/lib/$(MACH64)/libopenusb.so.0.0.1
+link path=usr/lib/$(MACH64)/libopenusb.so target=libopenusb.so.0.0.11
+link path=usr/lib/$(MACH64)/libopenusb.so.0 target=libopenusb.so.0.0.11
+file path=usr/lib/$(MACH64)/libopenusb.so.0.0.11
 file path=usr/lib/$(MACH64)/openusb_backend/sunos.so
-link path=usr/lib/libopenusb.so target=libopenusb.so.0.0.1
-link path=usr/lib/libopenusb.so.0 target=libopenusb.so.0.0.1
-file path=usr/lib/libopenusb.so.0.0.1
+link path=usr/lib/libopenusb.so target=libopenusb.so.0.0.11
+link path=usr/lib/libopenusb.so.0 target=libopenusb.so.0.0.11
+file path=usr/lib/libopenusb.so.0.0.11
 file path=usr/lib/openusb_backend/sunos.so
 file doc/html/openusb_guide.html path=usr/share/doc/openusb/openusb_guide.html
 file files/libopenusb.3lib path=usr/share/man/man3lib/libopenusb.3lib
--- a/components/openusb/patches/Makefile.in.patch	Mon Dec 05 14:36:48 2016 -0800
+++ b/components/openusb/patches/Makefile.in.patch	Tue Dec 06 09:37:42 2016 -0800
@@ -1,12 +1,15 @@
---- libopenusb-1.0.1/src/Makefile.in	Thu Feb 21 17:54:43 2008
-+++ Makefile.in	Thu Feb 21 17:59:12 2008
-@@ -374,6 +374,9 @@
- 	  else :; fi; \
- 	done
+Creates target install-sunos-backend for component to build successfully.
+Patch will potentially be submitted upstream.
+
+--- libopenusb-1.1.11/src/Makefile.in_orig	2016-11-15 10:56:29.737793492 +0000
++++ libopenusb-1.1.11/src/Makefile.in	2016-11-15 10:58:21.991252260 +0000
+@@ -428,6 +428,9 @@
+ 	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(usblibdir)"; \
+ 	}
  
 +install-sunos-backend: $(usblib_LTLIBRARIES)
 +	$(CC) $(CFLAGS) -shared -Wl,-h -Wl,sunos.so -o .libs/sunos.so  .libs/sunos_la-sunos.o  -R$(libdir) -L.libs $(sunos_la_LIBADD)
 +
  uninstall-usblibLTLIBRARIES:
  	@$(NORMAL_UNINSTALL)
- 	@list='$(usblib_LTLIBRARIES)'; for p in $$list; do \
+ 	@list='$(usblib_LTLIBRARIES)'; test -n "$(usblibdir)" || list=; \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/openusb/patches/emulation.c.patch	Tue Dec 06 09:37:42 2016 -0800
@@ -0,0 +1,25 @@
+struct and USBCONSTISSUE cause usb_bulk_write and usb_interrupt_write in
+libopenusb-1.1.11/src/emulation.c to mismatch the usb_bulk_write and usb_interrupt_write
+declarations in /usr/include/usb.h. struct and USBCONSTISSUE have thus been removed 
+to resolve this issue. This patch is not planned to be submitted upstream.
+
+--- libopenusb-1.1.11/src/emulation.c_orig	2016-11-10 13:29:36.583852896 +0000
++++ libopenusb-1.1.11/src/emulation.c	2016-11-10 13:30:33.154618185 +0000
+@@ -635,7 +635,7 @@
+ 	return(bulk.result.transferred_bytes);
+ }
+ 
+-int usb_bulk_write(struct usb_dev_handle *dev, int ep, USBCONSTISSUE char *bytes, int size,
++int usb_bulk_write(usb_dev_handle *dev, int ep, char *bytes, int size,
+ 	int timeout)
+ {
+ 	return (usb0_bulk_xfer(dev, ep, (char*)bytes, size, timeout));
+@@ -678,7 +678,7 @@
+ 	return(intr.result.transferred_bytes);
+ }
+ 
+-int usb_interrupt_write(usb_dev_handle *dev, int ep, USBCONSTISSUE char *bytes, int size,
++int usb_interrupt_write(usb_dev_handle *dev, int ep, char *bytes, int size,
+ 	int timeout)
+ {
+ 	return (usb0_intr_xfer(dev, ep, (char*)bytes, size, timeout));
--- a/components/openusb/patches/testopenusb.patch	Mon Dec 05 14:36:48 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,226 +0,0 @@
-Index: libopenusb-1.0.1/tests/testopenusb.c
-===================================================================
---- libopenusb-1.0.1/tests/testopenusb.c	(revision 122)
-+++ libopenusb-1.0.1/tests/testopenusb.c	(working copy)
-@@ -183,7 +183,7 @@
- 		break;
- 	}
- 	printf("CALLBACK: lib(%llu) device(%llu) get a event(%s) with arg=%p\n",
--		handle, devid, evstring, arg);
-+		(unsigned long long)handle, (unsigned long long)devid, evstring, arg);
- }
- 
- int convert_string(char *buf, usb_string_desc_t *st, int buflen)
-@@ -350,14 +350,16 @@
- 
- 	ret = openusb_claim_interface(devh,0,0);
- 	if (ret != 0) {
--		printf("Device(%llu) claim interface error:%s\n",devids[0],
-+		printf("Device(%llu) claim interface error:%s\n",
-+				(unsigned long long)devids[0],
- 				openusb_strerror(ret));
- 		return -1;
- 	}
- 
- 	ret = openusb_set_altsetting(devh,0,0);
- 	if (ret != 0) {
--		printf("Device(%llu) interface(0) set alt:%s\n",devids[0],
-+		printf("Device(%llu) interface(0) set alt:%s\n",
-+				(unsigned long long)devids[0],
- 				openusb_strerror(ret));
- 		return -1;
- 	}
-@@ -424,14 +426,16 @@
- 
- 	ret = openusb_claim_interface(devh,0,0);
- 	if (ret != 0) {
--		printf("Device(%llu) claim interface error:%s\n",devids[0],
-+		printf("Device(%llu) claim interface error:%s\n",
-+				(unsigned long long)devids[0],
- 				openusb_strerror(ret));
- 		return -1;
- 	}
- 
- 	ret = openusb_set_altsetting(devh,0,0);
- 	if (ret != 0) {
--		printf("Device(%llu) interface(0) set alt:%s\n",devids[0],
-+		printf("Device(%llu) interface(0) set alt:%s\n",
-+				(unsigned long long)devids[0],
- 				openusb_strerror(ret));
- 		return -1;
- 	}
-@@ -498,14 +502,16 @@
- 
- 	ret = openusb_claim_interface(devh,0,0);
- 	if (ret != 0) {
--		printf("Device(%llu) claim interface error:%s\n",devids[0],
-+		printf("Device(%llu) claim interface error:%s\n",
-+				(unsigned long long)devids[0],
- 				openusb_strerror(ret));
- 		return -1;
- 	}
- 
- 	ret = openusb_set_altsetting(devh,0,3);/* alt 3, depends on the fw */
- 	if (ret != 0) {
--		printf("Device(%llu) interface(0) set alt:%s\n",devids[0],
-+		printf("Device(%llu) interface(0) set alt:%s\n",
-+				(unsigned long long)devids[0],
- 				openusb_strerror(ret));
- 		return -1;
- 	}
-@@ -593,14 +599,16 @@
- 
- 	ret = openusb_claim_interface(devh,0,0);
- 	if (ret != 0) {
--		printf("Device(%llu) claim interface error:%s\n",devids[0],
-+		printf("Device(%llu) claim interface error:%s\n",
-+				(unsigned long long)devids[0],
- 				openusb_strerror(ret));
- 		return -1;
- 	}
- 
- 	ret = openusb_set_altsetting(devh,0,0);
- 	if (ret != 0) {
--		printf("Device(%llu) interface(0) set alt:%s\n",devids[0],
-+		printf("Device(%llu) interface(0) set alt:%s\n",
-+				(unsigned long long)devids[0],
- 				openusb_strerror(ret));
- 		return -1;
- 	}
-@@ -735,7 +743,8 @@
- 
- 	ret = openusb_claim_interface(devh,0,0);
- 	if (ret != 0) {
--		printf("Device(%llu) claim interface error:%s\n", devids[0],
-+		printf("Device(%llu) claim interface error:%s\n",
-+				(unsigned long long)devids[0],
- 				openusb_strerror(ret));
- 		return -1;
- 	}
-@@ -747,7 +756,8 @@
- 	}
- 
- 	if (ret != 0) {
--		printf("Device(%llu) interface(0) set alt:%s\n", devids[0],
-+		printf("Device(%llu) interface(0) set alt:%s\n",
-+			       (unsigned long long)devids[0],
- 				openusb_strerror(ret));
- 		return -1;
- 	}
-@@ -1027,14 +1037,16 @@
- 
- 	ret = openusb_claim_interface(devh,0,0);
- 	if (ret != 0) {
--		printf("Device(%llu) claim interface error:%s\n", devids[0],
-+		printf("Device(%llu) claim interface error:%s\n",
-+				(unsigned long long)devids[0],
- 				openusb_strerror(ret));
- 		return -1;
- 	}
- 
- 	ret = openusb_set_altsetting(devh,0,0);
- 	if (ret != 0) {
--		printf("Device(%llu) interface(0) set alt:%s\n", devids[0],
-+		printf("Device(%llu) interface(0) set alt:%s\n",
-+				(unsigned long long)devids[0],
- 				openusb_strerror(ret));
- 		return -1;
- 	}
-@@ -1195,7 +1207,8 @@
- 				openusb_strerror(ret));
- 		goto err;
- 	}
--	printf("Device(%llu) opened: %llu\n",devids[0],devh);
-+	printf("Device(%llu) opened: %llu\n", (unsigned long long)devids[0],
-+			(unsigned long long)devh);
- 
- 	ret = openusb_get_devid(devh, &devid);
- 	if(ret < 0) {
-@@ -1206,11 +1219,12 @@
- 
- 	ret = openusb_get_lib_handle(devh,&libh);
- 	if (ret != 0) {
--		printf("Get device(%llu) lib handle error:%s\n",devids[0],
-+		printf("Get device(%llu) lib handle error:%s\n",
-+				(unsigned long long)devids[0],
- 				openusb_strerror(ret));
- 		goto err;
- 	}
--	printf("Lib handle = %llu\n",libh);
-+	printf("Lib handle = %llu\n", (unsigned long long)libh);
- 
- #if 1  /* multi xfer test */
- 	ret = multi_xfer_test(devh);
-@@ -1241,14 +1255,16 @@
- #if 1	/* configuration test */
- 	ret = openusb_set_configuration(devh,1);
- 	if (ret != 0) {
--		printf("Set device(%llu) config error:%s\n",devids[0],
-+		printf("Set device(%llu) config error:%s\n",
-+				(unsigned long long)devids[0],
- 				openusb_strerror(ret));
- 		goto err;
- 	}
- 
- 	ret = openusb_get_configuration(devh,&cfg);
- 	if (ret != 0) {
--		printf("Get device(%llu) config error:%s\n",devids[0],
-+		printf("Get device(%llu) config error:%s\n",
-+				(unsigned long long)devids[0],
- 				openusb_strerror(ret));
- 		goto err;
- 	}
-@@ -1259,18 +1275,21 @@
- #if 1	/* claim interface test */
- 	ret = openusb_claim_interface(devh,0,0);
- 	if (ret != 0) {
--		printf("Device(%llu) claim interface error:%s\n",devids[0],
-+		printf("Device(%llu) claim interface error:%s\n",
-+				(unsigned long long)devids[0],
- 				openusb_strerror(ret));
- 		goto err;
- 	}
- 
- 	ret = openusb_is_interface_claimed(devh,0);
--	printf("Device(%llu) interface(0) claimed return %d\n", devids[0],
-+	printf("Device(%llu) interface(0) claimed return %d\n",
-+			(unsigned long long)devids[0],
- 			ret);
- 
- 	ret = openusb_set_altsetting(devh,0,0);
- 	if (ret != 0) {
--		printf("Device(%llu) interface(0) set alt:%s\n",devids[0],
-+		printf("Device(%llu) interface(0) set alt:%s\n",
-+				(unsigned long long)devids[0],
- 				openusb_strerror(ret));
- 		goto err;
- 	}
-@@ -1278,7 +1297,8 @@
- 
- 	ret = openusb_get_altsetting(devh,0,&alt);
- 	if (ret != 0) {
--		printf("Device(%llu) interface(0) get alt:%s\n",devids[0],
-+		printf("Device(%llu) interface(0) get alt:%s\n",
-+				(unsigned long long)devids[0],
- 				openusb_strerror(ret));
- 		goto err;
- 	}
-@@ -1286,7 +1306,8 @@
- 
- 	ret = openusb_release_interface(devh,0);
- 	if (ret != 0) {
--		printf("Device(%llu) release interface error:%s\n",devids[0],
-+		printf("Device(%llu) release interface error:%s\n",
-+				(unsigned long long)devids[0],
- 				openusb_strerror(ret));
- 		goto err;
- 	}
-@@ -1396,7 +1417,7 @@
- 		printf("error init\n");
- 		exit(1);
- 	}
--	printf("lib handle=%llu \n",libhandle);
-+	printf("lib handle=%llu \n", (unsigned long long)libhandle);
- 	printf("openusb_init PASS\n");
- 
- 	ret = openusb_set_event_callback(libhandle, USB_ATTACH, event_cb, NULL);