2017-03-07 02:25:29 +00:00
|
|
|
class Urh < Formula
|
|
|
|
desc "Universal Radio Hacker"
|
|
|
|
homepage "https://github.com/jopohl/urh"
|
2017-05-28 11:57:54 +00:00
|
|
|
url "https://files.pythonhosted.org/packages/e2/64/678fbb04bb4a94d004f8ea5330a3d55697f754d0b65c3ac204d15923add9/urh-1.6.4.2.tar.gz"
|
|
|
|
sha256 "97300857d854d73bcab22dc6edfbea28e175bee6204b88ebd8becc623bff6c00"
|
2017-03-07 02:25:29 +00:00
|
|
|
head "https://github.com/jopohl/urh.git"
|
|
|
|
|
2017-03-13 18:12:47 +00:00
|
|
|
bottle do
|
2017-05-28 12:07:30 +00:00
|
|
|
sha256 "0c0ce2ee4bbc94630b68395a550b7260c02760abb6ea28ee614eff5d77cc50c9" => :sierra
|
|
|
|
sha256 "a7d945f9db5a022807e427ca9eae2127a16c55338bfb06acf155b11c6abe16d4" => :el_capitan
|
|
|
|
sha256 "8a7273126478ee80d7b84a3ffef25c22c4405d0aa4b9d61409289659155510c3" => :yosemite
|
2017-03-13 18:12:47 +00:00
|
|
|
end
|
|
|
|
|
2017-03-07 02:25:29 +00:00
|
|
|
option "with-hackrf", "Build with libhackrf support"
|
|
|
|
|
|
|
|
depends_on "pkg-config" => :build
|
|
|
|
|
|
|
|
depends_on :python3
|
2017-04-06 08:03:11 +00:00
|
|
|
depends_on "pyqt"
|
2017-03-07 02:25:29 +00:00
|
|
|
|
|
|
|
depends_on "hackrf" => :optional
|
|
|
|
|
2017-04-26 11:28:46 +00:00
|
|
|
resource "numpy" do
|
|
|
|
url "https://files.pythonhosted.org/packages/a5/16/8a678404411842fe02d780b5f0a676ff4d79cd58f0f22acddab1b392e230/numpy-1.12.1.zip"
|
|
|
|
sha256 "a65266a4ad6ec8936a1bc85ce51f8600634a31a258b722c9274a80ff189d9542"
|
|
|
|
end
|
|
|
|
|
2017-03-07 02:25:29 +00:00
|
|
|
resource "psutil" do
|
2017-04-14 10:48:54 +00:00
|
|
|
url "https://files.pythonhosted.org/packages/57/93/47a2e3befaf194ccc3d05ffbcba2cdcdd22a231100ef7e4cf63f085c900b/psutil-5.2.2.tar.gz"
|
|
|
|
sha256 "44746540c0fab5b95401520d29eb9ffe84b3b4a235bd1d1971cbe36e1f38dd13"
|
2017-03-07 02:25:29 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
resource "pyzmq" do
|
2017-03-21 16:47:33 +00:00
|
|
|
url "https://files.pythonhosted.org/packages/af/37/8e0bf3800823bc247c36715a52e924e8f8fd5d1432f04b44b8cd7a5d7e55/pyzmq-16.0.2.tar.gz"
|
2017-03-07 02:25:29 +00:00
|
|
|
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
|