[PythonCE] pygame / distutils

René Dudfield renesd at gmail.com
Sat Aug 16 03:31:13 CEST 2008


cool.  Thanks for the notes.

I've downloaded the cegcc from here: http://cegcc.sourceforge.net/

I got this file, since I'm using cygwin: cygwin-cegcc-mingw32ce-0.51.0-1.tar.gz
Is that the one you're using?

It seems pythonce itself is compiled with the embedded visual C++ 4.0 :
http://pythonce.sourceforge.net/Wikka/SConsBuild

... now for more reading and tinkering...

cu,


On Sat, Aug 16, 2008 at 12:55 AM, Jared Forsyth <jabapyth at gmail.com> wrote:
> I have successfully compiled SDL, and compiled several SDL programs in
> cegcc.
> To compile SDL:
> Grab SDL 1.2.6 <http://www.libsdl.org/release/SDL-1.2.6.tar.gz>
> Grab this patch
> <http://users.uoa.gr/~knakos/scummvm/libraries/libsdl_20070610_diff>
> Unzip SDL: tar -zxf SDL-1.2.6.tar.gz
> apply the patch (in the base SDL directory): patch -p0 < libsdl*diff
> go into the makefile (created by the patch) and replace all (about 3)
> occurrences of arm-wince-pe with arm-wince-mingw32ce
> run make (it should run without a hitch): ./make
> grab the resulting libSDL.lib from the build directory, drop it in your
> /opt/mingw32ce...../lib/ directory
> dont forget the header files in include/
> And then your good to go!
>
> Heres a command line script you can run:
>
> wget http://www.libsdl.org/release/SDL-1.2.6.tar.gz
> tar -zxf SDL-1.2.6.tar.gz
> cd SDL-1.2.6
> wget http://users.uoa.gr/~knakos/scummvm/libraries/libsdl_20070610_diff
> patch -p0 < libsdl_20070610_diff
> cat Makefile | sed -e 's/arm-wince-pe/arm-wince-mingw32ce/' > Makefile2
> mv Makefile2 Makefile
> make
> sudo cp libSDL.lib /opt/mingw32ce/arm-wince-mingw32ce/lib/
> cd ..
> rm SDL-1.2.6.tar.gz
> rm -r SDL-1.2.6
> wget
> http://users.uoa.gr/~knakos/scummvm/libraries/release-0-10-0/wince-gcc-libs.tar.bz2
> sudo -jxf wince-gcc-libs.ta.bz2
> cd libs/include
> sudo cp sdl /opt/mingw32ce/arm-wince-mingw32ce/include/
> cd ../..
> rm -r libs
> rm wince-gcc-libs.tar.bz2
>
> and your done!! compile SDL programs with the command:
> arm-wince-mingw32ce-gcc testsdl.c -o test.exe -llibSDL
>
> Cheers! Ill probs put this up on the wiki soon...
>
> On Fri, Aug 15, 2008 at 8:26 AM, Adam Walley <adam.walley at gmail.com> wrote:
>>
>> Hi, Rene.
>>
>> Thanks for the clarification on pygame-ctypes. The link where I found the
>> SCUMMVM SDL libraries is here:
>>
>>
>> http://users.uoa.gr/~knakos/scummvm/libraries/release-0-10-0/wince-gcc-libs.tar.bz2
>>
>> There are a number of files in there, including a .diff file which may
>> shed some light on some of the difficulties in compiling the SDL libraries.
>> The SDL version used is 1.2.6. I believe the latest one is 1.2.13, but I
>> think this should not be a big issue to update later.
>>
>> As far as my progress goes, I have got a small pythonCE script running,
>> which draws some coloured squares to the screen (kind of like one of the
>> slide transition effects in powerpoint). The busy indicator no longer
>> interferes with the display :D
>>
>> Now, I am working on a bit of code to allow user input. I am adapting the
>> code to allow key presses of the PDA's hardware function keys to be
>> detected. I would like this to be a small module that can be used in
>> PythonCE to get the scancode from any key press (from the SIP or the
>> hardware keys). I know that SDL provides this, but I am not sure if it will
>> allow the hardware keys to be detected.
>>
>> From what I understand, there is some extra work in writing a PYD module,
>> in contrast to writing a DLL that is called with ctypes. I have not looked
>> into this in great detail yet, but ultimately, I would like to get some DLLs
>> written in the correct form so they can be used as PYDs. I guess there are
>> some basic rules for Python to 'talk' with its package modules.
>>
>> Anyhow, your plan sounds good, so if there's any way I can help just let
>> me know.
>>
>> Adam
>>
>> On 15/08/2008, René Dudfield <renesd at gmail.com> wrote:
>>>
>>> What is the best way to compile extensions for python CE ?
>>>
>>> Adam: do you have a link to those SCUMVM files?
>>>
>>> Any further progress?
>>>
>>> Why not pygame-ctypes?  It was slow, buggy, and non-portable - and C
>>> pygame worked fine.  The author was paid to do it, and stopped when
>>> the money ran out and moved on to pyglet.  pygame has a bunch of C
>>> code which just can't run fast enough in python.  Pygame is not just a
>>> SDL wrapper, it's got a bunch of other code in it too.  ctypes has an
>>> overhead for each call which is annoying for real time apps.
>>> However... pygame-ctypes is still useful for some things, and if pypy
>>> ever gets fast it will become more important (assuming they never
>>> release a C api for pypy).
>>>
>>> anyway...
>>>
>>>
>>> I'd going to try the following order of things...
>>> - get a simple C program to compile and run on the device.
>>> - get a simple C python extension module working.
>>> - get a simple SDL program working.
>>> - get some pygame modules running.
>>> - get full pygame test suite working.
>>> - port pygame example programs so they work ok on pythonCE too.
>>>
>>>
>>>
>>>
>>> On Thu, Aug 7, 2008 at 6:47 PM, Adam Walley <adam.walley at gmail.com>
>>> wrote:
>>> > My plans, exactly ;-) BTW why was pygame-ctypes abandoned? Reading some
>>> > of
>>> > the past info on it, it seemed like a great idea to use the ctypes
>>> > module.
>>> >
>>> > 2008/8/7 René Dudfield <renesd at gmail.com>
>>> >>
>>> >> nice work :)
>>> >>
>>> >> It can be easier to first try and get the SDL test programs compiling.
>>> >>  Then try and get a really simple, minimal python extension
>>> >> compiling... and you guessed it, try and get them both compiling
>>> >> together :)
>>> >>
>>> >> There's a few wince folks hanging out on the libsdl mailing list if
>>> >> you have troubles there.
>>> >>
>>> >> cu,
>>> >>
>>> >>
>>> >>
>>> >> On Wed, Aug 6, 2008 at 9:02 PM, Adam Walley <adam.walley at gmail.com>
>>> >> wrote:
>>> >> > Well, I have been attempting to get something working, but have been
>>> >> > struggling to get the SDL compiled correctly (without SDL, there is
>>> >> > no
>>> >> > point
>>> >> > in trying to get pygame working). In my investigations, I came
>>> >> > across
>>> >> > the
>>> >> > SCUMM forum. Now the SCUMMVM appears to be a fully working product
>>> >> > on
>>> >> > various platforms including WinCE. My attempts to compile some
>>> >> > simple
>>> >> > test
>>> >> > programs using the SDL source available from the official SDL site
>>> >> > failed
>>> >> > (mostly because the source will not compile 'as is' and needs some
>>> >> > tweaking
>>> >> > which is probably beyond my capabilities). However, the SCUMM forum
>>> >> > pointed
>>> >> > me to a set of libraries from 'knakos'. I quickly set up a new
>>> >> > project,
>>> >> > with
>>> >> > my simple test program, and lo! it compiled first time and tested
>>> >> > correctly
>>> >> > on my WM5 device. I assume these SCUMM libraries have already been
>>> >> > adapted
>>> >> > to work on WinCE, and since the SCUMM idea is to get retro graphical
>>> >> > games
>>> >> > working, I think that pygame will probably get all the functionality
>>> >> > it
>>> >> > needs from them.
>>> >> >
>>> >> > Now, on to getting pygame working! I will attempt to get some of the
>>> >> > pygame
>>> >> > source modules compiled as PYDs to see if they will import and work
>>> >> > under
>>> >> > PythonCE. I have not yet attempted to get a DLL compiled using these
>>> >> > new
>>> >> > libraries so may yet hit a wall. I will report back with any news.
>>> >> >
>>> >> > Rene, thanks for your comments. It's nice to know there is interest
>>> >> > from
>>> >> > the
>>> >> > pygame side.
>>> >> >
>>> >> > If anyone else would like to provide comments/advice/code to get
>>> >> > pygame
>>> >> > working, it will be welcomed.
>>> >> >
>>> >> > Adam.
>>> >> >
>>> >> > On 06/08/2008, René Dudfield <renesd at gmail.com> wrote:
>>> >> >>
>>> >> >> Hi,
>>> >> >>
>>> >> >> if anyone has any project files to build pygame on pythonce I'd
>>> >> >> love
>>> >> >> to have them included with pygame.  I'm an author/maintainer of
>>> >> >> pygame
>>> >> >> and have commit access to svn, so could add project files if
>>> >> >> someone
>>> >> >> makes them... I could also add a pygame download for python CE to
>>> >> >> the
>>> >> >> pygame.org download page.
>>> >> >>
>>> >> >> Or you could add compilation instructions to the pygame wiki here:
>>> >> >> http://pygame.org/wiki/CompilePythonCE
>>> >> >>
>>> >> >> I have a winCE phone so would love to be able to get pygame running
>>> >> >> on
>>> >> >> it
>>> >> >> :)
>>> >> >>
>>> >> >>
>>> >> >> cheers,
>>> >> >> _______________________________________________
>>> >> >> PythonCE mailing list
>>> >> >> PythonCE at python.org
>>> >> >> http://mail.python.org/mailman/listinfo/pythonce
>>> >> >
>>> >> >
>>> >
>>> >
>>
>>
>> _______________________________________________
>> PythonCE mailing list
>> PythonCE at python.org
>> http://mail.python.org/mailman/listinfo/pythonce
>>
>
>


More information about the PythonCE mailing list