homebrew-core/Formula/cdecl.rb

29 lines
805 B
Ruby
Raw Normal View History

2011-03-10 05:11:03 +00:00
class Cdecl < Formula
desc "Turn English phrases to C or C++ declarations"
homepage "http://cdecl.org/"
url "http://cdecl.org/files/cdecl-blocks-2.5.tar.gz"
sha256 "9ee6402be7e4f5bb5e6ee60c6b9ea3862935bf070e6cecd0ab0842305406f3ac"
def install
# Fix namespace clash with Lion's getline
inreplace "cdecl.c", "getline", "cdecl_getline"
bin.mkpath
man1.mkpath
ENV.append "CFLAGS", "-DBSD -DUSE_READLINE -std=gnu89"
system "make", "CC=#{ENV.cc}",
"CFLAGS=#{ENV.cflags}",
"LIBS=-lreadline",
"BINDIR=#{bin}",
"MANDIR=#{man1}",
"install"
end
test do
2014-05-04 19:12:41 +00:00
assert_equal "declare a as pointer to int",
shell_output("#{bin}/cdecl explain int *a").strip
end
end