python for android recipe

123 views
Skip to first unread message

Davide Macocchi

unread,
Nov 3, 2013, 9:18:41 AM11/3/13
to autob...@googlegroups.com
hi guys!
can someone help me writing the recipe to build autobahn module for python-for-android?

Tobias Oberstein

unread,
Nov 5, 2013, 5:46:19 PM11/5/13
to autob...@googlegroups.com
If you mean "Scripting Layer for Android" (SL4A), there are some notes
on the

https://github.com/tavendo/AutobahnPython/blob/master/README.md

/Tobias

>
> --
> You received this message because you are subscribed to the Google
> Groups "Autobahn" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to autobahnws+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

David Chappelle

unread,
Jan 7, 2015, 11:18:21 AM1/7/15
to autob...@googlegroups.com
Any luck with this? I would be curious to know if you managed to get this working and what issues you have run into.

Tobias Oberstein

unread,
Jan 7, 2015, 11:51:55 AM1/7/15
to autob...@googlegroups.com
Hi David,

Am 07.01.2015 um 17:18 schrieb David Chappelle:
> Any luck with this? I would be curious to know if you managed to get
> this working and what issues you have run into.

Sorry, I have never tried that myself. Other have (and had success), and
hence this was added to the README ..

Cheers,
/Tobias

Jakob Lämmle

unread,
Dec 8, 2015, 6:29:27 PM12/8/15
to Autobahn
Hi everybody, I also try to figure out how I can get a recipe done fore buildozer,
cause I want to use autobahn in a kivy app wich is running on android thru python-for-android.
But now I am stuck...

1. I dont know exactly on wich autobahn depends
2. if i let it compile thru buildozer I got the following error:

running build_ext
Twisted found (default reactor is <class 'twisted.internet.epollreactor.EPollReactor'>)
Twisted dropin.cache regenerated.
running build_ext
Twisted found (default reactor is <class 'twisted.internet.epollreactor.EPollReactor'>)
Twisted dropin.cache regenerated.
find: "build/lib.*": Datei oder Verzeichnis nicht gefunden #File or Folder not found
# Command failed: ./distribute.sh -m "kivy twisted autobahn" -d "btms"
#
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
# Please read the full log, and search for it before
# raising an issue with buildozer itself.
# In case of a bug report, please add a full log with log_level = 2

I read about that the byte code is not created....


Here is my recip:

#!/bin/bash

VERSION_autobahn
=${VERSION_autobahn:-0.10.9}
URL_autobahn
=https://pypi.python.org/packages/source/a/autobahn/autobahn-$VERSION_autobahn.tar.gz


DEPS_autobahn
=(python twisted zope six)
MD5_autobahn
=fa90fa91f9c0e711ca6e87c7e9d835b7
#.7 43affb94dc2bcdae9d5d9263211972f1
#.8 d0974e68c93df402a603227cffa061a1
#.9 fa90fa91f9c0e711ca6e87c7e9d835b7
BUILD_autobahn
=$BUILD_PATH/autobahn/$(get_directory $URL_autobahn)
RECIPE_autobahn
=$RECIPES_PATH/autobahn

function prebuild_autobahn() {
    echo
"tty.pyo" >> "${BUILD_PATH}/whitelist.txt"
    echo
"termios.so" >> "${BUILD_PATH}/whitelist.txt"
}

function shouldbuild_autobahn() {
   
if [ -d "$SITEPACKAGES_PATH/autobahn" ]; then
        DO_BUILD
=0
   
fi
}

function build_autobahn() {

    cd $BUILD_autobahn

    push_arm
   
export LDFLAGS="$LDFLAGS -L$LIBS_PATH"
   
export LDSHARED="$LIBLINK"

   
export PYTHONPATH=$SITEPACKAGES_PATH:$BUILDLIB_PATH

   
# fake try to be able to cythonize generated files
    $HOSTPYTHON setup
.py build_ext
   
try find . -iname '*.pyx' -exec $CYTHON {} \;
   
try $HOSTPYTHON setup.py build_ext -v
   
try find build/lib.* -name "*.o" -exec $STRIP {} \;

       
try $BUILD_hostpython/hostpython setup.py install -O2 --root=$BUILD_PATH/python-install --install-lib=lib/python2.7/site-packages

   
try rm -rf $BUILD_PATH/python-install/lib/python*/site-packages/autobahn/test
   
try rm -rf $BUILD_PATH/python-install/lib/python*/site-packages/autobahn/*/test

    unset LDSHARED

    pop_arm
}

function postbuild_autobahn() {
    true
}

Maybe you can point me in the right direction or you get a working one :-)

Thanks !


Roger Erens

unread,
Dec 9, 2015, 7:46:04 PM12/9/15
to Autobahn
Hi Jakob

I used autobahn in a kivy app running on android, and got away by having

requirements = kivy,crossbar

in my buildozer.spec. I'm not sure anymore, but I think I did not use

requirements = kivy,autobahn

because I also needed to import inlineCallbacks from twisted.internet.defer.

It appears to me that there is no need for a recipe when using the Twisted-based autobahn/crossbar.io, since there is a recipe for Twisted already.

See also:
https://github.com/crossbario/crossbarexamples/tree/master/demos/votes/kivy

Op woensdag 9 december 2015 00:29:27 UTC+1 schreef Jakob Lämmle:

Jakob Lämmle

unread,
Dec 12, 2015, 6:04:17 PM12/12/15
to Autobahn
Thank you Roger for your answer.

I also try it with crossbar in the requirements but this not work. Buildozer draws the following error cause the recipe for crossbar is missing.

jaques5@jaques-desktop:~/.buildozer$ buildozer --verbose android debug deploy run
# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Preparing build
# Check requirements for android
# Run 'dpkg --version'
# Cwd None
Debian »dpkg« Paketmanagement-Programm Version 1.18.2 (amd64).
Dies ist freie Software; lesen Sie die GNU General Public License in der
Version 2 oder höher für Kopierbedingungen. Es wird KEINE Haftung übernommen.
# Search for Git (git)
#  -> found at /usr/bin/git
# Search for Cython (cython)
#  -> found at /usr/local/bin/cython
# Search for Java compiler (javac)
#  -> found at /usr/lib/jvm/java-8-oracle/bin/javac
# Search for Java keytool (keytool)
#  -> found at /usr/lib/jvm/java-8-oracle/jre/bin/keytool
# Install platform
# Apache ANT found at /home/jaques5/.buildozer/android/platform/apache-ant-1.9.4
# Android SDK found at /home/jaques5/.buildozer/android/platform/android-sdk-20
# Android NDK found at /home/jaques5/.buildozer/android/platform/android-ndk-r9c
# Check application requirements
# Run './distribute.sh -l'
# Cwd /home/jaques5/.buildozer/.buildozer/android/platform/python-for-android
Available modules: android apsw audiostream bidi boost cherrypy c_igraph click cprotobuf cymunk django docutils ecdsa enum34 evdev ffmpeg ffmpeg2 ffpyplayer ffpyplayer_tito flask freetype gevent greenlet harfbuzz hostpython igraph itsdangerous jinja2 jpeg kivent_core kivent_cymunk kivy leveldb libevent libpq libsodium libswift libtorrent libxml2 libxslt libyaml lxml m2crypto markupsafe midistream msgpack mysql_connector netifaces numpy opencv openssl paramiko pil plyer plyvel png polygon protobuf psutil psycopg2 pyasn1 pycrypto pygame pyjnius pylibpd pyopenssl pyparsing pyqrcode python pyyaml sdl setuptools six sqlalchemy sqlite3 storm swift thrift twisted txws werkzeug wokkel zeroconf zope
# Remove directory and subdirectory /home/jaques5/.buildozer/.buildozer/applibs
# Create directory /home/jaques5/.buildozer/.buildozer/applibs
# Run 'virtualenv --python=python2.7 ./venv'
# Cwd /home/jaques5/.buildozer/.buildozer
/bin/sh: 1: virtualenv: not found
# Command failed: virtualenv --python=python2.7 ./venv

#
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
# Please read the full log, and search for it before
# raising an issue with buildozer itself.
# In case of a bug report, please add a full log with log_level = 2




If its possible it would be nice when you take a look at your buildozer folder there should be a crossbar folder with a recipe.sh file under and if true poste it please:

.buildozer/android/platform/python-for-android/recipes

Thank you!

Roger Erens

unread,
Dec 13, 2015, 4:33:37 AM12/13/15
to autob...@googlegroups.com
Hi Jakob,

you need to take care of the virtualenv issue first (command not found). Then report back again, please.

Cheers,
Roger

--
You received this message because you are subscribed to a topic in the Google Groups "Autobahn" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/autobahnws/iLsJ_tyaah0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to autobahnws+...@googlegroups.com.
To post to this group, send email to autob...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/autobahnws/34f54812-612a-4ec2-bf95-c92735dd101b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jakob Lämmle

unread,
Dec 13, 2015, 8:41:44 AM12/13/15
to Autobahn
Hi Roger,
last night I install buildozer in a virtualenv
like in this tutorial http://www.gurayyildirim.com.tr/howto-install-kivy-and-buildozer-on-ubuntu-15-04-1169.html
installed also twisted, autobahn, crossbar.

Frist I tried with crossbar in the requirements but this raise an error:
Collecting cffi>=1.1.0 (from cryptography>=0.7->pyOpenSSL>=0.11->treq>=15.0.0->crossbar)
 
Using cached cffi-1.3.1.tar.gz
   
Complete output from command python setup.py egg_info:
   
       
No working compiler found, or bogus compiler options
        passed to the compiler
from Python's distutils module.
        See the error messages above.
        (If they are about -mno-fused-madd and you are on OS/X 10.8,
        see http://stackoverflow.com/questions/22313407/ .)
   
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-mXJw2x/cffi
# Command failed: pip install --download-cache=/home/jaques5/.buildozer/cache --target=/home/jaques5/workspace/btms_async/.buildozer/applibs crossbar

#
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
# Please read the full log, and search for it before
# raising an issue with buildozer itself.
# In case of a bug report, please add a full log with log_level = 2


Now I got in the requirements = kivy,autobahn,twisted
Build run fine and my app is running on android.

YES :-)

Crossbar or Autobahn dont show up in the recipe folder like i expected but it is packed directly in applibs.

Thank you for your time!

Roger Erens

unread,
Dec 13, 2015, 6:15:18 PM12/13/15
to autob...@googlegroups.com
...
Now I got in the requirements = kivy,autobahn,twisted
Build run fine and my app is running on android.

YES :-)

\o/ 
Reply all
Reply to author
Forward
0 new messages