homebrew-core/Formula/audiofile.rb

46 lines
1.3 KiB
Ruby
Raw Normal View History

require 'formula'
2011-03-26 15:49:34 +00:00
class Audiofile < Formula
homepage 'http://www.68k.org/~michael/audiofile/'
url 'http://audiofile.68k.org/audiofile-0.3.6.tar.gz'
sha1 '3aba3ef724b1b5f88cfc20ab9f8ce098e6c35a0e'
2013-02-02 22:26:37 +00:00
option 'with-lcov', 'Enable Code Coverage support using lcov'
2012-07-30 21:05:34 +00:00
option 'with-check', 'Run the test suite during install ~30sec'
2013-02-02 22:26:37 +00:00
depends_on 'lcov' => :optional
def install
2012-07-30 21:05:34 +00:00
args = ["--disable-dependency-tracking", "--prefix=#{prefix}"]
2013-02-02 22:26:37 +00:00
args << '--enable-coverage' if build.with? 'lcov'
system "./configure", *args
system "make"
2013-02-02 22:26:37 +00:00
system "make check" if build.with? 'check'
system "make install"
end
2013-02-02 05:12:30 +00:00
test do
inn = '/System/Library/Sounds/Glass.aiff'
out = 'Glass.wav'
conv_bin = "#{bin}/sfconvert"
info_bin = "#{bin}/sfinfo"
2012-09-02 07:50:20 +00:00
unless File.exist?(conv_bin) and File.exist?(inn) and File.exist?(info_bin)
opoo <<-EOS.undent
One of the following files could not be located, and so
the test was not executed:
#{inn}
#{conv_bin}
#{info_bin}
Audiofile can also be tested at build-time:
brew install -v audiofile --with-check
EOS
return
end
2013-02-02 05:12:30 +00:00
system conv_bin, inn, out, 'format', 'wave'
system info_bin, '--short', '--reporterror', out
end
end