class Povray < Formula desc "Persistence Of Vision RAYtracer (POVRAY)" homepage "https://www.povray.org/" url "https://github.com/POV-Ray/povray/archive/v3.7.0.10.tar.gz" sha256 "7bee83d9296b98b7956eb94210cf30aa5c1bbeada8ef6b93bb52228bbc83abff" license "AGPL-3.0-or-later" revision 3 head "https://github.com/POV-Ray/povray.git", branch: "master" livecheck do url :stable regex(/^v?(\d+(?:\.\d+)+\.\d{1,4})$/i) end bottle do sha256 arm64_monterey: "e6ac3d85cc880f470d6e3d45b8b7c099bfb15a8ab8439bd167711d42b894e8a5" sha256 arm64_big_sur: "dd7219c0a8f537891038b8efbaf0182a2507955c67bc293d8006d306abc12022" sha256 monterey: "4d74fda4ef144bed539f6313c4f66bc0610aca47ff7318ddda5340b31321773f" sha256 big_sur: "54e70887d429f4ce6befb0838e3a6695c4b2f8a4f68a012c36526a05b2556f6f" sha256 catalina: "437e0a054b986e806c551988735fef73e7b2679d88792519dc1d90597bfa4553" sha256 x86_64_linux: "0c53bfc03f7cbabc4168461a5a3eacc739c63161186d6c9753ccd468692735d8" end depends_on "autoconf" => :build depends_on "automake" => :build depends_on "boost" depends_on "imath" depends_on "jpeg-turbo" depends_on "libpng" depends_on "libtiff" depends_on "openexr" def install ENV.cxx11 args = %W[ COMPILED_BY=homebrew --disable-debug --disable-dependency-tracking --prefix=#{prefix} --mandir=#{man} --with-boost=#{Formula["boost"].opt_prefix} --with-openexr=#{Formula["openexr"].opt_prefix} --without-libsdl --without-x ] # 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