From b042489852eb9c9ddb4a6091e88c5d30632a8261 Mon Sep 17 00:00:00 2001 From: Jiege Chen Date: Sun, 4 Oct 2015 17:50:36 +0800 Subject: [PATCH] airspy 1.0.6 (new formula) Closes Homebrew/homebrew#44581. Signed-off-by: Dominyk Tiller --- Formula/airspy.rb | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Formula/airspy.rb diff --git a/Formula/airspy.rb b/Formula/airspy.rb new file mode 100644 index 00000000000..20f81442cba --- /dev/null +++ b/Formula/airspy.rb @@ -0,0 +1,35 @@ +class Airspy < Formula + desc "The usemode driver and associated tools for airspy" + homepage "http://www.airspy.com" + url "https://github.com/airspy/host/archive/v1.0.6.tar.gz" + sha256 "58a80db62a178c04f52172e25921f2e1b67f1efaf36e4c808e5b5eeb8f6dbfd9" + head "https://github.com/airspy/host.git" + + option :universal + + depends_on "pkg-config" => :build + depends_on "cmake" => :build + depends_on "libusb" + + def install + args = std_cmake_args + + libusb = Formula["libusb"] + args << "-DLIBUSB_INCLUDE_DIR=#{libusb.opt_include}/libusb-1.0" + args << "-DLIBUSB_LIBRARIES=#{libusb.opt_lib}/libusb-1.0.dylib" + + if build.universal? + ENV.universal_binary + args << "-DCMAKE_OSX_ARCHITECTURES=#{Hardware::CPU.universal_archs.as_cmake_arch_flags}" + end + + mkdir "build" do + system "cmake", "..", *args + system "make", "install" + end + end + + test do + assert_match version.to_s, shell_output("#{bin}/airspy_lib_version").chomp + end +end