pingus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pingus-CVS] [pingus] push by grum...@ gmail.com - Applied MacOSX patch


From: pingus
Subject: [Pingus-CVS] [pingus] push by grum...@ gmail.com - Applied MacOSX patch from Jonas Bäh r <address@hidden> on 2011-12-27 13 :19 GMT
Date: Tue, 27 Dec 2011 13:20:12 +0000

Revision: 0042920847f6
Author:   Ingo Ruhnke <address@hidden>
Date:     Tue Dec 27 05:18:52 2011
Log:      Applied MacOSX patch from Jonas Bähr <address@hidden>

http://code.google.com/p/pingus/source/detail?r=0042920847f6

Added:
 /INSTALL.macosx
 /Makefile.macosx
Modified:
 /.gitignore

=======================================
--- /dev/null
+++ /INSTALL.macosx     Tue Dec 27 05:18:52 2011
@@ -0,0 +1,57 @@
+
+Pingus Installation Guide for Mac OS X
+=======================================
+
+Disclaimer:
+-------------
+The following guide assumes that you use macports to install the requirements.
+You can also do this the hard way by finding/compiling the stuff yourself,
+but if you're capable of doing so you won't need this guide anyway.
+
+This guide was written on OS X 10.5 "Leopard", where XCode brings gcc-4.0.
+Since that's too old gcc-4.4 is installed using macports and also referenced +in the Makefile.macosx. If you have a recent compiler, just skip these parts
+and adapt the makefile.
+
+Requirements:
+-------------
+First get and install macports from http://www.macports.org/
+Next use macports to install pingus' requirements by typing:
+
+ $ sudo port install libsdl libsdl_image libsdl_mixer boost scons
+ $ sudo port install gcc44
+
+Compilation:
+------------
+Once all libraries are in place, you can compile Pingus with just:
+
+ $ make -f Makefile.macosx
+
+Running:
+--------
+Once the compilation is successful you can run Pingus directly from
+the top level directory of the source tree via:
+
+ $ ./pingus
+
+For details about the command line options etc. see INSTALL.unix
+
+Creating an application bundle:
+-------------------------------
+To make pingus feel at home on OS X you may want to create an application bundle. +The follwogin steps will create a Pingus.app that can be used and distributed like
+any other Mac OS X application.
+
+First we need some little helper utilities
+
+  $ sudo port install dylibbundler makeicns
+
+Now the application bundle can be build
+
+ $ make -f Makefile.macosx bundle
+
+Distribute:
+-----------
+To create a compressed package for distribution frun the following command:
+
+ $ make -f Makefile.macosx package
=======================================
--- /dev/null
+++ /Makefile.macosx    Tue Dec 27 05:18:52 2011
@@ -0,0 +1,81 @@
+# this Makefile assumes that you have used macports to install all the depemdencies.
+
+# that is were macports is installed by default
+PORTSDIR = /opt/local
+CPPPATH = $(PORTSDIR)/include
+LIBPATH = $(PORTSDIR)/lib
+# note that the default compoler on OS X 10.5 is gcc-4.0.1, which can't handle -std=c++0x +# you can set this simply to "gcc" and "g++" if your default compiler is gcc-4.4 of higher.
+CC = $(PORTSDIR)/bin/gcc-mp-4.4
+CXX = $(PORTSDIR)/bin/g++-mp-4.4
+# the default (BSD) "install" does not support the -D flag, so we're using macports GNU variant
+INSTALL = ginstall
+
+# the portable application bundle
+BUNDLE = Pingus.app
+
+# the volume name for the package (the filename ,*.dmg, will include the VERSION) +# NOTE: currently an initial size of 100M is used. This has to be increased as needed!
+PACKAGE = Pingus
+
+build/pingus:
+       mkdir -p build
+       scons CPPPATH=$(CPPPATH) LIBPATH=$(LIBPATH) CXX=$(CXX) CC=$(CC)
+       ln -fs build/pingus
+
+build/pingus.icns: data/images/icons/pingus-icon.png
+       mkdir -p build
+       makeicns -in $< -out $@
+
+bundle: install-exec install-data install-icon
+
+create-app-bundle: build/pingus.icns
+       mkdir -p $(BUNDLE)/Contents/MacOS
+       mkdir -p $(BUNDLE)/Contents/Resources
+       mkdir -p $(BUNDLE)/Contents/bin
+       mkdir -p $(BUNDLE)/Contents/lib
+       mkdir -p $(BUNDLE)/Contents/data
+       echo "APPL" > $(BUNDLE)/Contents/PkgInfo
+ echo "#!/bin/bash\nbase=\$${0/MacOS\\/[Pp]ingus/}\nlang=`defaults read .GlobalPreferences AppleLanguages | tr -d [:space:] | cut -c2-3`\nexec \$$base/bin/pingus --language=\$$lang --datadir \"\$$base/data\"" > $(BUNDLE)/Contents/MacOS/pingus
+       chmod 755 $(BUNDLE)/Contents/MacOS/pingus
+
+install-icon: create-app-bundle build/pingus
+       install build/pingus.icns $(BUNDLE)/Contents/Resources
+ echo "<plist version=\"1.0\"><dict><key>CFBundleIconFile</key><string>pingus.icns</string></dict></plist>"
$(BUNDLE)/Contents/Info.plist
+
+install-exec: create-app-bundle build/pingus
+       install build/pingus $(BUNDLE)/Contents/bin
+ dylibbundler -b -x $(BUNDLE)/Contents/bin/pingus -od -d $(BUNDLE)/Contents/lib/ -p @executable_path/../lib/
+
+install-data:
+       find data \
+        -type f -a  \( \
+        -name "*.png" -o \
+        -name "*.jpg" -o \
+        -name "*.wav" -o \
+        -name "*.scm" -o \
+        -name "*.font" -o \
+        -name "*.story" -o \
+        -name "*.credits" -o \
+        -name "*.prefab" -o \
+        -name "*.it" -o \
+        -name "*.ogg" -o \
+        -name "*.s3m" -o \
+        -name "*.po" -o \
+        -name "*.worldmap" -o \
+        -name "*.res" -o \
+        -name "*.pingus" -o \
+        -name "*.levelset" -o \
+        -name "*.sprite" \
+        \) -exec  $(INSTALL) -D {} $(BUNDLE)/Contents/{} \;
+
+package: bundle
+       hdiutil create -size 100M -fs HFS+J -volname $(PACKAGE) 
$(PACKAGE)-tmp.dmg
+       hdiutil attach $(PACKAGE)-tmp.dmg -readwrite -mount required
+       cp -R -p $(BUNDLE) /Volumes/$(PACKAGE)/
+       cp README /Volumes/$(PACKAGE)
+       cp NEWS /Volumes/$(PACKAGE)
+       hdiutil detach /Volumes/$(PACKAGE) -force
+ hdiutil convert $(PACKAGE)-tmp.dmg -format UDZO -imagekey zlib-level=9 -o $(PACKAGE)-`cat VERSION`.dmg
+       rm $(PACKAGE)-tmp.dmg
+
=======================================
--- /.gitignore Tue Oct 11 14:42:55 2011
+++ /.gitignore Tue Dec 27 05:18:52 2011
@@ -1,8 +1,11 @@
+.DS_Store
+.*.swp
 /.sconf_temp
 /.sconsign.dblite
 /cache
 /build
 /build-win32
+/build-win32.old
 /config.log
 *~
 *.o
@@ -10,5 +13,7 @@
 /pingus-neutral
 /pingus-nice
 /pingus
+/Pingus.app
+/Pingus-*.dmg
 /doc/man/pingus.html/index.html
 /doc/man/pingus.html/index.orig.html

reply via email to

[Prev in Thread] Current Thread [Next in Thread]