openimageio: use new dsl

master
Adam Vandenberg 2012-08-27 21:54:32 -07:00
parent fbc945bc47
commit 9b212ba5d5
1 changed files with 5 additions and 9 deletions

View File

@ -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'