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/'
|
2014-03-05 07:22:08 +00:00
|
|
|
url 'https://bullet.googlecode.com/files/bullet-2.82-r2704.tgz'
|
2013-10-30 18:23:56 +00:00
|
|
|
version '2.82'
|
|
|
|
sha1 'a0867257b9b18e9829bbeb4c6c5872a5b29d1d33'
|
2012-03-30 17:40:27 +00:00
|
|
|
head 'http://bullet.googlecode.com/svn/trunk/'
|
2010-12-17 15:29:11 +00:00
|
|
|
|
|
|
|
depends_on 'cmake' => :build
|
|
|
|
|
2012-08-09 05:30:34 +00:00
|
|
|
option :universal
|
2013-10-01 19:13:58 +00:00
|
|
|
option 'framework', 'Build Frameworks'
|
|
|
|
option 'shared', 'Build shared libraries'
|
|
|
|
option 'build-demo', 'Build demo applications'
|
|
|
|
option 'build-extra', 'Build extra library'
|
|
|
|
option 'double-precision', 'Use double precision'
|
2010-12-17 15:29:11 +00:00
|
|
|
|
|
|
|
def install
|
|
|
|
args = []
|
|
|
|
|
2012-08-09 15:51:54 +00:00
|
|
|
if build.include? "framework"
|
2010-12-17 15:29:11 +00:00
|
|
|
args << "-DBUILD_SHARED_LIBS=ON" << "-DFRAMEWORK=ON"
|
2013-05-03 16:28:45 +00:00
|
|
|
args << "-DCMAKE_INSTALL_PREFIX=#{frameworks}"
|
|
|
|
args << "-DCMAKE_INSTALL_NAME_DIR=#{frameworks}"
|
2010-12-17 15:29:11 +00:00
|
|
|
else
|
2012-08-09 15:51:54 +00:00
|
|
|
args << "-DBUILD_SHARED_LIBS=ON" if build.include? "shared"
|
2010-12-17 15:29:11 +00:00
|
|
|
args << "-DCMAKE_INSTALL_PREFIX=#{prefix}"
|
|
|
|
end
|
|
|
|
|
2013-08-02 03:51:36 +00:00
|
|
|
args << "-DCMAKE_OSX_ARCHITECTURES='#{Hardware::CPU.universal_archs.as_cmake_arch_flags}" if build.universal?
|
2013-10-01 19:13:58 +00:00
|
|
|
args << "-DUSE_DOUBLE_PRECISION=ON" if build.include? "double-precision"
|
2010-12-17 15:29:11 +00:00
|
|
|
|
2013-11-13 14:53:17 +00:00
|
|
|
args << "-DBUILD_DEMOS=OFF" unless build.include? "build-demo"
|
|
|
|
|
|
|
|
# Demos require extras, see:
|
|
|
|
# https://code.google.com/p/bullet/issues/detail?id=767&thanks=767&ts=1384333052
|
|
|
|
if build.include? "build-extra" or build.include? "build-demo"
|
|
|
|
args << "-DINSTALL_EXTRA_LIBS=ON"
|
|
|
|
else
|
|
|
|
args << "-DBUILD_EXTRAS=OFF"
|
|
|
|
end
|
|
|
|
|
2010-12-17 15:29:11 +00:00
|
|
|
system "cmake", *args
|
|
|
|
system "make"
|
|
|
|
system "make install"
|
|
|
|
|
2012-08-09 15:51:54 +00:00
|
|
|
prefix.install 'Demos' if build.include? "build-demo"
|
|
|
|
prefix.install 'Extras' if build.include? "build-extra"
|
2010-12-17 15:29:11 +00:00
|
|
|
end
|
|
|
|
end
|