Skip to content
This repository
Browse code

git: use options DSL

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
  • Loading branch information...
commit 783019d02f8aa581d11e79fe99aa7e8952dcbceb 1 parent 1554831
Jack Nagel authored August 12, 2012

Showing 1 changed file with 5 additions and 9 deletions. Show diff stats Hide diff stats

  1. 14  Library/Formula/git.rb
14  Library/Formula/git.rb
@@ -17,14 +17,10 @@ class Git < Formula
17 17
 
18 18
   head 'https://github.com/git/git.git'
19 19
 
20  
-  depends_on 'pcre' if ARGV.include? '--with-pcre'
  20
+  depends_on 'pcre' if build.include? 'with-pcre'
21 21
 
22  
-  def options
23  
-    [
24  
-      ['--with-blk-sha1', 'compile with the optimized SHA1 implementation'],
25  
-      ['--with-pcre', 'compile with the PCRE library'],
26  
-    ]
27  
-  end
  22
+  option 'with-blk-sha1', 'Compile with the block-optimized SHA1 implementation'
  23
+  option 'with-pcre', 'Compile with the PCRE library'
28 24
 
29 25
   def install
30 26
     # If these things are installed, tell Git build system to not use them
@@ -39,9 +35,9 @@ def install
39 35
     # Clean XCode 4.x installs don't include Perl MakeMaker
40 36
     ENV['NO_PERL_MAKEMAKER'] = '1' if MacOS.lion?
41 37
 
42  
-    ENV['BLK_SHA1'] = '1' if ARGV.include? '--with-blk-sha1'
  38
+    ENV['BLK_SHA1'] = '1' if build.include? 'with-blk-sha1'
43 39
 
44  
-    if ARGV.include? '--with-pcre'
  40
+    if build.include? 'with-pcre'
45 41
       ENV['USE_LIBPCRE'] = '1'
46 42
       ENV['LIBPCREDIR'] = HOMEBREW_PREFIX
47 43
     end

0 notes on commit 783019d

Please sign in to comment.
Something went wrong with that request. Please try again.