Giter Site home page Giter Site logo

haskell-hidapi's Introduction

hidapi Build Status Hackage

Haskell FFI bindings to the HIDAPI library

Vendored HIDAPI

hidapi bundles C source from the libusb project. The current version of the HIDAPI library bundled with this library is libusb/hidapi@f8a47b5.

haskell-hidapi's People

Contributors

amarrella avatar chpatrick avatar dminuoso avatar nh2 avatar pcrama avatar typedbyte avatar wuest avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

haskell-hidapi's Issues

Release new version to Hackage

Since #9 fixed some bugs in the underlying C library and #10 officially refers to the updated hidapi repo, it would be nice to release a new version to Hackage to make these changes more accessible.

Inconsistent output

I just compared with node-hid, and the output of enumerateAll is just wrong. I think I’m going to patch it. :)

Building on OS X

I'm having some difficulty building on OS X as I don't have libudev installed. Looking at the source, it seems the package has only been prepared for windows and Linux. Is this correct?

Building the library fails with ghc 7.10.1 on osx el capitan and windows 10

Thanks for making this library ! I have used it to control a robot (MBot) from within Haskell. Unfortunately the library as is wouldn't compile on my mac nor on windows 10. I had to make two tiny adjustments.

System/HIDAPI.hsc => import Control.DeepSeq
hidapi.cabal => deepseq >= 0.1 (in the build-depends)

It would be great if you could either make these changes or explain me how the library could be installed without having to make these changes. Otherwise I will have to re-distributed your code with the super tiny patch.

Just to be complete here is the error I get without the changes:

$ cabal install
...
Configuring hidapi-0.1.3...
Building hidapi-0.1.3...
Preprocessing library hidapi-0.1.3...
[1 of 1] Compiling System.HIDAPI ( dist/build/System/HIDAPI.hs, dist/build/System/HIDAPI.o )

System/HIDAPI.hsc:95:10:
Not in scope: type constructor or class ‘NFData’
Perhaps you meant ‘Data’ (imported from Data.Data)

System/HIDAPI.hsc:126:10:
Not in scope: type constructor or class ‘NFData’
Perhaps you meant ‘Data’ (imported from Data.Data)
Failed to install hidapi-0.1.3
cabal: Error: some packages failed to install:
hidapi-0.1.3 failed during the building phase. The exception was:
ExitFailure 1

Build error on certain versions of depencies

Building on a fresh Haskell install of ghc 7.6.3 we get deepseq-generics-0.2.0.0 (due to lax constraint of hidapi). This results in missing NFData (see below). Simply commenting out the two offending lines works fine (albeit without NFData instances). Another suggestion: Linux needs libudev-dev installed as well as just udev. Perhaps libudev-dev should be added as a requirement. Not everyone will know to install libudev-dev when install fails with error missing udev.

cabal install hidapi
Resolving dependencies...
Configuring hidapi-0.1.3...
Building hidapi-0.1.3...
Failed to install hidapi-0.1.3
Build log ( /home/pi/.cabal/logs/hidapi-0.1.3.log ):
Configuring hidapi-0.1.3...
Building hidapi-0.1.3...
Preprocessing library hidapi-0.1.3...
[1 of 1] Compiling System.HIDAPI ( dist/build/System/HIDAPI.hs, dist/build/System/HIDAPI.o )

System/HIDAPI.hsc:94:10:
Not in scope: type constructor or class NFData' Perhaps you meantData' (imported from Data.Data)

System/HIDAPI.hsc:125:10:
Not in scope: type constructor or class NFData' Perhaps you meantData' (imported from Data.Data)
cabal: Error: some packages failed to install:
hidapi-0.1.3 failed during the building phase. The exception was:
ExitFailure 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.