diff options
| author | complex | 2010-12-18 00:29:11 +0900 |
|---|---|---|
| committer | Mike McQuaid | 2010-12-23 20:48:40 +0000 |
| commit | 74b775aca9974b172079854ed5e771ac8a0ff424 (patch) | |
| tree | e928a585dd2bce9aa68d744e2c32c6b82f9b775c /Library/Formula/bullet.rb | |
| parent | 8fe141c9a4c347d6c13971740f28c4581e03624b (diff) | |
| download | homebrew-74b775aca9974b172079854ed5e771ac8a0ff424.tar.bz2 | |
create Formula for Bullet 2.77
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Formula/bullet.rb')
| -rw-r--r-- | Library/Formula/bullet.rb | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/Library/Formula/bullet.rb b/Library/Formula/bullet.rb new file mode 100644 index 000000000..ff1b25745 --- /dev/null +++ b/Library/Formula/bullet.rb @@ -0,0 +1,43 @@ +require 'formula' + +class Bullet <Formula + url 'http://bullet.googlecode.com/files/bullet-2.77.tgz' + homepage 'http://bulletphysics.org/wordpress/' + md5 '2f5074a1a29b618c672f1da4748e374b' + + depends_on 'cmake' => :build + + def options + [ + ['--framework' , "Build Frameworks"], + ['--universal' , "Build in universal mode"], + ['--shared' , "Build shared libraries"], + ['--build-demo' , "Build demo application"], + ['--build-extra', "Build extra library"] + ] + end + + def install + args = [] + + if ARGV.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 << "-DCMAKE_INSTALL_PREFIX=#{prefix}" + end + + args << "-DCMAKE_OSX_ARCHITECTURES='i386;x86_64'" if ARGV.include? "--universal" + args << "-DBUILD_DEMOS=OFF" if not ARGV.include? "--build-demo" + args << "-DBUILD_EXTRAS=OFF" if not ARGV.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" + end +end |
