2011-03-10 05:11:03 +00:00
|
|
|
class Cdecl < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Turn English phrases to C or C++ declarations"
|
2015-08-03 12:55:31 +00:00
|
|
|
homepage "http://cdecl.org/"
|
|
|
|
url "http://cdecl.org/files/cdecl-blocks-2.5.tar.gz"
|
|
|
|
sha256 "9ee6402be7e4f5bb5e6ee60c6b9ea3862935bf070e6cecd0ab0842305406f3ac"
|
2011-01-06 13:45:40 +00:00
|
|
|
|
|
|
|
def install
|
2011-08-29 02:02:22 +00:00
|
|
|
# Fix namespace clash with Lion's getline
|
|
|
|
inreplace "cdecl.c", "getline", "cdecl_getline"
|
|
|
|
|
2012-02-13 04:13:38 +00:00
|
|
|
bin.mkpath
|
2011-01-06 13:45:40 +00:00
|
|
|
man1.mkpath
|
2012-02-13 04:13:38 +00:00
|
|
|
|
2015-08-03 12:55:31 +00:00
|
|
|
ENV.append "CFLAGS", "-DBSD -DUSE_READLINE -std=gnu89"
|
2012-03-17 15:36:13 +00:00
|
|
|
|
2012-02-13 04:13:38 +00:00
|
|
|
system "make", "CC=#{ENV.cc}",
|
2012-03-17 15:36:13 +00:00
|
|
|
"CFLAGS=#{ENV.cflags}",
|
2012-02-13 04:13:38 +00:00
|
|
|
"LIBS=-lreadline",
|
|
|
|
"BINDIR=#{bin}",
|
|
|
|
"MANDIR=#{man1}",
|
|
|
|
"install"
|
2011-01-06 13:45:40 +00:00
|
|
|
end
|
2014-02-05 00:11:37 +00:00
|
|
|
|
|
|
|
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
|
2014-02-05 00:11:37 +00:00
|
|
|
end
|
2011-01-06 13:45:40 +00:00
|
|
|
end
|