homebrew-core/Formula/mad.rb
Adam Vandenberg 576185d345 Define "snow_leopard_64?"
snow_leopard_64? (defined in Hardware) is a short-cut for:
  MACOS_VERSION >= 10.6 and Hardware.is_64_bit?

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2010-08-22 20:11:03 -07:00

39 lines
942 B
Ruby

require 'formula'
class Mad <Formula
homepage 'http://www.underbit.com/products/mad/'
url 'http://downloads.sourceforge.net/project/mad/libmad/0.15.1b/libmad-0.15.1b.tar.gz'
md5 '1be543bc30c56fb6bea1d7bf6a64e66c'
def mad_pc
return <<-EOS
prefix=#{HOMEBREW_PREFIX}
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: mad
Description: MPEG Audio Decoder
Version: #{@version}
Requires:
Conflicts:
Libs: -L${libdir} -lmad -lm
Cflags: -I${includedir}
EOS
end
def install
fpm = snow_leopard_64? ? '64bit': 'intel'
system "./configure", "--disable-debugging", "--enable-fpm=#{fpm}", "--prefix=#{prefix}"
# See: http://github.com/mxcl/homebrew/issues/issue/1263
inreplace "Makefile" do |s|
s.change_make_var! "CFLAGS", ENV['CFLAGS']
s.change_make_var! "LDFLAGS", ENV['LDFLAGS']
end
system "make install"
(lib+'pkgconfig/mad.pc').write mad_pc
end
end