rjagerman / AT3

Android Tor Tribler Tunneling

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Test libtorrent with python bindings or write our own python wrapper

rjagerman opened this issue · comments

Since libtorrent is troublesome to compile with python bindings on android, we might have to write our own python wrapper.

Compiling libtorrent with automake generates the wrong link flags for python. It generates -lpthread -lutil and -ldl, which are not available on the Android platform. The reason for this is because autoconfig internally calls a python script to get these values. But the python interpreter that runs is the system installation one (from ubuntu), and not the android one. This results in wrong configuration settings.

To solve this I have created a simple python app that can run on the android phone. It prints the configuration settings to logcat output. I can then manually place these values in libtorrent's m4/ax_python_devel.m4 and rerun bootstrap.sh and get python bindings to compile.

Libtorrent and the python bindings are working with minimal modifications to the source!

By correctly setting the environment's PYTHON and PYTHON_CPP_FLAGS we can get the python bindings to compile with a compatible python-installation from python-for-android. The resulting libtorrent.so has been tested with a simple python torrent client that downloads the ubuntu 14.04 iso. I computed the md5 checksum of the downloaded iso file and it is correct.

The compiled libtorrent.so is placed in a recipe which is available on our python-for-android fork. We should test if this file works on all our devices.

I will write extensive documentation on the build process and possibly write an easy to reproduce recipe script that can build it standalone.