Package: gnuradio
Version: 3.7.1-2
Severity: grave
Tags: patch
Justification: FTBFS
User: [email protected]
Usertags: kfreebsd

Hi,

gnuradio FTBFS on kfreebsd-* because the available libusb (from FreeBSD)
doesn't provide these two functions:

> [ 67%] Building C object 
> gr-fcd/lib/CMakeFiles/gnuradio-fcd.dir/hid/hid-libusb.c.o
> cd /«PKGBUILDDIR»/build/gr-fcd/lib && /usr/bin/cc  -DENABLE_GR_LOG 
> -DGR_CTRLPORT -DHAVE_LOG4CPP -Dgnuradio_fcd_EXPORTS -g -O2 -fstack-protector 
> --param=ssp-buffer-size=4 -Wformat -Werror=format-security 
> -D_FORTIFY_SOURCE=2  -O2 -g -DNDEBUG -fPIC -I/«PKGBUILDDIR»/gr-fcd/lib/APPEND 
> -I/«PKGBUILDDIR»/gr-fcd/lib/hid -I/«PKGBUILDDIR»/gr-fcd/lib/fcd 
> -I/«PKGBUILDDIR»/gr-fcd/lib -I/«PKGBUILDDIR»/gr-fcd/include 
> -I/«PKGBUILDDIR»/gr-audio/include -I/«PKGBUILDDIR»/gr-blocks/lib 
> -I/«PKGBUILDDIR»/gr-blocks/include -I/«PKGBUILDDIR»/build/gr-blocks/lib 
> -I/«PKGBUILDDIR»/build/gr-blocks/include -I/«PKGBUILDDIR»/build 
> -I/«PKGBUILDDIR»/gnuradio-runtime/include 
> -I/«PKGBUILDDIR»/build/gnuradio-runtime/include    -fvisibility=hidden 
> -Wsign-compare -Wall -Wno-uninitialized -o 
> CMakeFiles/gnuradio-fcd.dir/hid/hid-libusb.c.o   -c 
> /«PKGBUILDDIR»/gr-fcd/lib/hid/hid-libusb.c
> /«PKGBUILDDIR»/gr-fcd/lib/hid/hid-libusb.c: In function 'get_first_language':
> /«PKGBUILDDIR»/gr-fcd/lib/hid/hid-libusb.c:283:2: warning: implicit 
> declaration of function 'libusb_get_string_descriptor' 
> [-Wimplicit-function-declaration]
>   len = libusb_get_string_descriptor(dev,
>   ^
> /«PKGBUILDDIR»/gr-fcd/lib/hid/hid-libusb.c: In function 'read_thread':
> /«PKGBUILDDIR»/gr-fcd/lib/hid/hid-libusb.c:760:3: warning: implicit 
> declaration of function 'libusb_handle_events_completed' 
> [-Wimplicit-function-declaration]
>    libusb_handle_events_completed(usb_context, &dev->cancelled);
>    ^

(those warnings probably ought to be fatal;  it fails later at link time
instead)

The attached patch (replacing the older, disabled patch bsd-fcd) will
use other functions when building on kfreebsd-*.  It fixes the build,
but I don't really know how to test its functionality beyond that.

Thanks!

-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: kfreebsd-amd64 (x86_64)

Kernel: kFreeBSD 9.0-2-amd64-xenhvm
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Index: gnuradio-3.7.1/gr-fcd/lib/hid/hid-libusb.c
===================================================================
--- gnuradio-3.7.1.orig/gr-fcd/lib/hid/hid-libusb.c	2013-11-11 00:21:07.000000000 +0000
+++ gnuradio-3.7.1/gr-fcd/lib/hid/hid-libusb.c	2013-11-11 00:21:44.069867393 +0000
@@ -250,7 +250,7 @@
 }
 #endif /* INVASIVE_GET_USAGE */
 
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 /* The FreeBSD version of libusb doesn't have this funciton. In mainline
    libusb, it's inlined in libusb.h. This function will bear a striking
    resemblence to that one, because there's about one way to code it.
@@ -757,7 +757,11 @@
 	libusb_cancel_transfer(dev->transfer);
 
 	while (!dev->cancelled)
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+		libusb_handle_events(usb_context);
+#else
 		libusb_handle_events_completed(usb_context, &dev->cancelled);
+#endif
 
 	/* Now that the read thread is stopping, Wake any threads which are
 	   waiting on data (in hid_read_timeout()). Do this under a mutex to

Reply via email to