[Tux4kids-commits] r63 - in tuxmath/trunk: . data/images docs nsis src

dbruce at alioth.debian.org dbruce at alioth.debian.org
Thu Mar 8 21:25:13 CET 2007


Author: dbruce
Date: 2006-11-20 18:01:22 +0000 (Mon, 20 Nov 2006)
New Revision: 63

Added:
   tuxmath/trunk/Info.plist
   tuxmath/trunk/data/images/tuxmath.icns
   tuxmath/trunk/mac_cplibs.sh
   tuxmath/trunk/tuxmath.sh
Modified:
   tuxmath/trunk/Makefile.am
   tuxmath/trunk/docs/INSTALL.txt
   tuxmath/trunk/docs/changelog
   tuxmath/trunk/nsis/tuxmath.nsi
   tuxmath/trunk/nsis/tuxmath_with_conf.nsi
   tuxmath/trunk/src/Makefile.am
   tuxmath/trunk/src/credits.c
   tuxmath/trunk/src/setup.c
Log:
Support for Mac OSX build


Added: tuxmath/trunk/Info.plist
===================================================================
--- tuxmath/trunk/Info.plist	2006-11-19 11:20:28 UTC (rev 62)
+++ tuxmath/trunk/Info.plist	2006-11-20 18:01:22 UTC (rev 63)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>CFBundleDevelopmentRegion</key>
+	<string>English</string>
+	<key>CFBundleExecutable</key>
+	<string>tuxmath</string>
+	<key>CFBundleIconFile</key>
+	<string>tuxmath.icns</string>
+	<key>CFBundleIdentifier</key>
+	<string>application/x-vnd.tuxmath.oxyd</string>
+	<key>CFBundleInfoDictionaryVersion</key>
+	<string>6.0</string>
+	<key>CFBundleName</key>
+	<string>TuxMath</string>
+	<key>CFBundlePackageType</key>
+	<string>APPL</string>
+	<key>CFBundleSignature</key>
+	<string>????</string>
+	<key>CFBundleVersion</key>
+	<string>0.80</string>
+	<key>NSMainNibFile</key>
+	<string>SDLMain</string>
+	<key>NSPrincipalClass</key>
+	<string>NSApplication</string>
+</dict>
+</plist>

Modified: tuxmath/trunk/Makefile.am
===================================================================
--- tuxmath/trunk/Makefile.am	2006-11-19 11:20:28 UTC (rev 62)
+++ tuxmath/trunk/Makefile.am	2006-11-20 18:01:22 UTC (rev 63)
@@ -40,3 +40,6 @@
 	  rm -fr $(NSI_INSTALL_DIR); \
 	fi
 #	-rm tuxmath- at VERSION@-win32-installer.exe
+
+macapp:
+	cd src && $(MAKE) $(AM_MAKEFLAGS) bundle && $(MAKE) $(AM_MAKEFLAGS) bundle-fw && $(MAKE) $(AM_MAKEFLAGS) bundle-libs && $(MAKE) $(AM_MAKEFLAGS) bundle-dmg

Added: tuxmath/trunk/data/images/tuxmath.icns
===================================================================
(Binary files differ)


Property changes on: tuxmath/trunk/data/images/tuxmath.icns
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: tuxmath/trunk/docs/INSTALL.txt
===================================================================
--- tuxmath/trunk/docs/INSTALL.txt	2006-11-19 11:20:28 UTC (rev 62)
+++ tuxmath/trunk/docs/INSTALL.txt	2006-11-20 18:01:22 UTC (rev 63)
@@ -13,10 +13,10 @@
 
       Linux
       Windows 32-bit
+      MacOSX
 
     In principle, Tuxmath should build and run on any platform with SDL,
     including: 
-      MacOSX
       Solaris
       IRIX
       FreeBSD
@@ -208,3 +208,29 @@
       location and should function correctly.  It can be run with ordinary user privileges,
       even if installed by the administrator.
 
+
+  Mac OSX:
+  -------
+      Building from source:
+      --------------------
+      You have to have the development tools and development libraries for SDL.  Here's the approach that worked for me:
+	  1. Download and install XCode from the Apple web site.
+	  2. Download and install Fink (http://fink.sourceforge.net/).
+	  3. fink install sdl sdl-image sdl-mixer.
+	And if you haven't gotten the source code for tuxmath yet,
+	  4. fink install svn-client-ssl (the pre-built binary for the svn-client doesn't support SSL!)
+	  5. svn co https://svn.tux4kids.net/tuxmath/
+
+	Then you can follow the instructions above for Linux/Unix.
+
+      Building a disk image:
+      ---------------------
+      A disk image is a file that can be copied to another Mac, allowing the application to be run.  Assuming you have set up your build environment as above, you can build a disk image by running (from the "trunk" directory)
+	./autogen.sh
+	./configure
+	make macapp
+      The disk image will reside in a subdirectory macbuild, and has the name TuxMath.dmg.
+
+      Possible issues:
+      ---------------
+      The Mac build system has not yet been configured to make a "universal binary," i.e. one that runs on either PPC or Intel macs.

Modified: tuxmath/trunk/docs/changelog
===================================================================
--- tuxmath/trunk/docs/changelog	2006-11-19 11:20:28 UTC (rev 62)
+++ tuxmath/trunk/docs/changelog	2006-11-20 18:01:22 UTC (rev 63)
@@ -1,6 +1,16 @@
 changelog for "tuxmath"
 
-2006.Oct.31 (https://svn.tux4kids.net/tuxmath/ - revision 58)
+
+2006.Nov.17  (https://svn.tux4kids.net/tuxmath/ - revision 61)
+  Version 1.0.2
+
+  Build:
+    * Support for native MacOSX build (G4-PPC, OSX 10.4) - now 
+      has "macapp" target in Makefile.
+
+      Tim Holy <holy at wustl.edu>
+
+2006.Nov.17  (https://svn.tux4kids.net/tuxmath/ - revision 58)
   Version 1.0.1
 
   Game:

Added: tuxmath/trunk/mac_cplibs.sh
===================================================================
--- tuxmath/trunk/mac_cplibs.sh	2006-11-19 11:20:28 UTC (rev 62)
+++ tuxmath/trunk/mac_cplibs.sh	2006-11-20 18:01:22 UTC (rev 63)
@@ -0,0 +1,24 @@
+#! /bin/sh
+
+# A function that takes as input a binary name and a lib target directory
+# cpswlibs <binaryname> <directory to copy dependencies to>
+function cpswlibs {
+# Get the list of dependencies in /sw, excluding self
+fls=$(otool -L $1 | grep "/sw" | cut -f 2 | cut -d "(" -f 1 | grep -v $1)
+echo $fls
+# Copy these dependencies into the target directory
+cp $fls $2
+}
+
+# Run cpswlibs on the input binary name
+BINNAME=$1
+LIBDIRNAME=$2
+cpswlibs $BINNAME $LIBDIRNAME
+# Now run cpswlibs on each of the libraries that we copied
+echo $LIBDIRNAME
+fls=$(ls $LIBDIRNAME)
+for i in $fls; do
+    echo $i
+    cpswlibs $LIBDIRNAME/$i $LIBDIRNAME
+done
+# For tuxmath we don't need any more recursions that this
\ No newline at end of file


Property changes on: tuxmath/trunk/mac_cplibs.sh
___________________________________________________________________
Name: svn:executable
   + *

Modified: tuxmath/trunk/nsis/tuxmath.nsi
===================================================================
--- tuxmath/trunk/nsis/tuxmath.nsi	2006-11-19 11:20:28 UTC (rev 62)
+++ tuxmath/trunk/nsis/tuxmath.nsi	2006-11-20 18:01:22 UTC (rev 63)
@@ -2,7 +2,7 @@
 # with a few tiny modifications by Phil Harper(philh at theopencd.org)
 # modified for tuxmath by Yves Combe (yves at ycombe.net)
 
-!define PKG_VERSION "1.0"
+!define PKG_VERSION "1.0.1"
 !define PKG_PREFIX  "tuxmath"
 
 !define APP_PREFIX  "TuxMath"

Modified: tuxmath/trunk/nsis/tuxmath_with_conf.nsi
===================================================================
--- tuxmath/trunk/nsis/tuxmath_with_conf.nsi	2006-11-19 11:20:28 UTC (rev 62)
+++ tuxmath/trunk/nsis/tuxmath_with_conf.nsi	2006-11-20 18:01:22 UTC (rev 63)
@@ -2,7 +2,7 @@
 # with a few tiny modifications by Phil Harper(philh at theopencd.org)
 # modified for tuxmath by Yves Combe (yves at ycombe.net)
 
-!define PKG_VERSION "1.0"
+!define PKG_VERSION "1.0.1"
 !define PKG_PREFIX  "tuxmath"
 
 !define APP_PREFIX  "TuxMath"

Modified: tuxmath/trunk/src/Makefile.am
===================================================================
--- tuxmath/trunk/src/Makefile.am	2006-11-19 11:20:28 UTC (rev 62)
+++ tuxmath/trunk/src/Makefile.am	2006-11-20 18:01:22 UTC (rev 63)
@@ -29,3 +29,46 @@
 tuxmathrc.o: tuxmathrc.rc
 	$(WINDRES) -i $< -o $@
 
+
+#------------------ Packaging rules for Mac OSX ------------------------
+#---Many thanks to the developers (esp. Sidney Markowitz?) of Enigma,---
+#---whose Makefiles were the template for this one.---------------------
+
+bundle_name := $(top_builddir)/macbuild/TuxMath.app
+# Special target to copy all needed game files to TuxMath.app/Contents/Resources.
+# For Mac OS X bundle.
+.PHONY: bundle
+bundle:
+	-rm -rf $(bundle_name)/Contents
+	mkdir -p $(bundle_name)/Contents/MacOS
+	mkdir -p $(bundle_name)/Contents/Resources/data/
+	echo "APPL????" > $(bundle_name)/Contents/PkgInfo
+	cp $(top_builddir)/Info.plist $(bundle_name)/Contents/
+	cp $(top_builddir)/data/images/tuxmath.icns $(bundle_name)/Contents/Resources/
+	tar -cf - --exclude .svn -C $(top_builddir)/data . | tar xpf - -C $(bundle_name)/Contents/Resources/data
+	mkdir -p $(bundle_name)/Contents/lib
+	mkdir -p $(bundle_name)/Contents/bin
+	cp $(top_builddir)/tuxmath.sh $(bundle_name)/Contents/MacOS/tuxmath
+
+# Special target to copy the binary to Enigma.app/Contents/MacOS.
+.PHONY: bundle-fw
+bundle-fw: tuxmath-fw-mosx
+	cp tuxmath-fw $(bundle_name)/Contents/bin/tuxmath
+	strip $(bundle_name)/Contents/bin/tuxmath
+
+# Special target to copy the libraries from /sw/lib (from Fink)
+.PHONY: bundle-libs
+bundle-libs: tuxmath-fw-mosx
+	$(top_builddir)/mac_cplibs.sh tuxmath-fw $(bundle_name)/Contents/lib/
+
+# Special target to create a binary linked with Mac OS X frameworks
+static_prefix := `$(SDL_CONFIG) --prefix`
+.PHONY: tuxmath-fw-mosx
+tuxmath-fw-mosx: $(tuxmath_OBJECTS) $(tuxmath_DEPENDENCIES)
+	$(CXX) $(LDFLAGS) -o tuxmath-fw $(tuxmath_OBJECTS) $(tuxmath_DEPENDENCIES) -L$(static_prefix)/lib -lSDLmain -lSDL -lSDL_image -lSDL_mixer -framework Cocoa -framework OpenGL
+
+# Special target to make a disk image of the bundled app
+.PHONY: bundle-dmg
+bundle-dmg:
+	hdiutil create  -ov -srcfolder $(bundle_name) -volname TuxMath -imagekey zlib-level=6 $(top_builddir)/macbuild/TuxMath.dmg
+

Modified: tuxmath/trunk/src/credits.c
===================================================================
--- tuxmath/trunk/src/credits.c	2006-11-19 11:20:28 UTC (rev 62)
+++ tuxmath/trunk/src/credits.c	2006-11-20 18:01:22 UTC (rev 63)
@@ -38,9 +38,10 @@
   "-DESIGNED BY",
   "SAM 'CRISWELL' HART",
   "",
-  "-LEAD PROGRAMMER",
-  "BILL KENDRICK",
+  "-LEAD PROGRAMMERS",
+  "BILL KENDRICK,",
   "NEW BREED SOFTWARE",
+  "DAVID BRUCE",
   "",
   "-ADDITIONAL CODE",
   "GLEN DITCHFIELD",
@@ -48,7 +49,7 @@
   "DONNY VISZNEKI",
   "YVES COMBE",
   "DAVID YODER",
-  "DAVID BRUCE",
+  "TIM HOLY",
   "",
   "-LEAD ARTIST",
   "SAM HART",
@@ -81,6 +82,10 @@
   "ST. CATHERINE ELEM., CINCINNATI, OH",
   "WESTWOOD ELEMENTARY, CINCINNATI, OH",
   "LAURA BRUCE",
+  "ROOSEVELT ELEMENTARY, TAMPA, FL",
+  "KENDRA SWANSON AND LINNEA HOLY",
+  "OLD BONHOMME ELEMENTARY,",
+  "ST. LOUIS, MO",
   "",
   "",
   "-WEBSITE",

Modified: tuxmath/trunk/src/setup.c
===================================================================
--- tuxmath/trunk/src/setup.c	2006-11-19 11:20:28 UTC (rev 62)
+++ tuxmath/trunk/src/setup.c	2006-11-20 18:01:22 UTC (rev 63)
@@ -413,11 +413,25 @@
   }
   #endif
 
+  SDL_VideoInfo *videoInfo;
+  Uint32 surfaceMode;
+  videoInfo = SDL_GetVideoInfo();
+  if (videoInfo->hw_available) {
+    surfaceMode = SDL_HWSURFACE;
+    #ifdef TUXMATH_DEBUG    
+    printf("HW mode\n");
+    #endif
+  }
+  else {
+    surfaceMode = SDL_SWSURFACE;
+    #ifdef TUXMATH_DEBUG    
+    printf("SW mode\n");
+    #endif
+  }
 
   if (Opts_Fullscreen())
   {
-    screen = SDL_SetVideoMode(640, 480, 16, SDL_FULLSCREEN | SDL_HWSURFACE);
-
+    screen = SDL_SetVideoMode(640, 480, 16, SDL_FULLSCREEN | surfaceMode);
     if (screen == NULL)
     {
       fprintf(stderr,
@@ -430,7 +444,7 @@
 
   if (!Opts_Fullscreen())
   {
-    screen = SDL_SetVideoMode(640, 480, 16, SDL_HWSURFACE);
+    screen = SDL_SetVideoMode(640, 480, 16, surfaceMode);
   }
 
   if (screen == NULL)

Added: tuxmath/trunk/tuxmath.sh
===================================================================
--- tuxmath/trunk/tuxmath.sh	2006-11-19 11:20:28 UTC (rev 62)
+++ tuxmath/trunk/tuxmath.sh	2006-11-20 18:01:22 UTC (rev 63)
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+DIR="`dirname \"$0\"`/.."
+
+BIN="$DIR/bin"
+LIB="$DIR/lib"
+
+DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:$LIB"
+export DYLD_LIBRARY_PATH
+
+exec "$BIN/tuxmath"


Property changes on: tuxmath/trunk/tuxmath.sh
___________________________________________________________________
Name: svn:executable
   + *




More information about the Tux4kids-commits mailing list