• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1require "formula"
2
3class Capstone < Formula
4  homepage "http://capstone-engine.org"
5  url "http://capstone-engine.org/download/3.0.1/capstone-3.0.1.tgz"
6  sha1 "7f206c853c6b8d05de22e919c2455ab661654093"
7
8  bottle do
9    cellar :any
10    sha1 "319b41766dd67e3017b83b1ce3df3cc81e6feb6a" => :yosemite
11    sha1 "4f1bbe6b886c174924b1996aac7ed8d9850ff773" => :mavericks
12    sha1 "5a73b99066037a6270f550e07bee8cbcb8e30a2c" => :mountain_lion
13  end
14
15  def install
16    # Capstone's Make script ignores the prefix env and was installing
17    # in /usr/local directly. So just inreplace the prefix for less pain.
18    # https://github.com/aquynh/capstone/issues/228
19    inreplace "make.sh", "export PREFIX=/usr/local", "export PREFIX=#{prefix}"
20
21    ENV["HOMEBREW_CAPSTONE"] = "1"
22    system "./make.sh"
23    system "./make.sh", "install"
24  end
25
26  test do
27    # Given the build issues around prefix, check is actually in the Cellar.
28    assert File.exist? "#{lib}/libcapstone.a"
29  end
30end
31