2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-06-04 18:21:19 +00:00
|
|
|
|
|
|
|
class Mad <Formula
|
2009-10-08 22:43:50 +00:00
|
|
|
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'
|
2009-06-04 18:21:19 +00:00
|
|
|
|
2009-10-12 20:45:40 +00:00
|
|
|
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
|
|
|
|
|
2009-06-04 18:21:19 +00:00
|
|
|
def install
|
2010-08-08 04:04:37 +00:00
|
|
|
fpm = snow_leopard_64? ? '64bit': 'intel'
|
2010-07-15 08:46:52 +00:00
|
|
|
system "./configure", "--disable-debugging", "--enable-fpm=#{fpm}", "--prefix=#{prefix}"
|
|
|
|
|
2010-11-10 18:16:28 +00:00
|
|
|
# See: https://github.com/mxcl/homebrew/issues/issue/1263
|
2010-07-15 08:46:52 +00:00
|
|
|
inreplace "Makefile" do |s|
|
2010-09-06 18:48:21 +00:00
|
|
|
s.change_make_var! "CFLAGS", ENV.cflags
|
|
|
|
s.change_make_var! "LDFLAGS", ENV.ldflags
|
2010-07-09 16:02:56 +00:00
|
|
|
end
|
|
|
|
|
2009-06-04 18:21:19 +00:00
|
|
|
system "make install"
|
2009-10-12 20:45:40 +00:00
|
|
|
|
2010-06-04 18:56:52 +00:00
|
|
|
(lib+'pkgconfig/mad.pc').write mad_pc
|
2009-06-04 18:21:19 +00:00
|
|
|
end
|
2010-07-09 16:02:56 +00:00
|
|
|
end
|