diff options
| author | Nibbles McGurk | 2011-09-14 14:21:08 -0700 |
|---|---|---|
| committer | Charlie Sharpsteen | 2011-09-23 19:17:26 -0700 |
| commit | d05616a90de61a6bc19c56c4e543083a060a55ad (patch) | |
| tree | 5f49ff3a93f4c9c5ed30aeb52f728fff68bfc4de /Library/Formula | |
| parent | e12bcee54160319ee86a41eadb24fef95fcafab4 (diff) | |
| download | homebrew-d05616a90de61a6bc19c56c4e543083a060a55ad.tar.bz2 | |
audiofile: Update to 0.3.1
This is an update for audiofile including a new option to enable Code Coverage
support using lcov. There will be a depends_on lcov => :build if the user enables
the new option. I also added a new option to check the build with make check and a
def test function. There was a compile time option to --enable-valgrind support,
a memory leak testing suite, but homebrewed valgrind fails it's own make check atm.
This update was tested on 10.6.8 x86_64 using 2335, gcc-4.2.1, and clang. It builds
both static and shared libs for your native architecture.
Closes #7635.
Signed-off-by: Charlie Sharpsteen <source@sharpsteen.net>
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/audiofile.rb | 60 |
1 files changed, 56 insertions, 4 deletions
diff --git a/Library/Formula/audiofile.rb b/Library/Formula/audiofile.rb index bc4824ea1..7383fa4fa 100644 --- a/Library/Formula/audiofile.rb +++ b/Library/Formula/audiofile.rb @@ -1,13 +1,65 @@ require 'formula' class Audiofile < Formula - url 'http://ftp.gnome.org/pub/gnome/sources/audiofile/0.2/audiofile-0.2.7.tar.gz' + url 'https://github.com/downloads/mpruett/audiofile/audiofile-0.3.1.tar.gz' + sha1 '39de137a691a7c12ea5dc468566eb7a146880ac3' homepage 'http://www.68k.org/~michael/audiofile/' - md5 'a39be317a7b1971b408805dc5e371862' + + depends_on 'lcov' if ARGV.include? '--with-lcov' + +# Builds with all 3 compilers. Cheers Clang! + + def options + [ + ['--with-lcov', 'Enable Code Coverage support using lcov.'], + ['--with-check', 'Run the test suite during install ~30sec'] + ] + end def install - system "./configure", "--disable-debug", "--disable-dependency-tracking", - "--prefix=#{prefix}" + args = ["--prefix=#{prefix}", "--disable-dependency-tracking"] + args << '--enable-coverage' if ARGV.include? '--with-lcov' + system "./configure", *args + system "make" + system "make check" if ARGV.include? '--with-check' system "make install" end + + def test + inn = '/System/Library/Sounds/Glass.aiff' + out = 'Glass.wav' + hear = '/usr/bin/qlmanage' + conv = "#{HOMEBREW_PREFIX}/bin/sfconvert" + info = "#{HOMEBREW_PREFIX}/bin/sfinfo" + + puts '' + if File.exist?("#{conv}") and File.exist?("#{inn}") and + File.exist?("#{hear}") and File.exist?("#{info}") + mktemp do + system "#{conv} #{inn} #{out} format wave" + system "#{info} --short --reporterror #{out}" + system "#{hear} -p #{out}" if ARGV.verbose? + puts '' + oh1 <<-EOS.undent + Cheers mate. You converted a system sound from the Audio + Interchange File Format \"aiff\" to the MS RIFF Wave format. + + EOS + end + else + opoo <<-EOS.undent + The test program couldn't locate one of these files that normally exist: + #{inn} + #{conv} + #{info} + #{hear} + We are sorry for the mistake. Another test you can run on this software + will occur during install if you add --with-check like this: + + EOS + oh1 ' brew rm audiofile' + oh1 ' brew -v install audiofile --with-check' + puts '' + end # if-else + end # def test end |
