forked from SimHacker/micropolis
-
Notifications
You must be signed in to change notification settings - Fork 1
/
INSTALL.txt
118 lines (87 loc) · 4.54 KB
/
INSTALL.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
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 "C:\swig\swig.exe"."
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