[Pkg-bitcoin-commits] [cgminer] 01/01: FreeBSD's libusb-1.0 compatible library has a few differences compared to the normal libusb-1.0 from libusb.org which we have to work around.

Scott Sheridan Howard showard at moszumanska.debian.org
Mon Nov 25 15:07:38 UTC 2013


This is an automated email from the git hooks/post-receive script.

showard pushed a commit to branch master
in repository cgminer.

commit 6bc897bc5b4e6041a2ebefc4b47c5926850fd43a
Author: Scott Howard <showard314 at gmail.com>
Date:   Mon Nov 25 10:07:30 2013 -0500

    FreeBSD's libusb-1.0 compatible library has a few differences compared
    to the normal libusb-1.0 from libusb.org which we have to work around.
---
 debian/patches/kfreebsd_usb.patch  | 25 +++++++++++++++
 debian/patches/kfreebsd_usb.patch~ | 25 +++++++++++++++
 debian/patches/series              |  1 +
 debian/patches/system_libusb.patch | 62 --------------------------------------
 4 files changed, 51 insertions(+), 62 deletions(-)

diff --git a/debian/patches/kfreebsd_usb.patch b/debian/patches/kfreebsd_usb.patch
new file mode 100644
index 0000000..efcce2f
--- /dev/null
+++ b/debian/patches/kfreebsd_usb.patch
@@ -0,0 +1,25 @@
+Description: FreeBSD's libusb-1.0 compatible library has a few differences
+ compared to the "normal" libusb-1.0 from libusb.org which we have to
+ work around. LIBUSB_CLASS_APPLICATION doesn't exist in FreeBSD's libusb, and
+ libusb_handle_events_timeout_completed() doesn't exist either.
+ The latter is basically libusb_handle_events_timeout() with an extra
+ (unused by us) parameter, so the workaround is relatively simple.
+ See http://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff;h=6bf4273ee8bb6477ba55e0540e370547bd804641
+Author: Scott Howard <showard at debian.org>
+Index: cgminer/cgminer.c
+===================================================================
+--- cgminer.orig/cgminer.c	2013-11-24 18:18:34.145155627 -0500
++++ cgminer/cgminer.c	2013-11-25 10:04:06.366935961 -0500
+@@ -80,6 +80,12 @@
+ #	define USE_FPGA
+ #endif
+ 
++/* Portability fixes for FreeBSD. */
++#if defined(__FreeBSD_kernel__)
++#define libusb_handle_events_timeout_completed(ctx, tv, c) \
++       libusb_handle_events_timeout(ctx, tv)
++#endif
++
+ struct strategies strategies[] = {
+ 	{ "Failover" },
+ 	{ "Round Robin" },
diff --git a/debian/patches/kfreebsd_usb.patch~ b/debian/patches/kfreebsd_usb.patch~
new file mode 100644
index 0000000..efcce2f
--- /dev/null
+++ b/debian/patches/kfreebsd_usb.patch~
@@ -0,0 +1,25 @@
+Description: FreeBSD's libusb-1.0 compatible library has a few differences
+ compared to the "normal" libusb-1.0 from libusb.org which we have to
+ work around. LIBUSB_CLASS_APPLICATION doesn't exist in FreeBSD's libusb, and
+ libusb_handle_events_timeout_completed() doesn't exist either.
+ The latter is basically libusb_handle_events_timeout() with an extra
+ (unused by us) parameter, so the workaround is relatively simple.
+ See http://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff;h=6bf4273ee8bb6477ba55e0540e370547bd804641
+Author: Scott Howard <showard at debian.org>
+Index: cgminer/cgminer.c
+===================================================================
+--- cgminer.orig/cgminer.c	2013-11-24 18:18:34.145155627 -0500
++++ cgminer/cgminer.c	2013-11-25 10:04:06.366935961 -0500
+@@ -80,6 +80,12 @@
+ #	define USE_FPGA
+ #endif
+ 
++/* Portability fixes for FreeBSD. */
++#if defined(__FreeBSD_kernel__)
++#define libusb_handle_events_timeout_completed(ctx, tv, c) \
++       libusb_handle_events_timeout(ctx, tv)
++#endif
++
+ struct strategies strategies[] = {
+ 	{ "Failover" },
+ 	{ "Round Robin" },
diff --git a/debian/patches/series b/debian/patches/series
index 369865a..759d9fe 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 path_to_cl.patch
 system_jansson.patch
+kfreebsd_usb.patch
diff --git a/debian/patches/system_libusb.patch b/debian/patches/system_libusb.patch
deleted file mode 100644
index 50dbdc6..0000000
--- a/debian/patches/system_libusb.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-Description: use system jansson and usb libraries
-Author: Scott Howard <showard at debian.org>
-Index: cgminer-3.4.2/configure.ac
-===================================================================
---- cgminer-3.4.2.orig/configure.ac	2013-09-10 14:52:55.245878478 -0400
-+++ cgminer-3.4.2/configure.ac	2013-09-11 13:25:25.759923177 -0400
-@@ -320,10 +320,17 @@
- AM_CONDITIONAL([HAVE_WINDOWS], [test x$have_win32 = xtrue])
- AM_CONDITIONAL([HAVE_x86_64], [test x$have_x86_64 = xtrue])
- 
--AC_CONFIG_SUBDIRS([compat/libusb-1.0])
- if test "x$want_usbutils" != xfalse; then
--	AC_DEFINE([USE_USBUTILS], [1], [Defined to 1 if usbutils support required])
--	LIBUSB_LIBS="compat/libusb-1.0/libusb/.libs/libusb-1.0.a"
-+    AC_DEFINE([USE_USBUTILS], [1], [Defined to 1 if usbutils support required])  
-+    case $target in
-+        *-*-freebsd*)
-+          LIBUSB_LIBS="-lusb"
-+          AC_DEFINE(HAVE_LIBUSB, 1, [Define if you have libusb-1.0])
-+          ;;
-+        *)
-+          PKG_CHECK_MODULES(LIBUSB, libusb-1.0, [AC_DEFINE(HAVE_LIBUSB, 1, [Define if you have libusb-1.0])], [AC_MSG_ERROR([Could not find usb library - please install libusb-1.0])])
-+          ;;
-+      esac 
- 	if test "x$have_linux" = "xtrue"; then
- 		PKG_CHECK_MODULES([UDEV], [libudev], LIBUSB_LIBS+=" -ludev", [AC_MSG_ERROR([Missing required libudev dev])])
- 	fi
-@@ -331,7 +338,7 @@
- 	LIBUSB_LIBS=""
- fi
- 
--JANSSON_LIBS="compat/jansson/libjansson.a"
-+JANSSON_LIBS="-ljansson"
- 
- PKG_PROG_PKG_CONFIG()
- 
-Index: cgminer-3.4.2/Makefile.am
-===================================================================
---- cgminer-3.4.2.orig/Makefile.am	2013-09-10 14:52:55.245878478 -0400
-+++ cgminer-3.4.2/Makefile.am	2013-09-10 14:52:55.237878478 -0400
-@@ -1,10 +1,10 @@
- 
- ACLOCAL_AMFLAGS = -I m4
- 
--JANSSON_INCLUDES= -I$(top_srcdir)/compat/jansson
-+JANSSON_INCLUDES= -I/usr/include
- 
- if WANT_USBUTILS
--USBUTILS_INCLUDES = -I$(top_srcdir)/compat/libusb-1.0/libusb
-+USBUTILS_INCLUDES = -I/usr/include/libusb-1.0
- else
- USBUTILS_INCLUDES =
- endif
-@@ -16,7 +16,7 @@
- 		  bitforce-firmware-flash.c hexdump.c ASIC-README \
- 		  01-cgminer.rules GPU-README
- 
--SUBDIRS		= lib compat ccan
-+SUBDIRS		= lib ccan
- 
- INCLUDES	= $(PTHREAD_FLAGS) -fno-strict-aliasing $(JANSSON_INCLUDES) $(USBUTILS_INCLUDES)
- 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-bitcoin/cgminer.git



More information about the Pkg-bitcoin-commits mailing list