diff options
| author | Misty De Meo | 2012-02-06 15:23:04 -0800 |
|---|---|---|
| committer | Misty De Meo | 2012-02-06 17:06:29 -0800 |
| commit | 95257776146c6834584fa070b1237d977aa281eb (patch) | |
| tree | 8b4677c9712b12336e6c324df06f37fef587b038 /Library | |
| parent | a7ac154bb946a946a96da21972d0ee95105bafbe (diff) | |
| download | homebrew-95257776146c6834584fa070b1237d977aa281eb.tar.bz2 | |
xu4 r2999
Also updates the build system, fixes the broken Ultima 4 download link,
and corrects the formula to use Homebrew's selected compiler.
Fixes #6302
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/xu4.rb | 84 |
1 files changed, 46 insertions, 38 deletions
diff --git a/Library/Formula/xu4.rb b/Library/Formula/xu4.rb index e16136d19..e0c4444e7 100644 --- a/Library/Formula/xu4.rb +++ b/Library/Formula/xu4.rb @@ -2,9 +2,9 @@ require 'formula' class Xu4 < Formula url 'http://xu4.svn.sourceforge.net/svnroot/xu4/trunk/u4', - :revision => '2725' + :revision => '2999' homepage 'http://xu4.sourceforge.net/' - version '1.0beta4-pre' + version 'r2999' head 'http://xu4.svn.sourceforge.net/svnroot/xu4/trunk/u4' @@ -16,25 +16,27 @@ class Xu4 < Formula end def install - ENV.libpng + ENV.x11 ultima_zips = [ - "Ultima%20IV%20for%20DOS/1.01/ultima4-1.01.zip", - "Ultima%204%20VGA%20Upgrade/1.3/u4upgrad.zip"] + "http://www.thatfleminggent.com/ultima/ultima4.zip", + "http://downloads.sourceforge.net/project/xu4/Ultima%204%20VGA%20Upgrade/1.3/u4upgrad.zip" + ] ohai "Downloading support files" - ultima_zips.each { |f| curl "http://downloads.sourceforge.net/project/xu4/#{f}", "-O" } + ultima_zips.each { |f| curl f, "-O" } Dir.chdir 'src' do # Copy over SDL's ObjC main files `cp -R #{Formula.factory('sdl').libexec}/* macosx` inreplace "Makefile.macosx" do |s| + s.change_make_var! "SYSROOT", "/Developer/SDKs/MacOSX#{MACOS_VERSION}.sdk" s.remove_make_var! "WHICH_ARCH" - s.change_make_var! "WHICH_FRAMEWORK", "MacOSX#{MACOS_VERSION}.sdk" + s.change_make_var! "PREFIX", HOMEBREW_PREFIX s.change_make_var! "BUNDLE_CONTENTS", "xu4.app/Contents" - s.gsub! "../../ultima4.zip", "../ultima4-1.01.zip" - s.gsub! "../../u4upgrad.zip", "../u4upgrad.zip" + s.change_make_var! "CC", ENV.cc + s.change_make_var! "CXX", ENV.cxx end system "make -f Makefile.macosx" @@ -49,48 +51,54 @@ class Xu4 < Formula end end - __END__ diff --git a/src/Makefile.macosx b/src/Makefile.macosx -index 9745ff4..88cb193 100644 +index c8e4812..1317029 100644 --- a/src/Makefile.macosx +++ b/src/Makefile.macosx -@@ -2,6 +2,9 @@ - # $Id: Makefile.macosx 2717 2008-04-03 07:14:46Z steven-j-s $ - # - -+WHICH_ARCH=-arch i386 -arch ppc -+WHICH_FRAMEWORK=MacOSX10.4u.sdk -+ - BUNDLE_CONTENTS=../../xu4.app/Contents - - CC=gcc -@@ -10,12 +13,11 @@ UI=sdl - LIBPNGDIR=../../libpng - UILIBS=-L$(HOME)/Library/Frameworks \ +@@ -18,15 +18,16 @@ UI=sdl + PREFIX=/usr + UILIBS=-L/Library/Frameworks \ -framework Cocoa \ - -framework SDL \ -- -framework SDL_mixer +- -framework SDL_mixer \ +- -framework libpng ++ -lpng \ + -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/Library/Frameworks/libpng.framework/Headers \ +- -I$(PREFIX)/include ++ -I$(PREFIX)/include \ ++ -I$(PREFIX)/include/SDL \ ++ -I/usr/include \ + -I/usr/X11/include FEATURES=-DHAVE_BACKTRACE=0 -DHAVE_VARIADIC_MACROS=1 + +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 @@ + # -@@ -24,9 +26,9 @@ DEBUGCXXFLAGS=-ggdb - # 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 -+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) - CFLAGS=$(CXXFLAGS) --LIBS=$(LIBPNGDIR)/libpng.a $(UILIBS) $(shell xml2-config --libs) -lobjc -lz -arch i386 -arch ppc -+LIBS=-lpng $(UILIBS) $(shell xml2-config --libs) -lobjc -lz $(WHICH_ARCH) - INSTALL=install + # name and path to ultima4.zip and u4upgrad.zip +-ULTIMA4=ultima4*.zip +-U4UPGRADE=u4upgrad.zip ++ULTIMA4=../ultima4.zip ++U4UPGRADE=../u4upgrad.zip - OBJS=macosx/SDLMain.o macosx/osxinit.o macosx/osxerror.o + # 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 |
