2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-09-25 23:53:16 +00:00
|
|
|
|
|
|
|
class Xu4 <Formula
|
2010-03-02 00:24:55 +00:00
|
|
|
head 'http://xu4.svn.sourceforge.net/svnroot/xu4/trunk/u4',
|
|
|
|
:revision => '2725'
|
2009-09-25 23:53:16 +00:00
|
|
|
homepage 'http://xu4.sourceforge.net/'
|
|
|
|
|
|
|
|
depends_on 'sdl'
|
|
|
|
depends_on 'sdl_mixer'
|
2009-11-22 00:11:14 +00:00
|
|
|
|
|
|
|
aka 'ultima4'
|
2009-09-25 23:53:16 +00:00
|
|
|
|
2009-10-04 02:05:00 +00:00
|
|
|
def patches
|
|
|
|
DATA
|
|
|
|
end
|
|
|
|
|
2009-09-25 23:53:16 +00:00
|
|
|
def install
|
|
|
|
ENV.libpng
|
|
|
|
|
2009-11-22 00:11:14 +00:00
|
|
|
ultima_zips = [
|
2010-03-02 00:24:55 +00:00
|
|
|
"Ultima%20IV%20for%20DOS/1.01/ultima4-1.01.zip",
|
|
|
|
"Ultima%204%20VGA%20Upgrade/1.3/u4upgrad.zip"]
|
2009-11-22 00:11:14 +00:00
|
|
|
|
2010-03-02 00:24:55 +00:00
|
|
|
ultima_zips.each { |f| curl "http://downloads.sourceforge.net/project/xu4/#{f}", "-O" }
|
2009-09-25 23:53:16 +00:00
|
|
|
|
|
|
|
Dir.chdir 'src' do
|
2010-03-02 00:24:55 +00:00
|
|
|
# Copy over SDL's ObjC main files
|
|
|
|
`cp -R #{Formula.factory('sdl').libexec}/* macosx`
|
2009-09-25 23:53:16 +00:00
|
|
|
|
2010-01-13 11:06:52 +00:00
|
|
|
inreplace "Makefile.macosx" do |s|
|
2010-03-02 00:24:55 +00:00
|
|
|
s.remove_make_var! "WHICH_ARCH"
|
|
|
|
s.change_make_var! "WHICH_FRAMEWORK", "MacOSX#{MACOS_VERSION}.sdk"
|
2010-01-13 11:06:52 +00:00
|
|
|
s.change_make_var! "BUNDLE_CONTENTS", "xu4.app/Contents"
|
|
|
|
s.gsub! "../../ultima4.zip", "../ultima4-1.01.zip"
|
|
|
|
s.gsub! "../../u4upgrad.zip", "../u4upgrad.zip"
|
|
|
|
end
|
2009-09-25 23:53:16 +00:00
|
|
|
|
|
|
|
system "make -f Makefile.macosx"
|
|
|
|
system "make -f Makefile.macosx install"
|
|
|
|
|
2009-11-22 00:11:14 +00:00
|
|
|
prefix.install "xu4.app"
|
2009-09-25 23:53:16 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
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
|
2010-03-02 00:24:55 +00:00
|
|
|
index 9745ff4..88cb193 100644
|
2009-10-04 02:05:00 +00:00
|
|
|
--- a/src/Makefile.macosx
|
|
|
|
+++ b/src/Makefile.macosx
|
2010-03-02 00:24:55 +00:00
|
|
|
@@ -2,6 +2,9 @@
|
|
|
|
# $Id: Makefile.macosx 2717 2008-04-03 07:14:46Z steven-j-s $
|
2009-10-04 02:05:00 +00:00
|
|
|
#
|
|
|
|
|
2010-03-02 00:24:55 +00:00
|
|
|
+WHICH_ARCH=-arch i386 -arch ppc
|
|
|
|
+WHICH_FRAMEWORK=MacOSX10.4u.sdk
|
2009-10-04 02:05:00 +00:00
|
|
|
+
|
|
|
|
BUNDLE_CONTENTS=../../xu4.app/Contents
|
|
|
|
|
2010-03-02 00:24:55 +00:00
|
|
|
CC=gcc
|
|
|
|
@@ -10,12 +13,11 @@ UI=sdl
|
|
|
|
LIBPNGDIR=../../libpng
|
2009-10-04 02:05:00 +00:00
|
|
|
UILIBS=-L$(HOME)/Library/Frameworks \
|
|
|
|
-framework Cocoa \
|
|
|
|
- -framework SDL \
|
|
|
|
- -framework SDL_mixer
|
|
|
|
+ -lSDL \
|
|
|
|
+ -lSDL_mixer
|
|
|
|
UIFLAGS=-F/Library/Frameworks \
|
|
|
|
- -I/Library/Frameworks/SDL.framework/Headers \
|
|
|
|
- -I/Library/Frameworks/SDL_mixer.framework/Headers \
|
|
|
|
- -I$(LIBPNGDIR)
|
|
|
|
+ -I/usr/local/include/SDL \
|
|
|
|
+ -I/usr/X11/include
|
|
|
|
|
|
|
|
FEATURES=-DHAVE_BACKTRACE=0 -DHAVE_VARIADIC_MACROS=1
|
|
|
|
|
2010-03-02 00:24:55 +00:00
|
|
|
@@ -24,9 +26,9 @@ DEBUGCXXFLAGS=-ggdb
|
2009-10-04 02:05:00 +00:00
|
|
|
# Optimising
|
|
|
|
#DEBUGCXXFLAGS=-O2 -mdynamic-no-pic
|
|
|
|
|
|
|
|
-CXXFLAGS=$(FEATURES) -Wall -I. $(UIFLAGS) $(shell xml2-config --cflags) -DVERSION=\"$(VERSION)\" $(DEBUGCXXFLAGS) -DNPERF -DMACOSX -DMACOSX_USER_FILES_PATH=\"/Library/Application\ Support/xu4\" -no-cpp-precomp -L$(LIBPNGDIR) -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc
|
2010-03-02 00:24:55 +00:00
|
|
|
+CXXFLAGS=$(FEATURES) -Wall -I. $(UIFLAGS) $(shell xml2-config --cflags) -DVERSION=\"$(VERSION)\" $(DEBUGCXXFLAGS) -DNPERF -DMACOSX -DMACOSX_USER_FILES_PATH=\"/Library/Application\ Support/xu4\" -no-cpp-precomp -L$(LIBPNGDIR) -isysroot /Developer/SDKs/$(WHICH_FRAMEWORK) $(WHICH_ARCH)
|
2009-10-04 02:05:00 +00:00
|
|
|
CFLAGS=$(CXXFLAGS)
|
|
|
|
-LIBS=$(LIBPNGDIR)/libpng.a $(UILIBS) $(shell xml2-config --libs) -lobjc -lz -arch i386 -arch ppc
|
2010-03-02 00:24:55 +00:00
|
|
|
+LIBS=-lpng $(UILIBS) $(shell xml2-config --libs) -lobjc -lz $(WHICH_ARCH)
|
2009-10-04 02:05:00 +00:00
|
|
|
INSTALL=install
|
|
|
|
|
|
|
|
OBJS=macosx/SDLMain.o macosx/osxinit.o macosx/osxerror.o
|