homebrew-core/Formula/povray.rb
2018-08-19 18:50:57 +02:00

66 lines
2 KiB
Ruby

class Povray < Formula
desc "Persistence Of Vision RAYtracer (POVRAY)"
homepage "http://www.povray.org/"
url "https://github.com/POV-Ray/povray/archive/v3.7.0.8.tar.gz"
sha256 "53d11ebd2972fc452af168a00eb83aefb61387662c10784e81b63e44aa575de4"
bottle do
sha256 "630bf618ea1593b3b6716092d6c77c8dd8622b9c0cd6aa22bc3c94721297b497" => :mojave
sha256 "22f13423b810e41e2de3edf4085e857e0025558e0d1c2debf1cbedef297c0736" => :high_sierra
sha256 "5eb3e95e89de4ebdfe0406344cf18435669b4983e7b08400c34ec2f079fc8c88" => :sierra
sha256 "929844ff638adfa96cb090b3de3403a4627059120ef639e0970c373c516001eb" => :el_capitan
end
depends_on :macos => :lion
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "boost"
depends_on "jpeg"
depends_on "libpng"
depends_on "libtiff"
depends_on "openexr" => :optional
deprecated_option "use-openexr" => "with-openexr"
needs :cxx11
def install
ENV.cxx11
args = %W[
COMPILED_BY=homebrew
--disable-debug
--disable-dependency-tracking
--prefix=#{prefix}
--mandir=#{man}
--with-boost=#{Formula["boost"].opt_prefix}
--without-libsdl
--without-x
]
args << "--with-openexr=#{Formula["openexr"].opt_prefix}" if build.with? "openexr"
# Adjust some scripts to search for `etc` in HOMEBREW_PREFIX.
%w[allanim allscene portfolio].each do |script|
inreplace "unix/scripts/#{script}.sh",
/^DEFAULT_DIR=.*$/, "DEFAULT_DIR=#{HOMEBREW_PREFIX}"
end
cd "unix" do
system "./prebuild.sh"
end
system "./configure", *args
system "make", "install"
end
test do
# Condensed version of `share/povray-3.7/scripts/allscene.sh` that only
# renders variants of the famous Utah teapot as a quick smoke test.
scenes = Dir["#{share}/povray-3.7/scenes/advanced/teapot/*.pov"]
assert !scenes.empty?, "Failed to find test scenes."
scenes.each do |scene|
system "#{share}/povray-3.7/scripts/render_scene.sh", ".", scene
end
end
end