homebrew-core/Formula/capstone.rb

36 lines
1.3 KiB
Ruby
Raw Normal View History

class Capstone < Formula
desc "Multi-platform, multi-architecture disassembly framework"
homepage "http://capstone-engine.org"
url "http://capstone-engine.org/download/3.0.4/capstone-3.0.4.tgz"
sha256 "3e88abdf6899d11897f2e064619edcc731cc8e97e9d4db86495702551bb3ae7f"
bottle do
cellar :any
2015-05-09 02:03:13 +00:00
sha256 "4b6a547cde768d88cb7a13549a5e1156282e9d524e691a7840b9689323eb860d" => :yosemite
sha256 "7b271a58f25cc409df8c0cf87101250c50ee072f50d41b5fe0f884369327b608" => :mavericks
sha256 "aaff57ed10734d1ef15f6e3f2c73be5d1841bad5ea98db9396fd3abe1d267c97" => :mountain_lion
end
def install
# Capstone's Make script ignores the prefix env and was installing
# in /usr/local directly. So just inreplace the prefix for less pain.
# https://github.com/aquynh/capstone/issues/228
inreplace "make.sh", "export PREFIX=/usr/local", "export PREFIX=#{prefix}"
2014-04-01 08:25:58 +00:00
ENV["HOMEBREW_CAPSTONE"] = "1"
system "./make.sh"
system "./make.sh", "install"
# As per the above inreplace, the pkgconfig file needs fixing as well.
inreplace lib/"pkgconfig/capstone.pc" do |s|
s.gsub! "/usr/lib", lib
s.gsub! "/usr/include/capstone", "#{include}/capstone"
end
end
test do
# Given the build issues around prefix, check is actually in the Cellar.
assert File.exist? "#{lib}/libcapstone.a"
end
end