2017-03-07 02:25:29 +00:00
|
|
|
class Urh < Formula
|
|
|
|
desc "Universal Radio Hacker"
|
|
|
|
homepage "https://github.com/jopohl/urh"
|
2017-03-31 07:05:25 +00:00
|
|
|
url "https://files.pythonhosted.org/packages/01/a9/1757867e63c8612b2a50d39f61a19d7435d1b407a8d66fb9032f505cbdf0/urh-1.6.1.9.tar.gz"
|
|
|
|
sha256 "9dc5b4b3507312821a30918098255475411acb81dcede27574d68ec1fc59d840"
|
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
|
|
|
|
cellar :any_skip_relocation
|
2017-03-31 07:17:27 +00:00
|
|
|
sha256 "581d55bccabc4641703dbd9b4643c8c88395579842903f4f91467cebc0416734" => :sierra
|
|
|
|
sha256 "8c94f3e8505e9b5796764a464ffb921d70d9b1a1f47308d6729903ce92bc72d8" => :el_capitan
|
|
|
|
sha256 "9da996011690ec467c0d287b1e92707e076b7763b2ad619553fbfac238f5a7ad" => :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
|
|
|
|
depends_on "pyqt5"
|
|
|
|
depends_on "numpy" => ["with-python3"]
|
|
|
|
|
|
|
|
depends_on "hackrf" => :optional
|
|
|
|
|
|
|
|
resource "psutil" do
|
2017-03-31 07:05:25 +00:00
|
|
|
url "https://files.pythonhosted.org/packages/b8/47/c85fbcd23f40892db6ecc88782beb6ee66d22008c2f9821d777cb1984240/psutil-5.2.1.tar.gz"
|
|
|
|
sha256 "fe0ea53b302f68fca1c2a3bac289e11344456786141b73391ed4022b412d5455"
|
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
|