Topic: Python 3.2 and OpenWRT

Has anyone cross-compiled Python 3.2 for OpenWRT ? If yes, could you post the makefile for it? smile

I would be much appreciated! smile

Re: Python 3.2 and OpenWRT

Can anyone have a complete package for ar71xx(10.03.1)?


thank you

Re: Python 3.2 and OpenWRT

Python 3 already exists for quite sometime. I think it deserves it's presence on the package tree! smile

4 (edited by Claymore 2012-05-24 04:11:37)

Re: Python 3.2 and OpenWRT

Ok I have been banging my head here for the last 3 days or so...

I have been trying to follow these examples
http://randomsplat.com/id5-cross-compiling-python-for-embedded-linux.html
http://wiki.openwrt.org/doc/devel/crosscompile

So far, I have not succeeded... Can anyone help me Cross-Compiling Python 3.2 for the IXP4xx ?

Re: Python 3.2 and OpenWRT

I have thought about making a python3 package since the update to 2.7. The build process is quite similar.
Might have something usable in not too long, provided that you can compile it yourselves.

Claymore wrote:

Ok I have been banging my head here for the last 3 days or so...

I have been trying to follow these examples
http://randomsplat.com/id5-cross-compiling-python-for-embedded-linux.html
http://wiki.openwrt.org/doc/devel/crosscompile

So far, I have not succeeded... Can anyone help me Cross-Compiling Python 3.2 for the IXP4xx ?

I don't think you are going to have much luck with those, better to start with the 2.7 package already in OpenWrt.

6 (edited by buffl 2012-05-24 22:08:03)

Re: Python 3.2 and OpenWRT

Claymore wrote:

So far, I have not succeeded... Can anyone help me Cross-Compiling Python 3.2 for the IXP4xx ?

there may be here to see prices http://code.google.com/p/wl500g-repo/

I wanted to install a script to send sms written for 3.2.1, 2.7 not working.

Re: Python 3.2 and OpenWRT

This compiles and runs, but hardly tested at all:
https://gitorious.org/openwrt-cybjit/op … 9f1e6096e4

8 (edited by Claymore 2012-05-24 23:15:08)

Re: Python 3.2 and OpenWRT

Thanks for the assistance, but today I was also able to cross-compile Python 3.2.3 smile I also added zlib to python but I was unable to add bz2 and some other modules. I will post after I test it. smile


PS: I just checked the Makefile you posted. This seems to be very complete! Thanks! smile

9 (edited by Claymore 2012-05-25 17:42:49)

Re: Python 3.2 and OpenWRT

Hello again! I'm not going to post my experiments in cross-compiling python 3.2.3 since Cybit posted a much more expert and proper solution.

@Cybjit
Thanks for your support!
I have successfully installed Python 3.2.3 in Gateworks Cambria GW2358-4 with the proper packages configuration that you suplied, but I had some complications with some extra-packages.
I still have not fully tested the default Python3 instalation but the interpreter starts without any kind of problem.

When I tried to install packages  python3-bzip2_3.2.3-1_ixp4xx-2.4.ipk, python3-gzip_3.2.3-1_ixp4xx.ipk and python3-shutil_3.2.3-1_ixp4xx.ipk, this is what happend.

 
root@OpenWrt:/mnt/cf# opkg install python3-bzip2_3.2.3-1_ixp4xx.ipk
Installing python3-bzip2 (3.2.3-1) to root...
Collected errors:
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for python3-bzip2:
 *      libbz2 *
 * opkg_install_cmd: Cannot install package python3-bzip2.

root@OpenWrt:/mnt/cf# opkg install python3-gzip_3.2.3-1_ixp4xx.ipk
Installing python3-gzip (3.2.3-1) to root...
Collected errors:
 * check_data_file_clashes: Package python3-gzip wants to install file /usr/lib/python3.2/gzip.py
        But that file is already provided by package  * python3
 * opkg_install_cmd: Cannot install package python3-gzip.

root@OpenWrt:/mnt/cf# opkg install python3-shutil_3.2.3-1_ixp4xx.ipk
Installing python3-shutil (3.2.3-1) to root...
Collected errors:
 * check_data_file_clashes: Package python3-shutil wants to install file /usr/lib/python3.2/shutil.py
        But that file is already provided by package  * python3
 * opkg_install_cmd: Cannot install package python3-shutil.

The rest of the Python3 extra packages installed just fine!

I will ask to the developers to add your Python 3.2.3 customized makefiles to the trunk smile I think this is going to make lots of people happy!
Again, thanks! smile

Re: Python 3.2 and OpenWRT

Claymore wrote:

Hello again! I'm not going to post my experiments in cross-compiling python 3.2.3 since Cybit posted a much more expert and proper solution.

@Cybjit
Thanks for your support!
I have successfully installed Python 3.2.3 in Gateworks Cambria GW2358-4 with the proper packages configuration that you suplied, but I had some complications with some extra-packages.
I still have not fully tested the default Python3 instalation but the interpreter starts without any kind of problem.

When I tried to install packages  python3-bzip2_3.2.3-1_ixp4xx-2.4.ipk, python3-gzip_3.2.3-1_ixp4xx.ipk and python3-shutil_3.2.3-1_ixp4xx.ipk, this is what happend.

 
root@OpenWrt:/mnt/cf# opkg install python3-bzip2_3.2.3-1_ixp4xx.ipk
Installing python3-bzip2 (3.2.3-1) to root...
Collected errors:
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for python3-bzip2:
 *      libbz2 *
 * opkg_install_cmd: Cannot install package python3-bzip2.

root@OpenWrt:/mnt/cf# opkg install python3-gzip_3.2.3-1_ixp4xx.ipk
Installing python3-gzip (3.2.3-1) to root...
Collected errors:
 * check_data_file_clashes: Package python3-gzip wants to install file /usr/lib/python3.2/gzip.py
        But that file is already provided by package  * python3
 * opkg_install_cmd: Cannot install package python3-gzip.

root@OpenWrt:/mnt/cf# opkg install python3-shutil_3.2.3-1_ixp4xx.ipk
Installing python3-shutil (3.2.3-1) to root...
Collected errors:
 * check_data_file_clashes: Package python3-shutil wants to install file /usr/lib/python3.2/shutil.py
        But that file is already provided by package  * python3
 * opkg_install_cmd: Cannot install package python3-shutil.

The rest of the Python3 extra packages installed just fine!

I will ask to the developers to add your Python 3.2.3 customized makefiles to the trunk smile I think this is going to make lots of people happy!
Again, thanks! smile

smile

python3-bzip2 depends on libbz2, you will have to install that separately.

The other problems you encounter also exists in the python packages since 2010.
The files in python3-shutil and python3-gzip are already included in python3, they seem to only be intended for use with python3-mini.

It is unfortunately hard to split up Python into several pieces without getting into dependency hell. Might have a improved version soon.

Re: Python 3.2 and OpenWRT

python3-bzip2 depends on libbz2, you will have to install that separately.

Hmm, I thought that to at the moment and I tried to install libbz2, but it seems that there is no libbz2 for the Cambria GW2358-4 :S I guess this is another cross-compile to deal with, lol smile

Re: Python 3.2 and OpenWRT

OK, better dependencies now:
https://gitorious.org/openwrt-cybjit/op … 7e206f253f

Re: Python 3.2 and OpenWRT

Ok, everything seems to work nicely now smile Unfortunatly the SBC that I was using, the Cambria, was taken from me for another project for a short time... :'( When I get it again, I will update this topic with my experience smile

Thanks again, for your effort! smile

14 (edited by Claymore 2012-06-08 18:14:08)

Re: Python 3.2 and OpenWRT

Hello Again!

It appears that the opkg is getting confused about python-mini, when installing python 2.7 if python 3.2 is already installed. This error appeared to me, when trying to install python 2

root@OpenWrt:~# opkg update
Downloading http://downloads.openwrt.org/backfire/10.03.1/ixp4xx_generic/packages/Packages.gz.
Inflating http://downloads.openwrt.org/backfire/10.03.1/ixp4xx_generic/packages/Packages.gz.
Updated list of available packages in /var/opkg-lists/packages.
root@OpenWrt:~# opkg install python
Installing python (2.6.4-3) to root...
Downloading http://downloads.openwrt.org/backfire/10.03.1/ixp4xx_generic/packages/python_2.6.4-3_ixp4xx.ipk.
Installing python-mini (2.6.4-3) to root...
Downloading http://downloads.openwrt.org/backfire/10.03.1/ixp4xx_generic/packages/python-mini_2.6.4-3_ixp4xx.ipk.
Collected errors:
 * check_data_file_clashes: Package python-mini wants to install file /usr/bin/python
        But that file is already provided by package  * python3-mini
 * opkg_install_cmd: Cannot install package python.

I believe the python 3.2 is installing the alias python for the python32 executable and the python26 gets confused with that and believes it is already installed...

Re: Python 3.2 and OpenWRT

Claymore wrote:

Hello Again!

It appears that the opkg is getting confused about python-mini, when installing python 2.7 if python 3.2 is already installed. This error appeared to me, when trying to install python 2

root@OpenWrt:~# opkg update
Downloading http://downloads.openwrt.org/backfire/10.03.1/ixp4xx_generic/packages/Packages.gz.
Inflating http://downloads.openwrt.org/backfire/10.03.1/ixp4xx_generic/packages/Packages.gz.
Updated list of available packages in /var/opkg-lists/packages.
root@OpenWrt:~# opkg install python
Installing python (2.6.4-3) to root...
Downloading http://downloads.openwrt.org/backfire/10.03.1/ixp4xx_generic/packages/python_2.6.4-3_ixp4xx.ipk.
Installing python-mini (2.6.4-3) to root...
Downloading http://downloads.openwrt.org/backfire/10.03.1/ixp4xx_generic/packages/python-mini_2.6.4-3_ixp4xx.ipk.
Collected errors:
 * check_data_file_clashes: Package python-mini wants to install file /usr/bin/python
        But that file is already provided by package  * python3-mini
 * opkg_install_cmd: Cannot install package python.

I believe the python 3.2 is installing the alias python for the python32 executable and the python26 gets confused with that and believes it is already installed...

That should be fixed since commit e83860a2, are you using the first commit?
I changed it so python and python2 are Python 2 and python3 is Python 3 (see http://www.python.org/dev/peps/pep-0394/).

Re: Python 3.2 and OpenWRT

Hmm, that might be the problem then!
I will check back when I put my hands again on the SBC's smile

Thanks!

Re: Python 3.2 and OpenWRT

trunk has added python-ncurses, so I rebased my branch.
It is probably easiest to just link the tree instead: https://gitorious.org/openwrt-cybjit/openwrt-cybjit-packages/trees/master/lang/python3

I also discovered some problems building python and python3 at the same time, this should hopefully be fixed.

Re: Python 3.2 and OpenWRT

Thanks smile I and others appreciate your work smile

Re: Python 3.2 and OpenWRT

Hello Again!

Python 3.3 was released a week ago and with it, the new OpenWRT version
I would like to ask you, if you could please, update the package script to support the lates version?  It would be a great help.
Thanks for your effort!

20 (edited by Cybjit 2012-10-08 21:40:35)

Re: Python 3.2 and OpenWRT

Claymore wrote:

Hello Again!

Python 3.3 was released a week ago and with it, the new OpenWRT version
I would like to ask you, if you could please, update the package script to support the lates version?  It would be a great help.
Thanks for your effort!

I actually already have a repository with 3.3, that should be easier to integrate with the standard build. I have just not posted about how to use it yet.


Make sure git is installed.
In buildroot dir create feeds.conf if it does not exist

[ ! -e feeds.conf ] && cp feeds.conf.default feeds.conf

Add the repository to feeds.conf

echo src-git python3 git://gitorious.org/openwrt-cybjit/python3.git >> feeds.conf

Update and install the feed

./scripts/feeds update python3
./scripts/feeds install python3

Select the python3 packages in menuconfig, and build.

Re: Python 3.2 and OpenWRT

Nice! Thanks! smile

Re: Python 3.2 and OpenWRT

Cybjit wrote:

I actually already have a repository with 3.3, that should be easier to integrate with the standard build. I have just not posted about how to use it yet.


Make sure git is installed.
In buildroot dir create feeds.conf if it does not exist

[ ! -e feeds.conf ] && cp feeds.conf.default feeds.conf

Add the repository to feeds.conf

echo src-git python3 git://gitorious.org/openwrt-cybjit/python3.git >> feeds.conf

Update and install the feed

./scripts/feeds update python3
./scripts/feeds install python3

Select the python3 packages in menuconfig, and build.

I followed those direction while building barrier breaker.  I get the following failure:
Package python3 is missing dependencies for the following libraries: libdb-4.7.so

I have libdb47 and libdb47xx both selected and built.  I simply selected python3 (and python3-mini) in make menuconfig and got that error. 

What do I do?

23

Re: Python 3.2 and OpenWRT

You need to add "+libdb47" to the python3 Makefile DEPENDS:= line.

Re: Python 3.2 and OpenWRT

jow wrote:

You need to add "+libdb47" to the python3 Makefile DEPENDS:= line.

define Package/python3
$(call Package/python3/Default)
  TITLE+= (full)
  DEPENDS:=+python3-mini +libdb47
endef

I'll let you know if that fixes it.  Thanks for your help, BTW.

Re: Python 3.2 and OpenWRT

That did fix it.  Thank you for your help.  I'm pleasantly surprised that I got a response on such an old thread.  smile