homebrew-core/Formula/gr-osmosdr.rb

54 lines
1.6 KiB
Ruby

class GrOsmosdr < Formula
desc "Osmocom GNU Radio Blocks"
homepage "https://osmocom.org/projects/sdr/wiki/GrOsmoSDR"
url "https://github.com/osmocom/gr-osmosdr/archive/v0.1.4.tar.gz"
sha256 "bcf9a9b1760e667c41a354e8cd41ef911d0929d5e4a18e0594ccb3320d735066"
license "GPL-3.0"
revision 10
bottle do
cellar :any
sha256 "65570c9ef4058f8ace042beeed7672b445e7d7c069ca9c6b28c535bbe0a2b711" => :catalina
sha256 "971a785a7acf94c36761047326a56ce5e375bf9d5e633b24df196cef4c0035e6" => :mojave
sha256 "0a79c514b8da09932af265cf6582789edb8fd1b87cef0796e10dab7b847779bb" => :high_sierra
end
depends_on "cmake" => :build
depends_on "swig" => :build
depends_on "airspy"
depends_on "boost"
depends_on "gnuradio"
depends_on "hackrf"
depends_on "librtlsdr"
depends_on :macos # gnuradio uses Python 2
depends_on "uhd"
resource "Cheetah" do
url "https://files.pythonhosted.org/packages/cd/b0/c2d700252fc251e91c08639ff41a8a5203b627f4e0a2ae18a6b662ab32ea/Cheetah-2.4.4.tar.gz"
sha256 "be308229f0c1e5e5af4f27d7ee06d90bb19e6af3059794e5fd536a6f29a9b550"
end
def install
ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python2.7/site-packages"
resource("Cheetah").stage do
system "python", *Language::Python.setup_install_args(libexec/"vendor")
end
system "cmake", ".", *std_cmake_args
system "make", "install"
end
test do
(testpath/"test.cpp").write <<~EOS
#include <osmosdr/device.h>
int main() {
osmosdr::device_t device;
return 0;
}
EOS
system ENV.cxx, "test.cpp", "-L#{lib}", "-lgnuradio-osmosdr", "-o", "test"
system "./test"
end
end