diff options
| author | Adam Vandenberg | 2012-08-08 22:30:34 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2012-08-08 22:30:34 -0700 |
| commit | 174dcb5ba729f0641951b8723897373377ffbb33 (patch) | |
| tree | 28d969a9517067ce8045d9e5ebae66bde46f743f /Library | |
| parent | 3fa24bf75ca977a2601780c0783e72bd1f8a356b (diff) | |
| download | homebrew-174dcb5ba729f0641951b8723897373377ffbb33.tar.bz2 | |
bullet: use options dsl
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/bullet.rb | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/Library/Formula/bullet.rb b/Library/Formula/bullet.rb index 9ef8f2e83..854debd43 100644 --- a/Library/Formula/bullet.rb +++ b/Library/Formula/bullet.rb @@ -9,37 +9,33 @@ class Bullet < Formula depends_on 'cmake' => :build - def options - [ - ['--framework' , "Build Frameworks"], - ['--universal' , "Build in universal mode"], - ['--shared' , "Build shared libraries"], - ['--build-demo' , "Build demo applications"], - ['--build-extra', "Build extra library"] - ] - end + option :universal + option 'framework', 'Build Frameworks' + option 'shared', 'Build shared libraries' + option 'build-demo', 'Build demo applications' + opiton 'build-extra', 'Build extra library' def install args = [] - if ARGV.include? "--framework" + if build.include? "--framework" args << "-DBUILD_SHARED_LIBS=ON" << "-DFRAMEWORK=ON" args << "-DCMAKE_INSTALL_PREFIX=#{prefix}/Frameworks" args << "-DCMAKE_INSTALL_NAME_DIR=#{prefix}/Frameworks" else - args << "-DBUILD_SHARED_LIBS=ON" if ARGV.include? "--shared" + args << "-DBUILD_SHARED_LIBS=ON" if build.include? "--shared" args << "-DCMAKE_INSTALL_PREFIX=#{prefix}" end - args << "-DCMAKE_OSX_ARCHITECTURES='i386;x86_64'" if ARGV.build_universal? - args << "-DBUILD_DEMOS=OFF" if not ARGV.include? "--build-demo" - args << "-DBUILD_EXTRAS=OFF" if not ARGV.include? "--build-extra" + args << "-DCMAKE_OSX_ARCHITECTURES='i386;x86_64'" if build.universal? + args << "-DBUILD_DEMOS=OFF" if not build.include? "--build-demo" + args << "-DBUILD_EXTRAS=OFF" if not build.include? "--build-extra" system "cmake", *args system "make" system "make install" - prefix.install 'Demos' if ARGV.include? "--build-demo" - prefix.install 'Extras' if ARGV.include? "--build-extra" + prefix.install 'Demos' if build.include? "--build-demo" + prefix.install 'Extras' if build.include? "--build-extra" end end |
