2011-03-26 15:49:34 +00:00
|
|
|
class Audiofile < Formula
|
2015-01-03 16:29:23 +00:00
|
|
|
homepage "http://www.68k.org/~michael/audiofile/"
|
|
|
|
url "http://audiofile.68k.org/audiofile-0.3.6.tar.gz"
|
|
|
|
sha1 "3aba3ef724b1b5f88cfc20ab9f8ce098e6c35a0e"
|
|
|
|
|
|
|
|
head do
|
|
|
|
url "https://github.com/mpruett/audiofile.git"
|
|
|
|
depends_on "asciidoc" => :build
|
|
|
|
depends_on "autoconf" => :build
|
|
|
|
depends_on "automake" => :build
|
|
|
|
depends_on "libtool" => :build
|
|
|
|
end
|
2011-09-14 21:21:08 +00:00
|
|
|
|
2015-01-03 16:29:23 +00:00
|
|
|
option "with-lcov", "Enable Code Coverage support using lcov"
|
|
|
|
option "with-check", "Run the test suite during install ~30sec"
|
2011-09-14 21:21:08 +00:00
|
|
|
|
2015-01-03 16:29:23 +00:00
|
|
|
depends_on "lcov" => :optional
|
2010-11-09 10:31:21 +00:00
|
|
|
|
|
|
|
def install
|
2015-01-03 16:29:23 +00:00
|
|
|
if build.head?
|
|
|
|
inreplace "autogen.sh", "libtool", "glibtool"
|
|
|
|
ENV["XML_CATALOG_FILES"] = "#{HOMEBREW_PREFIX}/etc/xml/catalog"
|
|
|
|
end
|
|
|
|
|
|
|
|
configure = build.head? ? "./autogen.sh" : "./configure"
|
2012-07-30 21:05:34 +00:00
|
|
|
args = ["--disable-dependency-tracking", "--prefix=#{prefix}"]
|
2015-01-03 16:29:23 +00:00
|
|
|
args << "--enable-coverage" if build.with? "lcov"
|
|
|
|
system configure, *args
|
2011-09-14 21:21:08 +00:00
|
|
|
system "make"
|
2015-01-03 16:29:23 +00:00
|
|
|
system "make", "check" if build.with? "check"
|
|
|
|
system "make", "install"
|
2010-11-09 10:31:21 +00:00
|
|
|
end
|
2011-09-14 21:21:08 +00:00
|
|
|
|
2013-02-02 05:12:30 +00:00
|
|
|
test do
|
2015-01-03 16:29:23 +00:00
|
|
|
inn = "/System/Library/Sounds/Glass.aiff"
|
|
|
|
out = "Glass.wav"
|
2012-05-06 06:02:49 +00:00
|
|
|
conv_bin = "#{bin}/sfconvert"
|
|
|
|
info_bin = "#{bin}/sfinfo"
|
2011-09-14 21:21:08 +00:00
|
|
|
|
2012-09-02 07:50:20 +00:00
|
|
|
unless File.exist?(conv_bin) and File.exist?(inn) and File.exist?(info_bin)
|
2011-09-14 21:21:08 +00:00
|
|
|
opoo <<-EOS.undent
|
2012-05-06 06:03:01 +00:00
|
|
|
One of the following files could not be located, and so
|
|
|
|
the test was not executed:
|
2011-09-14 21:21:08 +00:00
|
|
|
#{inn}
|
2012-02-05 18:17:04 +00:00
|
|
|
#{conv_bin}
|
|
|
|
#{info_bin}
|
2011-09-14 21:21:08 +00:00
|
|
|
|
2012-05-06 06:03:01 +00:00
|
|
|
Audiofile can also be tested at build-time:
|
|
|
|
brew install -v audiofile --with-check
|
2011-09-14 21:21:08 +00:00
|
|
|
EOS
|
2012-02-05 18:17:04 +00:00
|
|
|
return
|
|
|
|
end
|
|
|
|
|
2015-01-03 16:29:23 +00:00
|
|
|
system conv_bin, inn, out, "format", "wave"
|
|
|
|
system info_bin, "--short", "--reporterror", out
|
2012-02-05 18:17:04 +00:00
|
|
|
end
|
2010-11-09 10:31:21 +00:00
|
|
|
end
|