Permalink
Browse files

povray 3.7.0.RC6

The previous version of povray (3.6.1) would not compile with recent versions of libpng. This beta version does compile with recent versions of libpng.

Almost all changes to this formula come from studying the [povray portfile][1] from MacPorts and reading [a bug report][2] about how they solved the same problem.

Note: povray now requires at least Lion to compile.

[1]: https://svn.macports.org/repository/macports/trunk/dports/graphics/povray/Portfile "MacPorts POV-Ray portfile"
[2]: https://trac.macports.org/ticket/35949 "MacPorts Ticket 35949"
  • Loading branch information...
1 parent 6fea940 commit caa7a4ec5782958656f6f5a1bac8cb2b25505c84 @royhodgman committed Sep 25, 2012
Showing with 50 additions and 17 deletions.
  1. +50 −17 Library/Formula/povray.rb
View
@@ -1,37 +1,70 @@
require 'formula'
+class NeedsLion < Requirement
+ def satisfied?
+ MacOS.version >= :lion
+ end
+ def message
+ "PovRay 3.7.0.RC6 requires Mac OS X 10.7 or newer"
+ end
+ def fatal?
+ true
+ end
+end
+
class Povray < Formula
- url 'http://www.povray.org/ftp/pub/povray/Official/Unix/povray-3.6.1.tar.bz2'
homepage 'http://www.povray.org/'
- sha1 '1fab3ccbdedafbf77e3a66087709bbdf60bc643d'
+ url 'http://www.povray.org/beta/source/povray-3.7.0.RC6.tar.gz'
+ sha256 '374957bdb90fb7be5f36f839b3f04ab0a4340f6e8cf369f658d6592a342803e3'
+ version '3.7.0.RC6'
- depends_on 'libtiff' => :optional
- depends_on 'jpeg' => :optional
+ option 'use-openexr', 'Compile with OpenEXR support.'
+ option 'use-zlib', 'Compile with zlib support.'
- # TODO give this a build number (2326?)
- fails_with :llvm do
- cause "povray fails with 'terminate called after throwing an instance of int'"
- end if MacOS.version == :leopard
+ depends_on NeedsLion.new
+ depends_on 'boost'
+ depends_on 'jpeg'
+ depends_on 'libpng'
+ depends_on 'libtiff'
+ depends_on 'openexr' => :optional if build.include? 'use-openexr'
def patches
- # povray has issues determining libpng version; can't get it to compile
- # against system libpng, but it works with its internal libpng.
- # Look at this again on the next povray version bump!
- {:p0 => "https://trac.macports.org/export/97719/trunk/dports/graphics/povray/files/patch-configure"}
+ {:p0 => [
+ "http://svn.macports.org/repository/macports/trunk/dports/graphics/povray/files/patch-boost-1.50.diff",
+ "http://svn.macports.org/repository/macports/trunk/dports/graphics/povray/files/patch-configure-stat.diff",
+ "http://svn.macports.org/repository/macports/trunk/dports/graphics/povray/files/patch-lseek64.diff",
+ "http://svn.macports.org/repository/macports/trunk/dports/graphics/povray/files/patch-vfe-uint.diff"
+ ]}
+
end
def install
- system "./configure", "--disable-debug", "--disable-dependency-tracking",
- "COMPILED_BY=homebrew",
- "--prefix=#{prefix}",
- "--mandir=#{man}"
+
+ # while this is RC6, the code still says RC5, so update to reflect that
+ inreplace [ 'VERSION', 'configure' ], '3.7.0.RC5', '3.7.0.RC6'
+
+ # include the boost system library to resolve compilation conflicts
+ ENV["LIBS"] = "-lboost_system-mt"
+
+ args = [
+ "COMPILED_BY=homebrew",
+ "--disable-debug",
+ "--disable-dependency-tracking",
+ "--prefix=#{prefix}",
+ "--mandir=#{man}",
+ ]
+
+ args << "--with-openexr=${HOMEBREW_PREFIX}" if build.include? "use-openexr"
+ args << "--with-zlib=${HOMEBREW_PREFIX}" if build.include? "use-zlib"
+
+ system "./configure", *args
system "make install"
end
def test
ohai "Rendering all test scenes; this may take a while"
mktemp do
- system "#{share}/povray-3.6/scripts/allscene.sh", "-o", "."
+ system "#{share}/povray-3.7.0.RC6/scripts/allscene.sh", "-o", "."
end
end
end

0 comments on commit caa7a4e

Please sign in to comment.