require 'formula' class Mpg123 = 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