diff options
| author | Adam Vandenberg | 2012-08-26 22:20:50 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2012-08-26 22:20:50 -0700 |
| commit | 2e9e49cd57b15e4bd6771788428f69f225481426 (patch) | |
| tree | 2afc7b1495ed738c874813e6c8789963ad854816 /Library/Formula | |
| parent | 7f4a88736aceb9a805ece3f08bf7e777cbcdf09e (diff) | |
| download | homebrew-2e9e49cd57b15e4bd6771788428f69f225481426.tar.bz2 | |
cppcheck: use new dsl
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/cppcheck.rb | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/Library/Formula/cppcheck.rb b/Library/Formula/cppcheck.rb index 4ed352bf4..b50704b9e 100644 --- a/Library/Formula/cppcheck.rb +++ b/Library/Formula/cppcheck.rb @@ -7,15 +7,11 @@ class Cppcheck < Formula head 'https://github.com/danmar/cppcheck.git' - 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 + option 'no-rules', "Build without rules (no pcre dependency)" + option 'with-gui', "Build the cppcheck gui (requires Qt)" + + depends_on 'pcre' unless build.include? 'no-rules' + depends_on 'qt' if build.include? 'with-gui' # Do not strip binaries, or else it fails to run. skip_clean :all @@ -24,7 +20,7 @@ class Cppcheck < Formula # Man pages aren't installed as they require docbook schemas. # Pass to make variables. - if ARGV.include? '--no-rules' + if build.include? 'no-rules' system "make", "HAVE_RULES=no" else system "make" @@ -32,9 +28,9 @@ class Cppcheck < Formula system "make", "DESTDIR=#{prefix}", "BIN=#{bin}", "install" - if ARGV.include? '--with-gui' + if build.include? 'with-gui' cd "gui" do - if ARGV.include? '--no-rules' + if build.include? 'no-rules' system "qmake", "HAVE_RULES=no" else system "qmake" |
