7bd947eb0b
* Use new "url" features * Use keg_only DSL * Use "skip_clean :all" DSL * Whitespace and style cleanups * Make bash invocations less silly * Use new man2-man8 helpers * Remove "FileUtils." since it is included in Formula * Use real names for deps instead of aliases * ENV.x11 now updates path, so remove that from individual brews
40 lines
1.2 KiB
Ruby
40 lines
1.2 KiB
Ruby
require 'formula'
|
|
|
|
class Mpg123 <Formula
|
|
url 'http://downloads.sourceforge.net/project/mpg123/mpg123/1.12.1/mpg123-1.12.1.tar.bz2'
|
|
homepage 'http://www.mpg123.de/'
|
|
md5 'e7d810a75d22954169f1530a436aca4c'
|
|
|
|
def skip_clean? path
|
|
# mpg123 can't find its plugins if there are no la files
|
|
path.extname == '.la'
|
|
end
|
|
|
|
def install
|
|
args = ["--disable-debug", "--disable-dependency-tracking",
|
|
"--with-optimization=4",
|
|
"--prefix=#{prefix}",
|
|
"--with-audio=coreaudio",
|
|
"--with-default-audio=coreaudio"]
|
|
|
|
# Don't build 64-bit on Leopard
|
|
if MACOS_VERSION >= 10.6 and Hardware.is_64_bit?
|
|
args << "--with-cpu=x86-64"
|
|
else
|
|
# there are no Intel Mac computers without SSE
|
|
args << "--with-cpu=sse_alone"
|
|
end
|
|
|
|
system "./configure", *args
|
|
|
|
# ./configure incorrectly detects 10.5 as 10.4. Cut that crap out.
|
|
['.', 'src', 'src/output', 'src/libmpg123'].each do |path|
|
|
inreplace "#{path}/Makefile" do |s|
|
|
s.gsub! "-mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk", ""
|
|
s.change_make_var! "LDFLAGS", "-Wl,-read_only_relocs,suppress"
|
|
end
|
|
end
|
|
|
|
system "make install"
|
|
end
|
|
end
|