homebrew-core/Formula/urh.rb
2017-05-12 06:23:31 -07:00

64 lines
2.7 KiB
Ruby

class Urh < Formula
desc "Universal Radio Hacker"
homepage "https://github.com/jopohl/urh"
url "https://files.pythonhosted.org/packages/c2/38/a6cf1c14f16e4ef2cc216511787697ba7b4d92cb6164417a7717ceb182d1/urh-1.6.3.tar.gz"
sha256 "caf4c4d5f5683ec87ded39282990762066a81d2de02030cb077a947733d40307"
head "https://github.com/jopohl/urh.git"
bottle do
sha256 "4e4766e6135697a80e0bb225792c646c1a04d38159a70dfcd70a0cfc694bbfdd" => :sierra
sha256 "8d67c6952ee60f6c31df5bc2e2d87e3f7c12c2c9ad21192fceb6ba1fc7066f56" => :el_capitan
sha256 "dd152ae72d9c2c27bd5652b4c83611008bd4d9c1f3d2ef6fd092113751579b61" => :yosemite
end
option "with-hackrf", "Build with libhackrf support"
depends_on "pkg-config" => :build
depends_on :python3
depends_on "pyqt"
depends_on "hackrf" => :optional
resource "numpy" do
url "https://files.pythonhosted.org/packages/a5/16/8a678404411842fe02d780b5f0a676ff4d79cd58f0f22acddab1b392e230/numpy-1.12.1.zip"
sha256 "a65266a4ad6ec8936a1bc85ce51f8600634a31a258b722c9274a80ff189d9542"
end
resource "psutil" do
url "https://files.pythonhosted.org/packages/57/93/47a2e3befaf194ccc3d05ffbcba2cdcdd22a231100ef7e4cf63f085c900b/psutil-5.2.2.tar.gz"
sha256 "44746540c0fab5b95401520d29eb9ffe84b3b4a235bd1d1971cbe36e1f38dd13"
end
resource "pyzmq" do
url "https://files.pythonhosted.org/packages/af/37/8e0bf3800823bc247c36715a52e924e8f8fd5d1432f04b44b8cd7a5d7e55/pyzmq-16.0.2.tar.gz"
sha256 "0322543fff5ab6f87d11a8a099c4c07dd8a1719040084b6ce9162bcdf5c45c9d"
end
def install
# Workaround for https://github.com/Homebrew/brew/issues/932
ENV.delete "PYTHONPATH"
# suppress urh warning about needing to recompile the c++ extensions
inreplace "src/urh/main.py", "GENERATE_UI = True", "GENERATE_UI = False"
xy = Language::Python.major_minor_version "python3"
ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python#{xy}/site-packages"
resources.each do |r|
r.stage do
system "python3", *Language::Python.setup_install_args(libexec/"vendor")
end
end
ENV.prepend_create_path "PYTHONPATH", libexec/"lib/python#{xy}/site-packages"
system "python3", *Language::Python.setup_install_args(libexec)
bin.install Dir[libexec/"bin/*"]
bin.env_script_all_files(libexec/"bin", :PYTHONPATH => ENV["PYTHONPATH"])
end
test do
xy = Language::Python.major_minor_version "python3"
ENV.prepend_create_path "PYTHONPATH", libexec/"lib/python#{xy}/site-packages"
system "python3", "-c", "import urh.util.crc;c = urh.util.crc.crc_generic();assert(c.crc([1, 2, 3]) == [True, False, False, False, False, False, True, True, False, False, False, False, False, False, True, True])"
end
end