2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-09-25 23:53:16 +00:00
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Xu4 < Formula
|
2012-02-21 06:04:21 +00:00
|
|
|
homepage 'http://xu4.sourceforge.net/'
|
2010-04-07 05:58:35 +00:00
|
|
|
url 'http://xu4.svn.sourceforge.net/svnroot/xu4/trunk/u4',
|
2012-02-06 23:23:04 +00:00
|
|
|
:revision => '2999'
|
|
|
|
version 'r2999'
|
2010-04-07 05:58:35 +00:00
|
|
|
|
|
|
|
head 'http://xu4.svn.sourceforge.net/svnroot/xu4/trunk/u4'
|
2010-06-06 22:50:08 +00:00
|
|
|
|
2009-09-25 23:53:16 +00:00
|
|
|
depends_on 'sdl'
|
|
|
|
depends_on 'sdl_mixer'
|
2010-06-06 22:50:08 +00:00
|
|
|
|
2009-10-04 02:05:00 +00:00
|
|
|
def patches
|
|
|
|
DATA
|
|
|
|
end
|
|
|
|
|
2009-09-25 23:53:16 +00:00
|
|
|
def install
|
2012-02-06 23:23:04 +00:00
|
|
|
ENV.x11
|
2010-06-06 22:50:08 +00:00
|
|
|
|
2010-04-07 05:58:35 +00:00
|
|
|
ultima_zips = [
|
2012-02-06 23:23:04 +00:00
|
|
|
"http://www.thatfleminggent.com/ultima/ultima4.zip",
|
|
|
|
"http://downloads.sourceforge.net/project/xu4/Ultima%204%20VGA%20Upgrade/1.3/u4upgrad.zip"
|
|
|
|
]
|
2010-06-06 22:50:08 +00:00
|
|
|
|
|
|
|
ohai "Downloading support files"
|
2012-02-06 23:23:04 +00:00
|
|
|
ultima_zips.each { |f| curl f, "-O" }
|
2010-06-06 22:50:08 +00:00
|
|
|
|
2012-02-21 06:04:21 +00:00
|
|
|
cd 'src' do
|
2010-03-02 00:24:55 +00:00
|
|
|
# Copy over SDL's ObjC main files
|
|
|
|
`cp -R #{Formula.factory('sdl').libexec}/* macosx`
|
2010-06-06 22:50:08 +00:00
|
|
|
|
2010-01-13 11:06:52 +00:00
|
|
|
inreplace "Makefile.macosx" do |s|
|
2012-02-06 23:23:04 +00:00
|
|
|
s.change_make_var! "SYSROOT", "/Developer/SDKs/MacOSX#{MACOS_VERSION}.sdk"
|
2010-03-02 00:24:55 +00:00
|
|
|
s.remove_make_var! "WHICH_ARCH"
|
2012-02-06 23:23:04 +00:00
|
|
|
s.change_make_var! "PREFIX", HOMEBREW_PREFIX
|
2010-01-13 11:06:52 +00:00
|
|
|
s.change_make_var! "BUNDLE_CONTENTS", "xu4.app/Contents"
|
2012-02-06 23:23:04 +00:00
|
|
|
s.change_make_var! "CC", ENV.cc
|
|
|
|
s.change_make_var! "CXX", ENV.cxx
|
2010-01-13 11:06:52 +00:00
|
|
|
end
|
2010-06-06 22:50:08 +00:00
|
|
|
|
2009-09-25 23:53:16 +00:00
|
|
|
system "make -f Makefile.macosx"
|
|
|
|
system "make -f Makefile.macosx install"
|
2010-06-06 22:50:08 +00:00
|
|
|
|
2009-11-22 00:11:14 +00:00
|
|
|
prefix.install "xu4.app"
|
2009-09-25 23:53:16 +00:00
|
|
|
end
|
|
|
|
end
|
2010-06-06 22:50:08 +00:00
|
|
|
|
2009-09-25 23:53:16 +00:00
|
|
|
def caveats
|
2009-11-22 00:11:14 +00:00
|
|
|
"xu4.app installed to #{prefix}"
|
2009-09-25 23:53:16 +00:00
|
|
|
end
|
|
|
|
end
|
2009-10-04 02:05:00 +00:00
|
|
|
|
|
|
|
__END__
|
|
|
|
diff --git a/src/Makefile.macosx b/src/Makefile.macosx
|
2012-02-06 23:23:04 +00:00
|
|
|
index c8e4812..1317029 100644
|
2009-10-04 02:05:00 +00:00
|
|
|
--- a/src/Makefile.macosx
|
|
|
|
+++ b/src/Makefile.macosx
|
2012-02-06 23:23:04 +00:00
|
|
|
@@ -18,15 +18,16 @@ UI=sdl
|
|
|
|
PREFIX=/usr
|
|
|
|
UILIBS=-L/Library/Frameworks \
|
2009-10-04 02:05:00 +00:00
|
|
|
-framework Cocoa \
|
|
|
|
- -framework SDL \
|
2012-02-06 23:23:04 +00:00
|
|
|
- -framework SDL_mixer \
|
|
|
|
- -framework libpng
|
|
|
|
+ -lpng \
|
2009-10-04 02:05:00 +00:00
|
|
|
+ -lSDL \
|
|
|
|
+ -lSDL_mixer
|
2012-02-06 23:23:04 +00:00
|
|
|
|
2009-10-04 02:05:00 +00:00
|
|
|
UIFLAGS=-F/Library/Frameworks \
|
|
|
|
- -I/Library/Frameworks/SDL.framework/Headers \
|
|
|
|
- -I/Library/Frameworks/SDL_mixer.framework/Headers \
|
2012-02-06 23:23:04 +00:00
|
|
|
-I/Library/Frameworks/libpng.framework/Headers \
|
|
|
|
- -I$(PREFIX)/include
|
|
|
|
+ -I$(PREFIX)/include \
|
|
|
|
+ -I$(PREFIX)/include/SDL \
|
|
|
|
+ -I/usr/include \
|
2009-10-04 02:05:00 +00:00
|
|
|
+ -I/usr/X11/include
|
|
|
|
|
|
|
|
FEATURES=-DHAVE_BACKTRACE=0 -DHAVE_VARIADIC_MACROS=1
|
2012-02-06 23:23:04 +00:00
|
|
|
|
|
|
|
diff --git a/src/Makefile.macosx b/src/Makefile.macosx
|
|
|
|
index c7b9a32..f721589 100644
|
|
|
|
--- a/src/Makefile.macosx
|
|
|
|
+++ b/src/Makefile.macosx
|
|
|
|
@@ -3,8 +3,8 @@
|
|
|
|
#
|
2009-10-04 02:05:00 +00:00
|
|
|
|
2012-02-06 23:23:04 +00:00
|
|
|
# name and path to ultima4.zip and u4upgrad.zip
|
|
|
|
-ULTIMA4=ultima4*.zip
|
|
|
|
-U4UPGRADE=u4upgrad.zip
|
|
|
|
+ULTIMA4=../ultima4.zip
|
|
|
|
+U4UPGRADE=../u4upgrad.zip
|
2009-10-04 02:05:00 +00:00
|
|
|
|
2012-02-06 23:23:04 +00:00
|
|
|
# for crosscompiling arch ppc or i386 from OS X 10.6 use
|
|
|
|
# CC=/usr/bin/gcc-4.0
|
|
|
|
@@ -100,7 +100,7 @@ bundle: u4
|
|
|
|
cp ../graphics/vga2/*.png $(bundle_name)/Contents/Resources/vga2
|
|
|
|
# if you want to include the ultima4.zip in the bundle uncomment the
|
|
|
|
# following line.
|
|
|
|
- # cp $(ULTIMA4) $(bundle_name)/Contents/Resources
|
|
|
|
+ cp $(ULTIMA4) $(bundle_name)/Contents/Resources
|
|
|
|
cp $(U4UPGRADE) $(bundle_name)/Contents/Resources
|
|
|
|
cp $< $(bundle_name)/Contents/MacOS
|