Bug 24703 - New port of 'libusb' to commit to the 'devel' category
Summary: New port of 'libusb' to commit to the 'devel' category
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-01-28 20:50 UTC by John Reynolds
Modified: 2001-02-26 21:48 UTC (History)
0 users

See Also:


Attachments
file.shar (1.97 KB, text/plain)
2001-01-28 20:50 UTC, John Reynolds
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Reynolds 2001-01-28 20:50:02 UTC
Attached is a shar(1) archive of a new port! This is a port of libusb from the
Linux world. Thanks goes to Richard Tobin <richard@cogsci.ed.ac.uk> for doing
the "meat" of the port. This is version 0.1.3b of libusb. I've not tested any
other apps except for S10sh (http://www.kyuzz.org/antirez/s10sh.html) but
Richard said he's gotten gPhoto[2] to work and I have reports from others of
this as well. If you know the protocol of a device, you "should" be able to get
at it with this libary from userland ...

How-To-Repeat: 
  N/A
Comment 1 Will Andrews 2001-01-28 20:55:14 UTC
On Sun, Jan 28, 2001 at 01:42:02PM -0700, jjreynold@home.com wrote:
> >Synopsis:       New port of 'libusb' to commit to the 'devel' category


Erm, I thought our libusb was compatible with Linux's.

-- 
wca
Comment 2 John Reynolds 2001-01-28 21:27:10 UTC
[ On Sunday, January 28, Will Andrews wrote: ]
> On Sun, Jan 28, 2001 at 01:42:02PM -0700, jjreynold@home.com wrote:
> > >Synopsis:       New port of 'libusb' to commit to the 'devel' category
> 
> Erm, I thought our libusb was compatible with Linux's.
> 

Not that I'm aware of, though I don't pretend to know the intricacies of it
all. From what I can gather, our own "libusb" which resides in /usr/lib might
provide all that's necessary to talk to USB devices. I have never
tried. However, programs originally written under Linux that were hacked
together when their USB kernel was coming along, started using "their"
libusb. It is a specific "userland" API that the programs have been written
to. My favorite of these is S10sh (http://www.kyuzz.org/antirez/s10sh.html). 
When I originally compiled this program I tried to link it against "our" libusb
to no avail. Only recently after the efforts of Richard Tobin, do things now
"work" since S10sh, gphoto, etc. all use "their" libusb API.

This is as much as I know, not being an authoritative expert. I just know "it
works" and finally had the time to roll a port of the library (I received
commit priv's on the libusb project in order to get it "cleaned up" for FreeBSD
which is happening slowly).

-Jr

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
John Reynolds         Chandler Capabilities Engineering, CDS, Intel Corporation
jreynold@sedona.ch.intel.com  My opinions are mine, not Intel's. Running
jjreynold@home.com        FreeBSD 4.2-STABLE. FreeBSD: The Power to Serve.
http://www.reynoldsnet.org/  Come join us!!! @ http://www.FreeBSD.org/
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Comment 3 Will Andrews 2001-01-28 21:35:45 UTC
On Sun, Jan 28, 2001 at 02:27:10PM -0700, John Reynolds wrote:
> Not that I'm aware of, though I don't pretend to know the intricacies of it
> all. From what I can gather, our own "libusb" which resides in /usr/lib might
> provide all that's necessary to talk to USB devices. I have never
> tried. However, programs originally written under Linux that were hacked
> together when their USB kernel was coming along, started using "their"
> libusb. It is a specific "userland" API that the programs have been written
> to. My favorite of these is S10sh (http://www.kyuzz.org/antirez/s10sh.html). 
> When I originally compiled this program I tried to link it against "our"
> libusb to no avail. Only recently after the efforts of Richard Tobin, do
> things now "work" since S10sh, gphoto, etc. all use "their" libusb API.


It sucks that libusb isn't as standardized as I thought it was.

> This is as much as I know, not being an authoritative expert. I just know "it
> works" and finally had the time to roll a port of the library (I received
> commit priv's on the libusb project in order to get it "cleaned up" for
> FreeBSD which is happening slowly).


Wow, that's cool that someone can directly influence the tree for
FreeBSD.  Let me know if you need help.  I am fairly desperate to get my
Kodak DC290 camera to work; libgphoto2 looks cool, but it doesn't work
for various reasons (like the fact that their configure scripts are
fucked up due to some weird autoconf thing).

-- 
wca

P.S. Your mailer's wrapping is too large; I can't display 80 characters
     w/o wrapping.
Comment 4 John Reynolds 2001-01-28 22:57:56 UTC
[ On Sunday, January 28, Will Andrews wrote: ]
> 
> It sucks that libusb isn't as standardized as I thought it was.
> 

Yeah--it doesn't appear so.

> Wow, that's cool that someone can directly influence the tree for
> FreeBSD.  Let me know if you need help.  I am fairly desperate to get my

Yeah, I was pretty happy. Johannes (leader) said all along he "wanted" to make
it 'cross platform' but didn't have anything FreeBSD to try it on. Richard
stepped up, and I've done a few knick-nacks to make the bloody thing configure
and compile "out of the box." I asked for commit privs and he said "sure," so
now I can commit FreeBSD bits.

Some of the APIs are not done yet. Richard, like me, doesn't claim to know the
technical guts of USB and how it is implemented on FreeBSD. :) So, I might take
you up on your offer in the future!

If I read the man page for usb(3) it appears that the hid* functions could
possibly be used in the same manner the API that libusb provides. However, IMHO
the man page is sorely lacking in examples. It could be possible that we could
implement the "linux" libusb API with only calls to "our" libusb. Who knows?

> Kodak DC290 camera to work; libgphoto2 looks cool, but it doesn't work
> for various reasons (like the fact that their configure scripts are
> f*cked up due to some weird autoconf thing).

Since I got S10sh to work with my S10, I've not screwed with anything
else. However, there was a bug report filed for libusb with some diffs for
FreeBSD. The person reported to get his DC290 camera "almost" working. I asked
him whether the "almost" was due to libusb still being "beta" or gphoto2 being
incomplete, but haven't gotten an answer yet. I was going to look at his diff
something Real Soon Now(tm). I'll forward the bug report to you so you can get
his address, the diff, and maybe you can converse with him.

-Jr

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
John Reynolds         Chandler Capabilities Engineering, CDS, Intel Corporation
jreynold@sedona.ch.intel.com  My opinions are mine, not Intel's. Running
jjreynold@home.com        FreeBSD 4.2-STABLE. FreeBSD: The Power to Serve.
http://www.reynoldsnet.org/  Come join us!!! @ http://www.FreeBSD.org/
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Comment 5 Mikhail T. 2001-02-11 20:18:48 UTC
As a happy user of this port-candidate with my PowerShot S100,
and a fresh committer, I'd commit this port, but I'm not sure
about the name of the installed library -- libusb. It is too
easily confused with our own libusb. Forget the -L/usr/local/lib
in front of -lusb and instead of "not found" you get totally wierd
errors :)

Do others view this as a problem? How can it be renamed?

    -mi
Comment 6 John Reynolds 2001-02-11 20:45:37 UTC
[ On Sunday, February 11, Mikhail Teterin wrote: ]
> As a happy user of this port-candidate with my PowerShot S100,
> and a fresh committer, I'd commit this port, but I'm not sure
> about the name of the installed library -- libusb. It is too
> easily confused with our own libusb. Forget the -L/usr/local/lib
> in front of -lusb and instead of "not found" you get totally wierd
> errors :)
> 
> Do others view this as a problem? How can it be renamed?
> 
>     -mi

Thanks for your interest in commiting this port! I understand the naming
difficulties. For ports or other applications that use libusb in its current
format they would need to utilize the "libusb-config" script in order to use
the correct flags to build. I realize there is definitely "trouble brewing"
with two libraries named the same thing. This has come up on the usb-bsd
mailing list in the last week or two. Johannes E., creator of libusb, would
rather not change the name of the library. Somebody had asked whether or not
the BSDs should change their libusb to something along the lines of libhid or
libusbhid (since it only deals with HID) and the NetBSD USB stack author
(Lennart Augustsson) said this was something that probably should be done (see
http://lists.inteltec.com/wws/arc/usb-bsd/2001-02/msg00007.html). However,
there have been no details as to when such a rename might take place. Nick
Hibma has been out on holiday so we've not gotten his opinion or possible time
table as to when a rename might take place (i.e. RELENG_4 or -current only,
etc.).

My opinion is to commit the port and let people start using the library. If
gphoto and/or gphoto2 ports can be configured to use the libusb-config script
to get the right arguments, things "should be ok" (notice the quotes). This
will leave a naming conflict open now, but meantime we can discuss how and when
to rename BSD's libusb to something else[1].

-Jr

[1] There are lots of options here, up to and including merging the two
libraries into one and putting it into the tree by default. None of this has
been sorted out and not be a committer [or somebody who knows a heck of a lot
about USB :)] I'll have to stand by the trenches and watch the discussion.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
John Reynolds         Chandler Capabilities Engineering, CDS, Intel Corporation
jreynold@sedona.ch.intel.com  My opinions are mine, not Intel's. Running
jjreynold@home.com        FreeBSD 4.2-STABLE. FreeBSD: The Power to Serve.
http://www.reynoldsnet.org/  Come join us!!! @ http://www.FreeBSD.org/
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Comment 7 Mikhail Teterin freebsd_committer freebsd_triage 2001-02-26 21:46:35 UTC
State Changed
From-To: open->closed

Committed. Thanks a lot. Please, do the s10sh now :-)