
Hello, I would like to announce the release of usb-0.1, a Haskell library for communicating with USB devices from userspace. usb is implemented as a high-level wrapper around Maurício C. Antunes' bindings-libusb which is a binding to the C library: libusb-1.* ( http://libusb.org ). All functionality from libusb is provided except for asynchronous IO. I'm still thinking about if and how I should add that. As usual, install usb using cabal:
cabal install usb
Or download and install it manually from hackage: http://hackage.haskell.org/package/usb-0.1 Or get the development source using darcs: darcs get http://code.haskell.org/~basvandijk/code/usb Comments and patches are highly welcome. Note that this is the first release, so expect API changes in the future. Note that my brother uploaded 'usb-id-database' to hackage. A small library for associating usb identifiers like vendor, product, class, subclass or prototcol identifiers with their respective names and vice versa: http://hackage.haskell.org/package/usb-id-database This can be helpful when trying to find the right device to operate. In a short while, the package 'ls-usb' will be released. This is a simple program for showing all the usb devices currently attached to your system. It's a nice demonstration on how to use the library. regards, Bas

Bas van Dijk wrote:
Comments and patches are highly welcome.
I tried to install on my Mac but bindings-common choked on:
cabal install bindings-common Resolving dependencies... cabal: Error: some packages failed to install: bindings-common-1.1 failed while unpacking the package. The exception was: /var/folders/mR/mRFqQvztFo0URT0d6GN9wE+++TI/-Tmp-/bindings-common-1.174967/bindings-common-1.1/src/Bindings: createDirectory: does not exist (No such file or directory)
Not sure if this is interesting to you, Bas, but I thought I'd share. :-) Groetjes, Martijn.

Yes, that happens. I don't now the cause but the work-around is easy.
Simply download the package manually from hackage, unpack and install
using cabal.
At least the following packages suffer from this problem:
bindings-common
bindings-libusb
bindings-posix
Perhaps Maurício can shed some light on this.
Groetjes,
Roel
On Thu, Oct 1, 2009 at 4:02 PM, Martijn van Steenbergen
Bas van Dijk wrote:
Comments and patches are highly welcome.
I tried to install on my Mac but bindings-common choked on:
cabal install bindings-common Resolving dependencies... cabal: Error: some packages failed to install: bindings-common-1.1 failed while unpacking the package. The exception was: /var/folders/mR/mRFqQvztFo0URT0d6GN9wE+++TI/-Tmp-/bindings-common-1.174967/bindings-common-1.1/src/Bindings: createDirectory: does not exist (No such file or directory)
Not sure if this is interesting to you, Bas, but I thought I'd share. :-)
Groetjes,
Martijn.

Roel van Dijk wrote:
Yes, that happens. I don't now the cause but the work-around is easy. Simply download the package manually from hackage, unpack and install using cabal.
At least the following packages suffer from this problem: bindings-common bindings-libusb bindings-posix
Perhaps Maurício can shed some light on this.
That's odd, even cabal unpack fails. Smells like a cabal bug. :-) I'll see if I can find if it's been reported before. Martijn.

On Thu, 2009-10-01 at 16:22 +0200, Martijn van Steenbergen wrote:
Roel van Dijk wrote:
Yes, that happens. I don't now the cause but the work-around is easy. Simply download the package manually from hackage, unpack and install using cabal.
At least the following packages suffer from this problem: bindings-common bindings-libusb bindings-posix
Perhaps Maurício can shed some light on this.
That's odd, even cabal unpack fails. Smells like a cabal bug. :-) I'll see if I can find if it's been reported before.
I suspect it is a bug in the tar code (a copy of which is used in cabal-install). Most .tar files contain entries for the directories that precede the entries for the files. This is only by convention however. It looks like this tar file has an entry for "src/Bindings/SomeFile.hs" without any preceding entries for "src/AnotherFile" or for the directory itself "src/Bindings/". The bug is that while the tar code would create the "src/" directory for a file entry "src/AnotherFile", it would not create the "src/" directory for "src/Bindings/SomeFile.hs", just try to create the "src/Bindings" directroy, which then fails since "src/" does not yet exist. I was trying to avoid making all parent directories in a fully recursive way. In particular I don't want it to make the target root directory if it did not already exist. I guess it should at least make the directories between the target root and the directory containing the file to be unpacked. If someone wants to make a patch for this then please do it against the tar package code: darcs get http://code.haskell.org/tar/ Note that tar files constructed using cabal sdist should not have this particular problem due to the order of entries within the archive. Duncan

At least the following packages suffer from this problem: bindings-common bindings-libusb bindings-posix
Most .tar files contain entries for the directories that precede the entries for the files. This is only by convention however. It looks like this tar file has an entry for "src/Bindings/SomeFile.hs" without any preceding entries for "src/AnotherFile" or for the directory itself "src/Bindings/".
Thanks for the tip. I used Mercurial archive to create those tars: hg archive -t tgz -p 'bindings-common-1.1' ~/bindings-common-1.1.tar.gz I'll check if this is known in Mercurial, specially the weird output got from 7zip. Meanwhile, I'll be uploading as soon as possible new versions of those packages with runhaskell Setup.hs sdist Best, Maurício

2009/10/1 Maurício CA
Meanwhile, I'll be uploading as soon as possible new versions...
Thanks Mauricio, I've uploaded usb-0.1.0.1 that now depends on the fixed bindings-libusb-1.2. http://hackage.haskell.org/package/usb-0.1.0.1 regards, Bas

In a short while, the package 'ls-usb' will be released.
I've just uploaded usb-id-database-0.4 and ls-usb-0.1: http://hackage.haskell.org/package/usb-id-database-0.4 http://hackage.haskell.org/package/ls-usb-0.1 The utility ls-usb uses the usb package to detect all USB devices connected to you system. It then displays them in a nice list. It behaves very much like the existing utility lsusb and is meant more as an example of using the usb package then as an actual program. Be sure to run with elevated privileges if you want detailed information. Regards, Roel

The file bindings-common.tar.gz looks a bit odd: when I unpack it with
7Zip, I get the path:
bindings-common-1.1.tar.gz\\home\mauricio\bindings-common-1.1.tar.gz\bindings-common-1.1\
(first part deleted)
Met vriendelijke groet,
Henk-Jan van Tuyl
--
http://functor.bamikanarie.com
http://Van.Tuyl.eu/
--
On Thu, 01 Oct 2009 16:12:21 +0200, Roel van Dijk
Yes, that happens. I don't now the cause but the work-around is easy. Simply download the package manually from hackage, unpack and install using cabal.
At least the following packages suffer from this problem: bindings-common bindings-libusb bindings-posix
Perhaps Maurício can shed some light on this.
Groetjes, Roel
On Thu, Oct 1, 2009 at 4:02 PM, Martijn van Steenbergen
wrote: Bas van Dijk wrote:
Comments and patches are highly welcome.
I tried to install on my Mac but bindings-common choked on:
cabal install bindings-common Resolving dependencies... cabal: Error: some packages failed to install: bindings-common-1.1 failed while unpacking the package. The exception was: /var/folders/mR/mRFqQvztFo0URT0d6GN9wE+++TI/-Tmp-/bindings-common-1.174967/bindings-common-1.1/src/Bindings: createDirectory: does not exist (No such file or directory)
Not sure if this is interesting to you, Bas, but I thought I'd share. :-)
Groetjes,
Martijn.
--
participants (6)
-
Bas van Dijk
-
Duncan Coutts
-
Henk-Jan van Tuyl
-
Martijn van Steenbergen
-
Maurício CA
-
Roel van Dijk