Permalink
Switch branches/tags
Nothing to show
Find file Copy path
82af751 Apr 30, 2012
0 contributors

Users who have contributed to this file

119 lines (87 sloc) 4.54 KB
Building on Mac OS/X:
Install: GTK+, pygobject, pycairo, pygtk
GTK+:
http://www.gtk-osx.org/
How to install pygobject, pycairo, pygtk:
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig/
http://ifeghali.blogspot.com/2008/03/gtk-python-bindings-for-mac-os-x-105.html
GTK Python bindings for Mac OS X 10.5 Leopard
Following my previous post we are now ready to compile and install the python bindings in order to have UMIT ready to go.
we start with pygobject which is cursed by Murphy's law. At the first attempt I got make stopped by an error message, that could be fixed by telling which python version we would like to use (one more time thanks to macports).
wget http://ftp.gnome.org/pub/GNOME/sources/pygobject/2.14/pygobject-2.14.1.tar.bz2
tar -jxf pygobject-2.14.1.tar.bz2
cd pygobject-2.14.1
./configure --prefix=/usr/local --disable-glibtest CFLAGS="-arch i686" PYTHON=/usr/bin/python2.5
make
sudo make install
next pycairo:
wget http://cairographics.org/releases/pycairo-1.4.12.tar.gz
tar -zxf pycairo-1.4.12.tar.gz
cd pycairo-1.4.12.tar
./configure --prefix=/usr/local CFLAGS="-arch i686" PYTHON=/usr/bin/python2.5
make
sudo make install
and finally pygtk:
wget http://gensho.acc.umu.se/pub/GNOME/sources/pygtk/2.12/pygtk-2.12.1.tar.bz2
tar -jxf pygtk-2.12.1.tar.bz2
cd pygtk-2.12.1
./configure --prefix=/usr/local CFLAGS="-arch i686" PYTHON=/usr/bin/python2.5
make
sudo make install
that's the end of our saga. You can now enjoy UMIT on your Mac OS :)
Building on Windows:
Install: GTK+, python, pycairo, Visual Studio
GTK+:
http://www.gtk.org/
Download the all-in-one-bundle from here:
http://www.gtk.org/download/win32.php
and install to c:\gtk
Cairo is a 2D graphics library used by the TileEngine and comes along with GTK. With GTK+
you can also run the gtk frontend that's included in the source (you can find it in
MicropolisCore/src/run-gtkfrontend, it's a python script).
Python:
http://www.python.org/
Download the latest 2.x version from the download page (http://www.python.org/download/) and
install the MSI to c:\python.
Pycairo:
http://cairographics.org/pycairo/
Pycairo is a set of Python bindings for cairo. You need the pycairo.h header files from the
source distribution to build the TileEngine project. Download py2cairo-1.10.0 (if you're using python 2.x)
and unzip to c:\pycairo.
Visual Studio:
You can download Visual Studio Express edition from here:
http://www.microsoft.com/visualstudio/en-us/products/2010-editions/express
You'll need the Visual C++ 2010 Express edition to build the core project.
Download the latest source from the Google project here:
http://code.google.com/p/micropolis/
via subversion to a folder of your choice.
Paths:
The following files have hard coded paths to tools that you may or may not need to modify
based on your installs. This is why I suggest putting things in generic paths (without version numbers)
MicropolisCore/src/CellEngine/python/CellEngine.vcproj (various places)
AdditionalIncludeDirectories="..\src;..;C:\Python\include;C:\gtk\include\cairo;"
AdditionalLibraryDirectories="c:\Python\libs;C:\gtk\lib"
MicropolisCore/src/MicropolisEngine/python/Micropolis.vcproj (various places)
AdditionalIncludeDirectories="..\src;..;C:\Python\include"
AdditionalLibraryDirectories="c:\Python\libs"
MicropolisCore/src/MicropolisEngine/python/SWIG.rules
<StringProperty
Name="SwigExe"
DisplayName="SWIG Executable"
PropertyPageName="SWIG"
Category="SWIG"
Description="Specifies the name of the SWIG executable, typically &quot;C:\swig\swig.exe&quot;."
Switch="[value]"
DefaultValue="c:\swig\swig.exe"
/>
MicropolisCore/src/TileEngine/python/TileEngine.vcproj (various places)
AdditionalIncludeDirectories="..\src;..;C:\Python\include;C:\gtk\include\cairo;C:\pycairo\src"
AdditionalLibraryDirectories="c:\Python\libs;C:\gtk\lib"
Open up MicropolisCore.sln in MicropolisCore/src and rebuild the solution. If all the paths are setup and the
files are in place it should build completely.
You should now have 3 DLLs built along with the output from SWIG which will be python files and in the csMicropolis
folder a series of C# files (which are managed wrappers around the C++ micropolisengine.dll)
The Python files can be used with any Python front-end you want to build. There's a pre-build frontend
that uses GTK+ to run the game with most of the features of the X11 version.
You can read a series of blog posts by Bil Simser on building and modifying the code here:
http://weblogs.asp.net/bsimser/archive/2008/01/14/building-a-city-the-series.aspx