graphics/sane-backends on 8.0 + USB

Daniel O'Connor darius at
Fri Feb 5 06:35:54 UTC 2010

I have spent a while getting sane to work with my USB scanner.. 

I found that I needed to tell it to use the 1.0 API otherwise it would 
cause a crash in libusb (not sure whos fault it is).

To do this I made a port which installs the requisite pkg_config files 
so that the base libusb can be seen by SANE without an issue.

Here is the diff to SANE so it uses the 1.0 API..

diff -ur /usr/ports/graphics/sane-backends/Makefile 
--- /usr/ports/graphics/sane-backends/Makefile  2009-09-11 
23:45:26.000000000 +0930
+++ sane-backends/Makefile      2010-02-05 16:52:31.028901308 +1030
@@ -51,6 +51,8 @@
 .if ${OSVERSION} < 800069
 LIB_DEPENDS+=          usb-0.1.8:${PORTSDIR}/devel/libusb
+CONFIGURE_ARGS+=       --enable-libusb_1_0

The libusb port is at

Note that (obviously) the SANE port needs to depend on libusb_base, 
however I don't know the best way to do that in terms of backward 
compatibility. ie wether libusb_base should be merged with libusb or 
ports are modified so that they select which one.

The former seems more elegant to me but I don't know how to merge 
them :)

Daniel O'Connor software and network engineer
for Genesis Software -
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: This is a digitally signed message part.
Url :

More information about the freebsd-ports mailing list