2011-03-10 05:11:03 +00:00
|
|
|
class Ccache < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Object-file caching compiler wrapper"
|
2015-05-31 09:14:12 +00:00
|
|
|
homepage "https://ccache.samba.org/"
|
|
|
|
url "https://samba.org/ftp/ccache/ccache-3.2.2.tar.bz2"
|
|
|
|
sha256 "440f5e15141cc72d2bfff467c977020979810eb800882e3437ad1a7153cce7b2"
|
2009-09-25 06:31:17 +00:00
|
|
|
|
2014-10-24 05:34:50 +00:00
|
|
|
bottle do
|
2015-05-31 10:42:41 +00:00
|
|
|
sha256 "56dbbc62a9951890abc7d1ddaf52e615127c9464365f771929f8490aa5355c05" => :yosemite
|
|
|
|
sha256 "d227f6264bc437b518a3b3be71e5d2320eac6afb9c231bca980d6e582f379943" => :mavericks
|
|
|
|
sha256 "8c1b912920988e7429679ca9e2aca9e4ee7ebfaa28b990b9b8afdffb1e028d7d" => :mountain_lion
|
2014-10-24 05:34:50 +00:00
|
|
|
end
|
|
|
|
|
2013-09-20 15:15:51 +00:00
|
|
|
head do
|
2015-05-31 09:14:12 +00:00
|
|
|
url "https://github.com/jrosdahl/ccache.git"
|
2013-02-16 10:30:36 +00:00
|
|
|
|
2014-12-04 17:01:19 +00:00
|
|
|
depends_on "autoconf" => :build
|
|
|
|
depends_on "automake" => :build
|
|
|
|
depends_on "libtool" => :build
|
2013-02-16 10:30:36 +00:00
|
|
|
end
|
|
|
|
|
2009-09-25 06:31:17 +00:00
|
|
|
def install
|
2015-05-31 09:14:12 +00:00
|
|
|
system "./autogen.sh" if build.head?
|
2010-02-20 02:00:11 +00:00
|
|
|
system "./configure", "--prefix=#{prefix}", "--mandir=#{man}"
|
2009-09-25 06:31:17 +00:00
|
|
|
system "make"
|
2015-05-31 09:14:12 +00:00
|
|
|
system "make", "install"
|
2010-05-12 20:33:05 +00:00
|
|
|
|
|
|
|
libexec.mkpath
|
|
|
|
|
|
|
|
%w[
|
2013-06-17 19:33:27 +00:00
|
|
|
clang
|
|
|
|
clang++
|
2010-05-12 20:33:05 +00:00
|
|
|
cc
|
2015-05-31 09:14:12 +00:00
|
|
|
gcc gcc2 gcc3 gcc-3.3 gcc-4.0 gcc-4.2 gcc-4.3 gcc-4.4 gcc-4.5 gcc-4.6 gcc-4.7 gcc-4.8 gcc-4.9 gcc-5
|
|
|
|
c++ c++3 c++-3.3 c++-4.0 c++-4.2 c++-4.3 c++-4.4 c++-4.5 c++-4.6 c++-4.7 c++-4.8 c++-4.9 c++-5
|
|
|
|
g++ g++2 g++3 g++-3.3 g++-4.0 g++-4.2 g++-4.3 g++-4.4 g++-4.5 g++-4.6 g++-4.7 g++-4.8 g++-4.9 g++-5
|
2010-05-12 20:33:05 +00:00
|
|
|
].each do |prog|
|
2014-03-25 00:44:21 +00:00
|
|
|
libexec.install_symlink bin/"ccache" => prog
|
2010-05-12 20:33:05 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2012-06-04 03:19:16 +00:00
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
To install symlinks for compilers that will automatically use
|
|
|
|
ccache, prepend this directory to your PATH:
|
2014-03-06 05:28:31 +00:00
|
|
|
#{opt_libexec}
|
2010-05-12 20:33:05 +00:00
|
|
|
|
2012-06-04 03:19:16 +00:00
|
|
|
If this is an upgrade and you have previously added the symlinks to
|
2013-06-18 23:30:16 +00:00
|
|
|
your PATH, you may need to modify it to the path specified above so
|
|
|
|
it points to the current version.
|
2011-01-20 10:51:13 +00:00
|
|
|
|
2012-06-04 03:19:16 +00:00
|
|
|
NOTE: ccache can prevent some software from compiling.
|
2013-06-18 23:30:16 +00:00
|
|
|
ALSO NOTE: The brew command, by design, will never use ccache.
|
2010-05-12 20:33:05 +00:00
|
|
|
EOS
|
2009-09-25 06:31:17 +00:00
|
|
|
end
|
2015-05-31 09:14:12 +00:00
|
|
|
|
|
|
|
test do
|
|
|
|
ENV.prepend_path "PATH", opt_libexec
|
|
|
|
assert_equal "#{opt_libexec}/gcc", shell_output("which gcc").chomp
|
|
|
|
system "#{bin}/ccache", "-s"
|
|
|
|
end
|
2009-09-25 06:31:17 +00:00
|
|
|
end
|