Friday, September 28, 2012

PyGamekit - tricks for compilation

Pygamekit compilation

#first - install pip python
1. sudo apt-get install mercurial python-dev python-pip
2. sudo pip install cython

#second - download pygamekit
1. cd ../gamekit/trunk
2. sudo hg clone https://bitbucket.org/DiThi/pygamekit

#thirdly -  gamekit compilation
1. sudo su
2. cd ../gamekit/trunk/
3. mkdir ../build_android (which will hold all the configuration files for building libogrekit)

However, python-dev is installed but the pygamekit may not set the python include path correctly to your linux box's location, so some more steps here to fix it:
a.) vim ../gamekit/trunk/pygamekit/CMakeList.txt
do the modification below or add some makefile debugging message:
 b.) since the "PYTHON_ANDROID_LIB" path should be added correctly, we can do some tricks inside "./gamekit/trunk/CMakeLists.txt"
vim ../gamekit/trunk/CMakeLists.txt
do the changes below to set the path and subdirs of "pygamekit" correctly

c.) Turn Off "OGREKIT_USE_LUA" inside ./trunk/CMake/ConfigOgreKit.cmake.
      This option will bring out OpenAL related source.
d.) vim ../gamekit/trunk/pygamekit/gamekit.pyx
      comment out #include "sound.pxi"
      This will totally remove all sound package from pygamekit which needs OpenAL from gamekit.

Then, we can go back the normal path:
4. cd ../gamekit/trunk/
5. ./configure-android ../build_android
The output should be like this:
6. then, we can build the ogrekit lib with python extension, should be OK!!
7. cd ../gamekit/build_android/
8. make

Ref:
[1] - http://gamekit.org/forum/viewtopic.php?f=2&t=484 

[Latest Update]!!! 2012-10-04
I would like to suspend this build for the pygamekit as I came across the ./gamekit/pygamekit/CMakeLists.txt required the "PYTHON_ANDROID_LIB" path which seems point to seek libraries "libpython2.7.a" & "libpython2.7.so" that they should be cross-compiled libs from android NDK toolchain - "arm-linux-androideabi-gcc" something like that as I compiled the "pygamekit" inside "build_android" configuring from the "gamekit/configure_android" script........okay, I would stop here and find another way round for doing vehicle demo by blender LUA?? or reference from the Ogrekit appVehicleDemo??