From 5a1d58b393e060efe36089465543e32921c792e6 Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Sun, 29 May 2016 03:24:14 +0200 Subject: [PATCH] cppp 2.6 (new formula) Closes #1522. Signed-off-by: Dominyk Tiller --- Formula/cppp.rb | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Formula/cppp.rb diff --git a/Formula/cppp.rb b/Formula/cppp.rb new file mode 100644 index 00000000000..0c7f82b6dee --- /dev/null +++ b/Formula/cppp.rb @@ -0,0 +1,31 @@ +class Cppp < Formula + desc "Partial Preprocessor for C" + homepage "http://www.muppetlabs.com/~breadbox/software/cppp.html" + url "http://www.muppetlabs.com/~breadbox/pub/software/cppp-2.6.tar.gz" + sha256 "d42cd410882c3b660c77122b232f96c209026fe0a38d819c391307761e651935" + + def install + system "make" + bin.install "cppp" + end + + test do + (testpath/"hello.c").write <<-EOS.undent + /* Comments stand for code */ + #ifdef FOO + /* FOO is defined */ + # ifdef BAR + /* FOO & BAR are defined */ + # else + /* BAR is not defined */ + # endif + #else + /* FOO is not defined */ + # ifndef BAZ + /* FOO & BAZ are undefined */ + # endif + #endif + EOS + system "#{bin}/cppp", "-DFOO", "hello.c" + end +end