From 32340aee146de5dbb1b0f1173c73f8c96a3202fe Mon Sep 17 00:00:00 2001 From: complex Date: Sat, 18 Dec 2010 00:29:11 +0900 Subject: [PATCH] create Formula for Bullet 2.77 Signed-off-by: Mike McQuaid --- Formula/bullet.rb | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 Formula/bullet.rb diff --git a/Formula/bullet.rb b/Formula/bullet.rb new file mode 100644 index 0000000000..ff1b257454 --- /dev/null +++ b/Formula/bullet.rb @@ -0,0 +1,43 @@ +require 'formula' + +class Bullet :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