[maemo-developers] Failed creating my first .deb package of a Python library for Chinook using Scratchbox

From: alterego at sdf.lonestar.org alterego at sdf.lonestar.org
Date: Fri Nov 16 02:13:33 EET 2007
On Thu, Nov 15, 2007 at 10:26:31PM +0100, Andrea Grandi wrote:
> Hi,
> I need to port a Python library to Chinook, because I'm developing a
> Python application that uses that library.
> This is the library: http://flickrapi.sourceforge.net/
> it's an API for Flickr (I'm writing a client that upload pictures to Flickr).
> I was able to install the library into the SDK, in Scratchbox (using
> the x86 target) but I've this two problems:
> - in the x86 target I executed: fakeroot python2.5 setup.py install
> and the library was installed correctly (my simple test application
> works fine). When I select the other target (ARMEL), I'm not able to
> install that library with the same command :(
> I get these errors: http://pastebin.ca/776094
> - the second problem I when I try to create the .deb package. I can
> create it in the x86 target (I followed this guide:
> http://pymaemo.garage.maemo.org/documentation/pymaemo_tutorial/python_maemo_howto.html#link22
> ) but I'm not able to create it under the ARMEL target, and I get
> these errors: http://pastebin.ca/776101
> Where I'm doing mistakes creating this package?
> Thanks for your help!
> Best regards,

Hello Andrea,

  You're not doing anything wrong. The problem you have is pretty common, at
least in my experiences. The version of Qemu which emulates the ARM core in
scratchbox isn't complete, so certain libraries (glibc) cause the emulator to
complain when it gets given an instruction that is not supported. As your
build process relies upon python during it's operation, it uses the python that
is built for the target you're using (ARMEL) which in turn makes qemu die.

  It is possible to work around this problem by compiling python for a HOST
target, the HOST target is the machine you're using for scratchbox development.
Firstly you need to create this target by installing the host-toolchain package
(making sure you have build-essentials installed on your host installation).

The commands to create the HOST scratchbox target are:

  sb-conf setup HOST --compiler host-gcc --devkits=debian-etc,maemo3-tools,perl
  sb-conf install HOST --etc --devkits --fakeroot

  Once you've created and selected this target you must then build python and
install it somewhere that wont change as you change to other targets, basicallyinstall it into your scratchbox home directory.

  Now you've setup a host native python, you need to use that python and not
the python package built for the devices (ARMEL) so either remove that and
make sure that the python version you just compiled is in your PATH. Or check
to see if there is a configuration option to specify which python binary the
build process uses.

  This post is a bit rough and I'll probably document it a bit better in the
future as a blog entry or something similar. Hope it helps.

  Happy hacking, Tom.

More information about the maemo-developers mailing list