Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Maemo: Developers

Failed creating my first .deb package of a Python library for Chinook using Scratchbox

 

 

Maemo developers RSS feed   Index | Next | Previous | View Threaded


a.grandi at gmail

Nov 15, 2007, 1:26 PM

Post #1 of 6 (181 views)
Permalink
Failed creating my first .deb package of a Python library for Chinook using Scratchbox

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,

--
Andrea Grandi
email: a.grandi[at]gmail.com
website: http://www.ptlug.org
_______________________________________________
maemo-developers mailing list
maemo-developers[at]maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


alterego at sdf

Nov 15, 2007, 4:13 PM

Post #2 of 6 (159 views)
Permalink
Re: Failed creating my first .deb package of a Python library for Chinook using Scratchbox [In reply to]

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.
_______________________________________________
maemo-developers mailing list
maemo-developers[at]maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


a.grandi at gmail

Nov 16, 2007, 8:31 AM

Post #3 of 6 (157 views)
Permalink
Re: Failed creating my first .deb package of a Python library for Chinook using Scratchbox [In reply to]

Hi,

> 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.

the problem is that I cannot install that library even if I use the
python way. For example:

[sbox-CHINOOK_ARMEL: ~/flickrapi-0.15] > python2.5 setup.py install

gives me that long list of these errors:

sem_post: Function not implemented
sem_post: Function not implemented
sem_post: Function not implemented
....

> 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).

I've build essentials on my Ubuntu machine (is the OS I use). Bur I
cannot find the "host-toolchain" package anywhere :(
Where can I find it?

> The commands to create the HOST scratchbox target are:
>
> sb-conf setup HOST --compiler host-gcc --devkits=debian-etc,maemo3-tools,perl

it says:

[sbox-CHINOOK_X86: ~] > sb-conf setup HOST --compiler host-gcc
--devkits=debian-etc,maemo3-tools,perl
sb-conf: No such compiler: host-gcc


> 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.

how can I do this thing?

> 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

but I cannot build the ARMEL version :(

> 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.

I hope you can give me further information, because I'm missing a lot
of things ;)

Thanks!

--
Andrea Grandi
email: a.grandi[at]gmail.com
website: http://www.ptlug.org
_______________________________________________
maemo-developers mailing list
maemo-developers[at]maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


setanta at gmail

Nov 16, 2007, 11:03 AM

Post #4 of 6 (158 views)
Permalink
Re: Failed creating my first .deb package of a Python library for Chinook using Scratchbox [In reply to]

Hi Andrea,

there is a patched version of qemu-arm[1] maintained by Lauro Venâncio, I
installed it on my scratchbox and a lot of warnings like yours have
disappeared. I even tried to install the flickr library, but didn't succeed
for the lack of distutils.core package, but this is another problem. I at
least have entered the flickrapi directory, started python2.5 and
successfully imported all but one file (tokencache.py).

So, here goes the procedure to install the patched qemu, These are to be
performed on the host machine, outside scratchbox, and it will be better to
be logged out from it. Thanks to Lauro for the tips.

1. You need gcc 3.4
sudo apt-get install gcc-3.4

2. Get the patched qemu-arm. Notice that the patches are already applied,
everything is here, and you don't need to get the qemu sources.

svn co https://qemu-arm-eabi.svn.sourceforge.net/svnroot/qemu-arm-eabiqemu-arm-eabi
cd qemu-arm-eabi
./configure --target-list=arm-linux-user --static
make

3. Copy qemu to the cputransp dir on scratchbox
sudo cp arm-linux-user/qemu-arm
/scratchbox/devkits/cputransp/bin/qemu-arm-eabi-sb2

4. Add it to the list of cputransp methods. Open the file
sudo vim /scratchbox/devkits/cputransp/etc/cputransp-methods

and add this line:

qemu-arm-eabi-sb2

5. Configure the target to use the patched qemu as transparency method. Edit
the file:
vim /scratchbox/users/USERNAME/targets/SDK_BETA_ARMEL.config

and change this line:

SBOX_CPUTRANSPARENCY_METHOD=/scratchbox/devkits/cputransp/bin/qemu-arm-eabi-sb2

And this is it. Enter scratchbox and start python (i'm using 2.5, from
extras repository). With the regular qemu just starting it will cause a lot
of warning messages to appear, but with the qemu-arm-eabi everything should
went smoothly.


[1] http://sourceforge.net/projects/qemu-arm-eabi/

--
Marcelo Lira dos Santos
http://setanta.wordpress.com
@CInLUG: http://www.cin.ufpe.br/~cinlug
@Ciência Livre: http://www.ciencialivre.pro.br
@INdT: http://www.indt.org.br


setanta at gmail

Nov 16, 2007, 11:11 AM

Post #5 of 6 (155 views)
Permalink
Re: Failed creating my first .deb package of a Python library for Chinook using Scratchbox [In reply to]

Andrea,

an update, thanks to Osvaldo tip I managed to install flickrapi without
errors. I just needed to install the python2.5-dev package, again from
chinook extras repository.

Lauro and Osvaldo, having you guys around is very useful. :D

On Nov 16, 2007 4:03 PM, Marcelo Lira <setanta[at]gmail.com> wrote:

> Hi Andrea,
>
> there is a patched version of qemu-arm[1] maintained by Lauro Venâncio, I
> installed it on my scratchbox and a lot of warnings like yours have
> disappeared. I even tried to install the flickr library, but didn't succeed
> for the lack of distutils.core package, but this is another problem. I at
> least have entered the flickrapi directory, started python2.5 and
> successfully imported all but one file (tokencache.py).
>
> So, here goes the procedure to install the patched qemu, These are to be
> performed on the host machine, outside scratchbox, and it will be better to
> be logged out from it. Thanks to Lauro for the tips.
>
> 1. You need gcc 3.4
> sudo apt-get install gcc-3.4
>
> 2. Get the patched qemu-arm. Notice that the patches are already applied,
> everything is here, and you don't need to get the qemu sources.
>
> svn co https://qemu-arm-eabi.svn.sourceforge.net/svnroot/qemu-arm-eabiqemu-arm-eabi
> cd qemu-arm-eabi
> ./configure --target-list=arm-linux-user --static
> make
>
> 3. Copy qemu to the cputransp dir on scratchbox
> sudo cp arm-linux-user/qemu-arm
> /scratchbox/devkits/cputransp/bin/qemu-arm-eabi-sb2
>
> 4. Add it to the list of cputransp methods. Open the file
> sudo vim /scratchbox/devkits/cputransp/etc/cputransp-methods
>
> and add this line:
>
> qemu-arm-eabi-sb2
>
> 5. Configure the target to use the patched qemu as transparency method.
> Edit the file:
> vim /scratchbox/users/USERNAME/targets/SDK_BETA_ARMEL.config
>
> and change this line:
>
>
> SBOX_CPUTRANSPARENCY_METHOD=/scratchbox/devkits/cputransp/bin/qemu-arm-eabi-sb2
>
> And this is it. Enter scratchbox and start python (i'm using 2.5, from
> extras repository). With the regular qemu just starting it will cause a lot
> of warning messages to appear, but with the qemu-arm-eabi everything should
> went smoothly.
>
>
> [1] http://sourceforge.net/projects/qemu-arm-eabi/
>
> --
> Marcelo Lira dos Santos
> http://setanta.wordpress.com
> @CInLUG: http://www.cin.ufpe.br/~cinlug <http://www.cin.ufpe.br/%7Ecinlug>
> @Ciência Livre: http://www.ciencialivre.pro.br
> @INdT: http://www.indt.org.br




--
Marcelo Lira dos Santos
http://setanta.wordpress.com
@CInLUG: http://www.cin.ufpe.br/~cinlug
@Ciência Livre: http://www.ciencialivre.pro.br
@INdT: http://www.indt.org.br


a.grandi at gmail

Nov 16, 2007, 3:34 PM

Post #6 of 6 (155 views)
Permalink
Re: Failed creating my first .deb package of a Python library for Chinook using Scratchbox [In reply to]

I finally was able to create the .deb package after applying the qemu patch :)

--
Andrea Grandi
email: a.grandi[at]gmail.com
website: http://www.ptlug.org
_______________________________________________
maemo-developers mailing list
maemo-developers[at]maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers

Maemo developers RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.