2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-08-07 14:16:18 +00:00
|
|
|
|
|
|
|
class Mpg123 <Formula
|
2009-12-03 19:58:25 +00:00
|
|
|
url 'http://downloads.sourceforge.net/project/mpg123/mpg123/1.9.2/mpg123-1.9.2.tar.bz2'
|
2009-11-16 18:41:22 +00:00
|
|
|
homepage 'http://www.mpg123.de/'
|
2009-12-03 19:58:25 +00:00
|
|
|
md5 '5313b1bcc0274b4d7c394397c205bb20'
|
2009-08-07 14:16:18 +00:00
|
|
|
|
|
|
|
def skip_clean? path
|
|
|
|
# mpg123 can't find its plugins if there are no la files
|
|
|
|
path.extname == '.la'
|
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
2009-11-16 18:41:22 +00:00
|
|
|
args = ["--disable-debug", "--disable-dependency-tracking",
|
|
|
|
"--with-optimization=4",
|
|
|
|
"--prefix=#{prefix}",
|
|
|
|
"--with-audio=coreaudio",
|
|
|
|
"--with-default-audio=coreaudio"]
|
2009-10-04 17:49:29 +00:00
|
|
|
|
2009-12-04 10:37:09 +00:00
|
|
|
if Hardware.is_64_bit?
|
|
|
|
# adamv got compile failure for these conditions
|
|
|
|
args << "--with-cpu=x86-64" unless MACOS_VERSION == 10.5 and Hardware.intel_family == :nehalem
|
|
|
|
else
|
|
|
|
# there are no Intel Mac computers without SSE
|
|
|
|
args << "--with-cpu=sse_alone"
|
|
|
|
end
|
2009-10-04 17:49:29 +00:00
|
|
|
|
|
|
|
system "./configure", *args
|
2009-11-16 18:41:22 +00:00
|
|
|
|
2009-12-04 10:37:09 +00:00
|
|
|
# ./configure incorrectly detects 10.5 as 10.4. Cut that crap out.
|
2009-11-16 18:41:22 +00:00
|
|
|
['', 'src/', 'src/output/', 'src/libmpg123/'].each do |path|
|
|
|
|
inreplace "#{path}Makefile", # CFLAGS
|
|
|
|
"-mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk", ""
|
|
|
|
|
|
|
|
inreplace "#{path}Makefile", # LDFLAGS
|
|
|
|
"LDFLAGS = -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -Wl,-classic_linker -Wl,-read_only_relocs,suppress",
|
|
|
|
"LDFLAGS = -Wl,-read_only_relocs,suppress"
|
|
|
|
end
|
|
|
|
|
2009-08-07 14:16:18 +00:00
|
|
|
system "make install"
|
|
|
|
end
|
2009-11-05 11:10:28 +00:00
|
|
|
end
|