Skip to content

Commit

Permalink
libspnav 0.2.3 (new formula)
Browse files Browse the repository at this point in the history
Closes Homebrew/legacy-homebrew#42906.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
  • Loading branch information
justbuchanan authored and MikeMcQuaid committed Aug 14, 2015
1 parent 1111faf commit 28f05af
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions Formula/libspnav.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
class Libspnav < Formula
desc "Client library for connecting to 3Dconnexion's 3D input devices"
homepage "http://spacenav.sourceforge.net/index.html"
url "https://downloads.sourceforge.net/project/spacenav/spacenav%20library%20%28SDK%29/libspnav%200.2.3/libspnav-0.2.3.tar.gz"
sha256 "7ae4d7bb7f6a5dda28b487891e01accc856311440f582299760dace6ee5f1f93"

option "with-x11", "Enable support for sending mouse events through the x11 protocol"

depends_on :x11 => :optional

def install
args = %W[
--disable-debug
--disable-dependency-tracking
--disable-silent-rules
--prefix=#{prefix}
]

args << "--disable-x11" if build.without? "x11"

system "./configure", *args
system "make", "install"
end

test do
(testpath/"test.cpp").write <<-EOS.undent
#include <spnav.h>
int main() {
bool connected = spnav_open() != -1;
if (connected) spnav_close();
return 0;
}
EOS
system ENV.cc, "test.cpp", "-I#{include}", "-L#{lib}", "-lspnav", "-o", "test"
system "./test"
end
end

0 comments on commit 28f05af

Please sign in to comment.