larskanis/libusb

Not available on FreeBSD

Closed this issue · 5 comments

sdalu commented

FreeBSD as a system version of libusb (/usr/lib/libusb.so):

The libusb library contains interfaces for directly managing a usb
device. The current implementation supports v1.0 of the libusb API.

The usability of a system libusb library is checked while gem install. However the file is expected to be named libusb-1.0.so. You could add a symlink like

ln -s /usr/lib/libusb.so /usr/lib/libusb-1.0.so

as a workaround. But why is the file named libusb.so on FreeBSD?

sdalu commented

The libusb library has been integrated to the FreeBSD core distribution, and I guess as they don't plan to support more than one version, that just the way it has been called

(Workaround is working)

The FreeBSD libusb shared object should be named libusb-1.0.so as well, according to this pkgconfig file. Am I wrong? I'm not familiar with FreeBSD.

I am wrong. The pkgconfig file is named libusb-1.0 but the shared object is loaded per -lusb instead of -lusb-1.0 as on linux. So libusb for ruby should either try to open libusb.so as another alternative or use pkgconfig to detect the shared object file.

sdalu commented

I'm not familiar with pkgconfig, but I see in the file you mention: Libs: -L${libdir} -lusb, which means for me that libusb.so must be used for linking