diff options
| author | Damjan Marion | 2013-09-15 00:54:57 +0200 |
|---|---|---|
| committer | Adam Vandenberg | 2013-11-06 20:27:30 -0800 |
| commit | 5b193f58716b41b3c334afb04b52e1b2ab25fbf4 (patch) | |
| tree | 73422e77d20b865af5f8aa06e3e6fce3c5674bbe /Library/Formula/hidapi.rb | |
| parent | 09d79b0224a9bc4b00228010a31383017e3f611f (diff) | |
| download | homebrew-5b193f58716b41b3c334afb04b52e1b2ab25fbf4.tar.bz2 | |
hidapi 0.8-rc1
hidapi is multiplatform USB HID library
Closes #22546.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library/Formula/hidapi.rb')
| -rw-r--r-- | Library/Formula/hidapi.rb | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Library/Formula/hidapi.rb b/Library/Formula/hidapi.rb new file mode 100644 index 000000000..21e257474 --- /dev/null +++ b/Library/Formula/hidapi.rb @@ -0,0 +1,32 @@ +require 'formula' + +class Hidapi < Formula + homepage 'https://github.com/signal11/hidapi' + url 'https://github.com/signal11/hidapi/archive/hidapi-0.8.0-rc1.tar.gz' + sha1 '5e72a4c7add8b85c8abcdd360ab8b1e1421da468' + + depends_on 'autoconf' => :build + depends_on 'automake' => :build + depends_on 'libtool' => :build + depends_on 'pkg-config' => :build + + def install + system './bootstrap' + system "./configure", "--prefix=#{prefix}" + system "make install" + end + + test do + (testpath/'test.c').write <<-EOS.undent + #include "hidapi.h" + int main(void) + { + return hid_exit(); + } + EOS + + flags = `pkg-config --cflags --libs hidapi`.split + ENV.cflags.split + system ENV.cc, "-o", "test", "test.c", *flags + system './test' + end +end |
