From 631cb05451ccf289db35cd65fe7a3260411d993c Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Sat, 3 Oct 2009 19:05:00 -0700 Subject: [PATCH] Updated formula for xu4 (Ultima 4 engine) It's a lost cause trying to get 1.0beta3 compiling under Snow Leopard, and the trunk already compiles 64-bit clean, so we might as well use that. Note that the DATA patch makes a few changes that are then rewritten by inreplace. Why not patch clean and not run inreplace later? Because I'm going to submit the patch back upstream, which should hopefully allow us to drop it from the formula and only use inreplace to select our build environment (native arch and framework for either 10.5 or 10.6) --- Formula/xu4.rb | 108 +++++++++++++++++++++++++++---------------------- 1 file changed, 59 insertions(+), 49 deletions(-) diff --git a/Formula/xu4.rb b/Formula/xu4.rb index c8e5048240..63acdaa91d 100644 --- a/Formula/xu4.rb +++ b/Formula/xu4.rb @@ -1,15 +1,17 @@ require 'brewkit' -# See src/doc/xu4MacOSXcvs.txt in the tarball for some explanation class Xu4 = 4.1 - inreplace "imagemgr.h", - "SubImage *ImageMgr::getSubImage(const std::string &name);", - "SubImage *getSubImage(const std::string &name);" - - # Set our prefix - # I don't think this is actually used in the mac build --adamv - inreplace "Makefile", "prefix=/usr/local", "prefix=#{prefix}" - - # Use libpng from the system X11 folder - # These next 2 replaces are pointless but - # I don't want to break the syntax of the Makefile - # by leaving it with trailing \ continuations. - inreplace "Makefile.macosx", - "LIBPNGDIR=../../libpng", "LIBPNGDIR=/usr/X11/lib" - - inreplace "Makefile.macosx", - "-I$(LIBPNGDIR)", "-I/usr/X11/include" - - # Use X11 provided libpng - inreplace "Makefile.macosx", - "$(LIBPNGDIR)/libpng.a", "-lpng" - - # Too bad xu4 doesn't just do #include - # Slot in the SDL include path - inreplace "Makefile.macosx", - "-I/Library/Frameworks/SDL.framework/Headers", - "-I#{sdl_prefix}/include/SDL" - - # Use "lib" versions of SDL, not Frameworks - inreplace "Makefile.macosx", - "-framework SDL", "-lSDL" - - inreplace "Makefile.macosx", - "-framework SDL_mixer", "-lSDL_mixer" - - # Fix the u4 zip location - inreplace "Makefile.macosx", "../../ultima4.zip", "../ultima4-1.01.zip" - inreplace "Makefile.macosx", "../../u4upgrad.zip", "../u4upgrad.zip" - - # Build the .app right in the source tree; we've moving it later anyway + inreplace "Makefile.macosx", "WHICH_FRAMEWORK=10.4u", "WHICH_FRAMEWORK=#{MACOS_VERSION}" + inreplace "Makefile.macosx", "ARCHES=-arch i386 -arch ppc", "ARCHES=" inreplace "Makefile.macosx", "BUNDLE_CONTENTS=../../xu4.app/Contents", "BUNDLE_CONTENTS=xu4.app/Contents" + inreplace "Makefile.macosx", "../../ultima4.zip", "../ultima4-1.01.zip" + inreplace "Makefile.macosx", "../../u4upgrad.zip", "../u4upgrad.zip" + system "make -f Makefile.macosx" system "make -f Makefile.macosx install" @@ -85,3 +47,51 @@ class Xu4 >>>>>> eade584... Updated formula for xu4 (Ultima 4 engine)