homebrew-core/Formula/xu4.rb

105 lines
2.7 KiB
Ruby
Raw Normal View History

require 'formula'
2009-09-25 23:53:16 +00:00
2011-03-10 05:11:03 +00:00
class Xu4 < Formula
url 'http://xu4.svn.sourceforge.net/svnroot/xu4/trunk/u4',
:revision => '2999'
2009-09-25 23:53:16 +00:00
homepage 'http://xu4.sourceforge.net/'
version 'r2999'
head 'http://xu4.svn.sourceforge.net/svnroot/xu4/trunk/u4'
2009-09-25 23:53:16 +00:00
depends_on 'sdl'
depends_on 'sdl_mixer'
def patches
DATA
end
2009-09-25 23:53:16 +00:00
def install
ENV.x11
ultima_zips = [
"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 f, "-O" }
2009-09-25 23:53:16 +00:00
Dir.chdir 'src' do
# Copy over SDL's ObjC main files
`cp -R #{Formula.factory('sdl').libexec}/* macosx`
2010-01-13 11:06:52 +00:00
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! "PREFIX", HOMEBREW_PREFIX
2010-01-13 11:06:52 +00:00
s.change_make_var! "BUNDLE_CONTENTS", "xu4.app/Contents"
s.change_make_var! "CC", ENV.cc
s.change_make_var! "CXX", ENV.cxx
2010-01-13 11:06:52 +00:00
end
2009-09-25 23:53:16 +00:00
system "make -f Makefile.macosx"
system "make -f Makefile.macosx install"
prefix.install "xu4.app"
2009-09-25 23:53:16 +00:00
end
end
2009-09-25 23:53:16 +00:00
def caveats
"xu4.app installed to #{prefix}"
2009-09-25 23:53:16 +00:00
end
end
__END__
diff --git a/src/Makefile.macosx b/src/Makefile.macosx
index c8e4812..1317029 100644
--- a/src/Makefile.macosx
+++ b/src/Makefile.macosx
@@ -18,15 +18,16 @@ UI=sdl
PREFIX=/usr
UILIBS=-L/Library/Frameworks \
-framework Cocoa \
- -framework SDL \
- -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/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 @@
#
# name and path to ultima4.zip and u4upgrad.zip
-ULTIMA4=ultima4*.zip
-U4UPGRADE=u4upgrad.zip
+ULTIMA4=../ultima4.zip
+U4UPGRADE=../u4upgrad.zip
# 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