2011-03-10 05:11:03 +00:00
|
|
|
class Astyle < Formula
|
2014-11-17 08:34:06 +00:00
|
|
|
homepage "http://astyle.sourceforge.net/"
|
2014-11-20 02:15:10 +00:00
|
|
|
url "https://downloads.sourceforge.net/project/astyle/astyle/astyle%202.05/astyle_2.05_macosx.tar.gz"
|
|
|
|
sha1 "143be1d605ba05855451c3d96f9a4612d2feb554"
|
2014-11-17 08:34:06 +00:00
|
|
|
head "svn://svn.code.sf.net/p/astyle/code/trunk/AStyle"
|
2009-06-14 23:55:32 +00:00
|
|
|
|
2014-11-17 08:51:38 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
2014-11-20 02:25:57 +00:00
|
|
|
sha1 "eee1cfb500d564b2209cbe8bcc5cf8e55132c10a" => :yosemite
|
|
|
|
sha1 "5d2cb65bffdbbb3718d72b5529354a5362d90bf5" => :mavericks
|
|
|
|
sha1 "5125e27b1b8343ed7da7d223f06393aca25a6acd" => :mountain_lion
|
2014-11-17 08:51:38 +00:00
|
|
|
end
|
|
|
|
|
2009-06-14 23:55:32 +00:00
|
|
|
def install
|
2014-11-17 08:34:06 +00:00
|
|
|
cd "src" do
|
2012-03-11 21:55:21 +00:00
|
|
|
system "make", "CXX=#{ENV.cxx}", "-f", "../build/mac/Makefile"
|
2010-04-07 05:58:35 +00:00
|
|
|
bin.install "bin/astyle"
|
2009-06-14 23:55:32 +00:00
|
|
|
end
|
|
|
|
end
|
2014-12-29 07:45:57 +00:00
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"test.c").write("int main(){return 0;}\n")
|
|
|
|
system "#{bin}/astyle", "--style=gnu", "--indent=spaces=4",
|
|
|
|
"--lineend=linux", "#{testpath}/test.c"
|
|
|
|
assert_equal File.read("test.c"), <<-EOS.undent
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
EOS
|
|
|
|
end
|
2011-01-26 00:35:02 +00:00
|
|
|
end
|