Permalink
Browse files

weechat: use new dsl

  • Loading branch information...
1 parent dbf3dde commit a831e65e37ed1a8e039d2c0e73845fbee9e17808 @adamv adamv committed Aug 23, 2012
Showing with 16 additions and 20 deletions.
  1. +16 −20 Library/Formula/weechat.rb
View
@@ -8,26 +8,22 @@ class Weechat < Formula
depends_on 'cmake' => :build
depends_on 'gettext'
depends_on 'gnutls'
- depends_on 'guile' if ARGV.include? '--guile'
- depends_on 'aspell' if ARGV.include? '--aspell'
- depends_on 'lua' if ARGV.include? '--lua'
+ depends_on 'guile' => :optional if build.include? 'guile'
+ depends_on 'aspell' => :optional if build.include? 'aspell'
+ depends_on 'lua' => :optional if build.include? 'lua'
- def options
- [
- ['--lua', 'Build the lua module.'],
- ['--perl', 'Build the perl module.'],
- ['--ruby', 'Build the ruby module.'],
- ['--guile', 'Build the guile module.'],
- ['--python', 'Build the python module (requires framework Python).'],
- ['--aspell', 'Build the aspell module that checks your spelling.']
- ]
- end
+ option 'lua', 'Build the lua module'
+ option 'perl', 'Build the perl module'
+ option 'ruby', 'Build the ruby module'
+ option 'guile', 'Build the guile module'
+ option 'python', 'Build the python module (requires framework Python)'
+ option 'aspell', 'Build the aspell module that checks your spelling'
def install
# Remove all arch flags from the PERL_*FLAGS as we specify them ourselves.
# This messes up because the system perl is a fat binary with 32, 64 and PPC
# compiles, but our deps don't have that. Remove at v0.3.8, fixed in HEAD.
- archs = ['-arch ppc', '-arch i386', '-arch x86_64'].join('|')
+ archs = %W[-arch ppc -arch i386 -arch x86_64].join('|')
inreplace "src/plugins/scripts/perl/CMakeLists.txt",
'IF(PERL_FOUND)',
'IF(PERL_FOUND)' +
@@ -48,12 +44,12 @@ def install
-DPREFIX=#{prefix}
-DENABLE_GTK=OFF
]
- args << '-DENABLE_LUA=OFF' unless ARGV.include? '--lua'
- args << '-DENABLE_PERL=OFF' unless ARGV.include? '--perl'
- args << '-DENABLE_RUBY=OFF' unless ARGV.include? '--ruby'
- args << '-DENABLE_PYTHON=OFF' unless ARGV.include? '--python'
- args << '-DENABLE_ASPELL=OFF' unless ARGV.include? '--aspell'
- args << '-DENABLE_GUILE=OFF' unless ARGV.include? '--guile' and \
+ args << '-DENABLE_LUA=OFF' unless build.include? 'lua'
+ args << '-DENABLE_PERL=OFF' unless build.include? 'perl'
+ args << '-DENABLE_RUBY=OFF' unless build.include? 'ruby'
+ args << '-DENABLE_PYTHON=OFF' unless build.include? 'python'
+ args << '-DENABLE_ASPELL=OFF' unless build.include? 'aspell'
+ args << '-DENABLE_GUILE=OFF' unless build.include? 'guile' and \
Formula.factory('guile').linked_keg.exist?
args << '.'

0 comments on commit a831e65

Please sign in to comment.