2012-02-04 06:27:21 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Pmdmini < Formula
|
|
|
|
homepage 'https://github.com/BouKiCHi/mdxplayer'
|
2012-02-21 06:04:21 +00:00
|
|
|
url 'https://github.com/BouKiCHi/mdxplayer/tarball/aa55d9d3128f06aac4a15d5cefc083bd7b66d814'
|
2012-02-04 06:27:21 +00:00
|
|
|
version '20120115'
|
2012-02-21 06:04:21 +00:00
|
|
|
md5 '7d8152d5b59bfc2b535972fe6b5096b4'
|
2012-02-04 06:27:21 +00:00
|
|
|
|
|
|
|
depends_on 'sdl' unless ARGV.include? "--lib-only"
|
|
|
|
|
|
|
|
def options
|
2012-02-21 06:04:21 +00:00
|
|
|
[["--lib-only", "Do not build commandline player"]]
|
2012-02-04 06:27:21 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
2012-02-21 06:04:21 +00:00
|
|
|
cd "jni/pmdmini" do
|
|
|
|
# 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
|
2012-02-04 06:27:21 +00:00
|
|
|
|
2012-02-21 06:04:21 +00:00
|
|
|
# Makefile doesn't build a dylib
|
|
|
|
system "#{ENV.cc} -dynamiclib -install_name #{lib}/libpmdmini.dylib -o libpmdmini.dylib -undefined dynamic_lookup obj/*.o"
|
2012-02-04 06:27:21 +00:00
|
|
|
|
2012-02-21 06:04:21 +00:00
|
|
|
bin.install "pmdplay" unless ARGV.include? '--lib-only'
|
|
|
|
lib.install "libpmdmini.a", "libpmdmini.dylib"
|
|
|
|
(include+'libpmdmini').install Dir['src/*.h']
|
|
|
|
(include+'libpmdmini/pmdwin').install Dir['src/pmdwin/*.h']
|
|
|
|
end
|
2012-02-04 06:27:21 +00:00
|
|
|
end
|
|
|
|
end
|