diff options
| author | Thomas Børlum | 2010-06-13 03:21:17 +0200 |
|---|---|---|
| committer | Adam Vandenberg | 2010-06-17 13:11:07 -0700 |
| commit | 1996d699c1a6f4b5f9df708c260084de2faa35c5 (patch) | |
| tree | 019598cdc36b73d8502f7227240f063684ce9f12 | |
| parent | 2c8a24b87fb473bbd23510dde2a464f59803b946 (diff) | |
| download | homebrew-1996d699c1a6f4b5f9df708c260084de2faa35c5.tar.bz2 | |
Add PBRT formula
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
| -rw-r--r-- | Library/Formula/pbrt.rb | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/Library/Formula/pbrt.rb b/Library/Formula/pbrt.rb new file mode 100644 index 000000000..115d013c0 --- /dev/null +++ b/Library/Formula/pbrt.rb @@ -0,0 +1,42 @@ +require 'formula' + +class Pbrt <Formula + head 'git://github.com/mmp/pbrt-v2.git' + homepage 'http://www.pbrt.org/' + + depends_on 'openexr' + depends_on 'libtiff' + depends_on 'ilmbase' + + def install + # Configure the Makefile + inreplace 'src/Makefile' do |contents| + openexr = Formula.factory('openexr') + libtiff = Formula.factory('libtiff') + ilmbase = Formula.factory('ilmbase') + + # Enable Tiff support + contents.change_make_var! "HAVE_LIBTIFF", "1" + + # Set LibTiff path + contents.change_make_var! "TIFF_INCLUDES", "-I#{libtiff.include}" + contents.change_make_var! "TIFF_LIBDIR", "-L#{libtiff.lib}" + + # Set OpenEXR path + contents.change_make_var! "EXR_INCLUDES", "-I#{openexr.include}/OpenEXR -I#{ilmbase.include}/OpenEXR" + contents.change_make_var! "EXR_LIBDIR", "-L#{openexr.lib} -L#{ilmbase.lib}" + + # Change settings if we are using a 32bit system + if MACOS_VERSION <= 10.5 or not Hardware.is_64_bit? + contents.change_make_var! "MARCH", "-m32 -msse2 -mfpmath=sse" + end + end + + # Build and install + system "make -C src" + bin.install Dir['src/bin/*'] + + # Copy resources + prefix.install %w(dtrace exporters scenes) + end +end |
