2010-06-13 01:21:17 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Pbrt < Formula
|
2010-06-13 01:21:17 +00:00
|
|
|
head 'git://github.com/mmp/pbrt-v2.git'
|
|
|
|
homepage 'http://www.pbrt.org/'
|
|
|
|
|
|
|
|
depends_on 'openexr'
|
|
|
|
depends_on 'libtiff'
|
|
|
|
depends_on 'ilmbase'
|
|
|
|
|
|
|
|
def install
|
2010-09-08 16:07:59 +00:00
|
|
|
openexr = Formula.factory('openexr')
|
|
|
|
libtiff = Formula.factory('libtiff')
|
|
|
|
ilmbase = Formula.factory('ilmbase')
|
2010-06-13 01:21:17 +00:00
|
|
|
|
2010-09-08 16:07:59 +00:00
|
|
|
# Configure the Makefile
|
|
|
|
inreplace 'src/Makefile' do |s|
|
2010-06-13 01:21:17 +00:00
|
|
|
# Enable Tiff support
|
2010-09-08 16:07:59 +00:00
|
|
|
s.change_make_var! "HAVE_LIBTIFF", "1"
|
2010-06-13 01:21:17 +00:00
|
|
|
|
|
|
|
# Set LibTiff path
|
2010-09-08 16:07:59 +00:00
|
|
|
s.change_make_var! "TIFF_INCLUDES", "-I#{libtiff.include}"
|
|
|
|
s.change_make_var! "TIFF_LIBDIR", "-L#{libtiff.lib}"
|
2010-06-13 01:21:17 +00:00
|
|
|
|
|
|
|
# Set OpenEXR path
|
2010-09-08 16:07:59 +00:00
|
|
|
s.change_make_var! "EXR_INCLUDES", "-I#{openexr.include}/OpenEXR -I#{ilmbase.include}/OpenEXR"
|
|
|
|
s.change_make_var! "EXR_LIBDIR", "-L#{openexr.lib} -L#{ilmbase.lib}"
|
2010-06-13 01:21:17 +00:00
|
|
|
|
|
|
|
# Change settings if we are using a 32bit system
|
2010-09-08 16:07:59 +00:00
|
|
|
if MACOS_VERSION < 10.6 or Hardware.is_32_bit?
|
|
|
|
s.change_make_var! "MARCH", "-m32 -msse2 -mfpmath=sse"
|
2010-06-13 01:21:17 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# Build and install
|
|
|
|
system "make -C src"
|
|
|
|
bin.install Dir['src/bin/*']
|
|
|
|
|
|
|
|
# Copy resources
|
|
|
|
prefix.install %w(dtrace exporters scenes)
|
|
|
|
end
|
|
|
|
end
|