Python on Tizen
How to get Python and related libraries / packages running on Tizen (1.0 "Larkspur", as shipped on the TizenConf developer device).
Prerequisites:
- A device with Tizen 1.0 "Larkspur" installed (emulator might work too, but untested)
- The Scratchbox Build System set up for Tizen: SBS
- The "sdb" utility from the Tizen SDK (usually installed as
SDK/sdb/sdb
)
Need help? Want to discuss?
Go to the tizentalk.com forum thread and post your comments, suggestions and questions there :)
Building Python 2.7 from source
TODO: Add instructions
Building SDL 1.2, PyGame and related libraries
TODO: Add instructions
Build order (prefix is always
/opt/sdl-1.2.15/
):- SDL 1.2.15
- SDL_ttf 2.0.11, with: freetype 2.4.9
- SDL_image 1.2.12, with: libpng 1.5.10, jpegsrc v6b
- SDL_mixer 1.2.12, with: libogg 1.3.0, libvorbis 1.3.3, smpeg SVN
- PyGame 1.9.1 (requires all of the above + Python)
./configure
line needed to find some libraries:PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/sdl-1.2.15/lib/pkgconfig/ ./configure \
--prefix=/opt/sdl-1.2.15/ \
--with-sdl-prefix=/opt/sdl-1.2.15/ \
CPPFLAGS="-I /opt/sdl-1.2.15/include/" \
LDFLAGS="-L/opt/sdl-1.2.15/lib/"
jpegsrc needs
make install-lib
in addition to make install
to build. Also, you need to add -fPIC
to CFLAGS
in jpegsrc's Makefile
.Downloads
- All-in-one package: pygame_tizen.tgz
(Python 2.7.3, SDL 1.2.15, PyGame 1.9.1 and dependencies) - Download source tarballs from Sourceforge.net
Installation
- Download
pygame_tizen.tgz
from above - Copy to device:
sdb push pygame_tizen.tgz /root/
- Connect to shell:
sdb shell
- Extract archive:
tar xvzf /root/pygame_tizen.tgz -C /
- Test if Python works:
/opt/python/bin/python
- If you get greeted by a Python shell, congratulations! (otherwise, contact me)
Running PyGame-based games
You can now start writing your own game by following the PyGame tutorials, reading the API docs or download a project from the "projects" section on the PyGame website. The example game shown in the video is samegame by Joel Murielle. You can install and run it like this (in case the file is down, use the local mirror):
wget http://joel-murielle.perso.sfr.fr/sg.py
sdb push sg.py /root/
sdb shell
/opt/python/bin/python /root/sg.py
Comments
Post a Comment