51 lines
1.8 KiB
Ruby
51 lines
1.8 KiB
Ruby
class TheSilverSearcher < Formula
|
|
desc "Code-search similar to ack"
|
|
homepage "https://github.com/ggreer/the_silver_searcher"
|
|
head "https://github.com/ggreer/the_silver_searcher.git"
|
|
url "https://github.com/ggreer/the_silver_searcher/archive/0.30.0.tar.gz"
|
|
sha256 "a3b61b80f96647dbe89c7e89a8fa7612545db6fa4a313c0ef8a574d01e7da5db"
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "2083010fedc92dddfe1806bd505b37f67de334780a3351aa0f336f0a45f037c7" => :yosemite
|
|
sha256 "7ec1a769eea33db96c16614beebcb184d775d682803870d0ec894a3dddb86db3" => :mavericks
|
|
sha256 "2c771c3cd0f3189b4943ca0a57a1d96a082e3d418cfaaf8390d6f4a7fe8d781e" => :mountain_lion
|
|
end
|
|
|
|
depends_on "autoconf" => :build
|
|
depends_on "automake" => :build
|
|
|
|
depends_on "pkg-config" => :build
|
|
depends_on "pcre"
|
|
depends_on "xz"
|
|
|
|
# Edit bash completion script to not require bash-completion
|
|
# The `have ag` test is redundant in any case, since the script will only
|
|
# be installed if Ag itself is installed. See:
|
|
# https://github.com/ggreer/the_silver_searcher/issues/208
|
|
# https://github.com/Homebrew/homebrew/issues/27418
|
|
patch do
|
|
url "https://github.com/thomasf/the_silver_searcher/commit/867dff8631bc80d760268f653265e4d3caf44f16.diff"
|
|
sha1 "09502c60a11658d9a08a6825e78defad96318bd9"
|
|
end
|
|
|
|
def install
|
|
# Stable tarball does not include pre-generated configure script
|
|
system "aclocal", "-I #{HOMEBREW_PREFIX}/share/aclocal"
|
|
system "autoconf"
|
|
system "autoheader"
|
|
system "automake", "--add-missing"
|
|
|
|
system "./configure", "--disable-dependency-tracking",
|
|
"--prefix=#{prefix}"
|
|
system "make"
|
|
system "make", "install"
|
|
|
|
bash_completion.install "ag.bashcomp.sh"
|
|
end
|
|
|
|
test do
|
|
(testpath/"Hello.txt").write("Hello World!")
|
|
system "#{bin}/ag", "Hello World!", testpath
|
|
end
|
|
end
|