From 93bc02cf3dda92479dc35a08cf53984617074b2d Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Mon, 27 Aug 2012 21:54:32 -0700 Subject: openimageio: use new dsl --- Library/Formula/openimageio.rb | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'Library') diff --git a/Library/Formula/openimageio.rb b/Library/Formula/openimageio.rb index 9cbc872ad..2d9d2f129 100644 --- a/Library/Formula/openimageio.rb +++ b/Library/Formula/openimageio.rb @@ -41,6 +41,8 @@ class Openimageio < Formula head 'https://github.com/OpenImageIO/oiio.git' + option 'with-tests', 'Dowload 95MB of test images and verify Oiio (~2 min)' + depends_on 'cmake' => :build depends_on 'pkg-config' => :build depends_on 'opencolorio' @@ -57,15 +59,11 @@ class Openimageio < Formula depends_on 'glew' depends_on 'qt' - def options - [['--with-tests', 'Dowload 95MB of test images and verify Oiio (~2 min).']] - end - def install # Oiio is designed to have its testsuite images extracted one directory # above the source. That's not a safe place for HB. Do the opposite, # and move the entire source down into a subdirectory if --with-tests. - if ARGV.include? '--with-tests' then + if build.include? 'with-tests' then (buildpath+'localpub').install Dir['*'] chdir 'localpub' end @@ -91,11 +89,10 @@ class Openimageio < Formula end end - # Download standardized test images if the user throws --with-tests. # 90% of the images are in tarballs, so they are cached normally. # The webp and fits images are loose. Curl them each install. - if ARGV.include? '--with-tests' then + if build.include? 'with-tests' then d = buildpath mkdir d+'webp-images' do curl "http://www.gstatic.com/webp/gallery/[1-5].webp", "-O" @@ -118,10 +115,9 @@ class Openimageio < Formula OiioImages.new('oiioimages').brew { (d+'oiio-images').install Dir['*'] } end - # make is a shell wrapper for cmake crafted by the devs (who have Lion). system "make", *args - system "make test" if ARGV.include? '--with-tests' + system "make test" if build.include? 'with-tests' # There is no working make install in 1.0.2, devel or HEAD. Dir.chdir 'dist/macosx' do (lib + which_python ).install 'lib/python/site-packages' -- cgit v1.2.3