2010-12-17 15:29:11 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Bullet < Formula
|
2010-12-17 15:29:11 +00:00
|
|
|
homepage 'http://bulletphysics.org/wordpress/'
|
2012-03-30 17:40:27 +00:00
|
|
|
url 'http://bullet.googlecode.com/files/bullet-2.80-rev2531.tgz'
|
|
|
|
version '2.80'
|
|
|
|
sha1 '65a7dbb852cc3b92f40d79a2a368233442747228'
|
|
|
|
head 'http://bullet.googlecode.com/svn/trunk/'
|
2010-12-17 15:29:11 +00:00
|
|
|
|
|
|
|
depends_on 'cmake' => :build
|
|
|
|
|
|
|
|
def options
|
|
|
|
[
|
|
|
|
['--framework' , "Build Frameworks"],
|
|
|
|
['--universal' , "Build in universal mode"],
|
|
|
|
['--shared' , "Build shared libraries"],
|
2011-10-12 21:16:07 +00:00
|
|
|
['--build-demo' , "Build demo applications"],
|
2010-12-17 15:29:11 +00:00
|
|
|
['--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
|
|
|
|
|
2011-04-21 16:42:27 +00:00
|
|
|
args << "-DCMAKE_OSX_ARCHITECTURES='i386;x86_64'" if ARGV.build_universal?
|
2010-12-17 15:29:11 +00:00
|
|
|
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
|