aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/cppcheck.rb
diff options
context:
space:
mode:
authorJuan Sebastian Casallas2011-11-19 16:03:13 +0100
committerCharlie Sharpsteen2011-11-21 09:05:52 -0800
commite436ff32bbafac84d5bc3ca6387d06d4c8cf7062 (patch)
tree435e437e363069c32c183095157268dc745ca93d /Library/Formula/cppcheck.rb
parentdd81a2685f4faf9c19aa14e13776ded606cb4c30 (diff)
downloadhomebrew-e436ff32bbafac84d5bc3ca6387d06d4c8cf7062.tar.bz2
cppcheck: Update to 1.51
Also added options: -Updated tarball and md5 for 1.51 -Added an option to build the cppcheck qt-gui -Added an option to build without rules, in which case there's no dependency on pcre -Added caveats explaining how to link the cppcheck-gui.app in case --with-gui is used for install Closes #8683. Signed-off-by: Charlie Sharpsteen <source@sharpsteen.net>
Diffstat (limited to 'Library/Formula/cppcheck.rb')
-rw-r--r--Library/Formula/cppcheck.rb44
1 files changed, 40 insertions, 4 deletions
diff --git a/Library/Formula/cppcheck.rb b/Library/Formula/cppcheck.rb
index fe73567d5..fbff5858f 100644
--- a/Library/Formula/cppcheck.rb
+++ b/Library/Formula/cppcheck.rb
@@ -1,20 +1,56 @@
require 'formula'
class Cppcheck < Formula
- url 'http://downloads.sourceforge.net/project/cppcheck/cppcheck/1.50/cppcheck-1.50.tar.bz2'
+ url 'http://downloads.sourceforge.net/project/cppcheck/cppcheck/1.51/cppcheck-1.51.tar.bz2'
homepage 'http://sourceforge.net/apps/mediawiki/cppcheck/index.php?title=Main_Page'
- md5 '79ef3898b246ba9c143155d5ad23dbd1'
+ md5 '8349ab90472801b9d377cfabf846ca28'
head 'https://github.com/danmar/cppcheck.git'
- depends_on 'pcre'
+ depends_on 'pcre' unless ARGV.include? '--no-rules'
+ depends_on 'qt' if ARGV.include? '--with-gui'
+
+ def options
+ [
+ ['--no-rules', "Build without rules (no pcre dependency)"],
+ ['--with-gui', "Build the cppcheck gui."]
+ ]
+ end
# Do not strip binaries, or else it fails to run.
skip_clean :all
def install
# Pass to make variables.
- system "make"
+ if ARGV.include? '--no-rules'
+ system "make", "HAVE_RULES=no"
+ else
+ system "make"
+ end
+
system "make", "DESTDIR=#{prefix}", "BIN=#{bin}", "install"
+
+ if ARGV.include? '--with-gui'
+ Dir.chdir "gui"
+ if ARGV.include? '--no-rules'
+ system "qmake", "HAVE_RULES=no"
+ else
+ system "qmake"
+ end
+
+ system "make"
+ bin.install "cppcheck-gui.app"
+ end
# Man pages aren't installed, they require docbook schemas which I don't know how to install.
end
+ def caveats; <<-EOS.undent
+ --with-gui installs cppcheck-gui.app in:
+ #{bin}
+
+ To link the application to a normal Mac OS X location:
+ brew linkapps
+ or:
+ ln -s #{bin}/cppcheck-gui.app /Applications
+ EOS
+ end
+
end