2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-10-03 05:14:46 +00:00
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Abuse < Formula
|
2009-10-03 05:14:46 +00:00
|
|
|
homepage 'http://abuse.zoy.org/'
|
2012-02-11 23:41:14 +00:00
|
|
|
url 'http://abuse.zoy.org/raw-attachment/wiki/download/abuse-0.8.tar.gz'
|
2011-09-01 05:21:36 +00:00
|
|
|
head 'svn://svn.zoy.org/abuse/abuse/trunk'
|
|
|
|
md5 'ec678b8dc8d00e0382d8c805c6438489'
|
2010-04-07 05:58:35 +00:00
|
|
|
|
2010-09-19 17:21:57 +00:00
|
|
|
depends_on 'pkg-config' => :build
|
2009-10-03 05:14:46 +00:00
|
|
|
depends_on 'sdl'
|
2009-12-17 16:15:41 +00:00
|
|
|
depends_on 'libvorbis'
|
2010-04-07 05:58:35 +00:00
|
|
|
|
2011-09-01 05:21:36 +00:00
|
|
|
def startup_script; <<-EOS.undent
|
2012-02-11 23:41:14 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#{libexec}/abuse-bin -datadir "#{share}/abuse" "$@"
|
2011-09-01 05:21:36 +00:00
|
|
|
EOS
|
2009-10-03 05:14:46 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
2011-09-01 05:21:36 +00:00
|
|
|
# Add SDL.m4 to aclocal includes
|
|
|
|
inreplace 'bootstrap', 'aclocal${amvers} ${aclocalflags}',
|
|
|
|
'aclocal${amvers} ${aclocalflags} -I/usr/local/share/aclocal'
|
|
|
|
|
|
|
|
# undefined
|
|
|
|
inreplace 'src/net/fileman.cpp', 'ushort', 'unsigned short'
|
|
|
|
inreplace 'src/sdlport/setup.cpp', 'UInt8', 'uint8_t'
|
|
|
|
|
|
|
|
# Re-enable OpenGL detection
|
|
|
|
inreplace 'configure.ac',
|
|
|
|
"#error\t/* Error so the compile fails on OSX */",
|
|
|
|
'#include <OpenGL/gl.h>'
|
2009-10-03 05:14:46 +00:00
|
|
|
|
|
|
|
system "./bootstrap"
|
2010-04-07 05:58:35 +00:00
|
|
|
system "./configure", "--prefix=#{prefix}", "--disable-debug",
|
2011-09-01 05:21:36 +00:00
|
|
|
"--with-assetdir=#{share}/abuse",
|
2010-02-18 20:39:36 +00:00
|
|
|
"--disable-dependency-tracking",
|
|
|
|
"--disable-sdltest",
|
|
|
|
"--with-sdl-prefix=#{HOMEBREW_PREFIX}"
|
2010-04-07 05:58:35 +00:00
|
|
|
|
2009-10-03 05:14:46 +00:00
|
|
|
# Use Framework OpenGL, not libGl
|
2010-02-18 20:39:36 +00:00
|
|
|
%w[ . src src/imlib src/lisp src/net src/sdlport ].each do |p|
|
|
|
|
inreplace "#{p}/Makefile", '-lGL', '-framework OpenGL'
|
2009-10-03 05:14:46 +00:00
|
|
|
end
|
2010-04-07 05:58:35 +00:00
|
|
|
|
2009-10-03 05:14:46 +00:00
|
|
|
system "make"
|
2011-09-01 05:21:36 +00:00
|
|
|
|
|
|
|
bin.install 'src/abuse-tool'
|
|
|
|
libexec.install_p 'src/abuse', 'abuse-bin'
|
|
|
|
(share+'abuse').install Dir["data/*"] - %w(data/Makefile data/Makefile.am data/Makefile.in)
|
2009-10-03 05:14:46 +00:00
|
|
|
# Use a startup script to find the game data
|
|
|
|
(bin+'abuse').write startup_script
|
|
|
|
end
|
2010-04-07 05:58:35 +00:00
|
|
|
|
2011-09-01 05:21:36 +00:00
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
Game settings and saves will be written to the ~/.abuse folder.
|
|
|
|
EOS
|
2009-10-03 05:14:46 +00:00
|
|
|
end
|
|
|
|
|
2011-09-01 05:21:36 +00:00
|
|
|
def test
|
|
|
|
system("#{libexec}/abuse-bin", '--help')
|
|
|
|
end
|
|
|
|
end
|