From aff25ea40d2ba4bd24bd172e5d3b156098dd6935 Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Sun, 6 Nov 2011 22:04:44 -0600 Subject: [PATCH] New formula: mdxmini Closes Homebrew/homebrew#8480. Signed-off-by: Misty De Meo --- Formula/mdxmini.rb | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Formula/mdxmini.rb diff --git a/Formula/mdxmini.rb b/Formula/mdxmini.rb new file mode 100644 index 00000000000..bffe965cc79 --- /dev/null +++ b/Formula/mdxmini.rb @@ -0,0 +1,35 @@ +require 'formula' + +class Mdxmini < Formula + url 'https://github.com/BouKiCHi/mdxplayer/tarball/3e60c12666cd4fb5fe17bc0651ff883bd54644ad' + md5 '80a3f96dbe84c19bf7e2042e7b8e819a' + homepage 'http://clogging.web.fc2.com/psp/' + version '20111115' + + depends_on 'sdl' unless ARGV.include? "--lib-only" + + def options + [ + ["--lib-only", "Do not build commandline player"] + ] + end + + def install + Dir.chdir "jni/mdxmini" + # Specify Homebrew's cc + inreplace "mak/general.mak", "gcc", ENV.cc + if ARGV.include? "--lib-only" + system "make -f Makefile.lib" + else + system "make" + end + + # Makefile doesn't build a dylib + system "#{ENV.cc} -dynamiclib -install_name #{lib}/libmdxmini.dylib -o libmdxmini.dylib -undefined dynamic_lookup obj/*.o" + + bin.install "mdxplay" unless ARGV.include? "--lib-only" + lib.install "libmdxmini.a" + lib.install "libmdxmini.dylib" + (include+'libmdxmini').install Dir['src/*.h'] + end +end