| 1 | http://code.google.com/p/android-python27/source/browse/python-build/README |
| 2 | {{{ |
| 3 | # - Based on https://github.com/nonameentername/python-android modified for my needs |
| 4 | # - Tested on Ubuntu 11.04-i386 with Android NDK-6b and NDK-7c, gcc/g++ 4.4 and gcc/g++ 4.5 |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | # 1) Host machine dev env config if needed (package list for 32bit host, package names for 64bit may change) |
| 10 | # check installed package on host machine with: zcat -f /var/log/dpkg.log* | grep "\ install\ " | sort |
| 11 | |
| 12 | |
| 13 | sudo apt-get install build-essential cpp-4.4 g++-4.4 gcc-4.4-base gcc-4.4 bison flex autoconf automake autotools-dev quilt libcurl3 curl openssh-server ant mercurial filezilla pure-ftpd dpatch texinfo libncurses5-dev libgmp3-dev libmpfr-dev gawk patchutils binutils-dev zlib1g-dev |
| 14 | #sudo apt-get install git-core gnupg gperf libc6-dev lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc (Ubuntu 11) |
| 15 | #sudo apt-get install git-core gnupg gperf libc6-dev x11proto-core-dev libx11-dev libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc libreadline-dev libreadline6 ia32-libs-multiarch libzip-dev libzip-dev libzzip-dev libzzip-0-13 (Ubuntu 12) |
| 16 | |
| 17 | |
| 18 | # 2) build python 2.7.2 for Android |
| 19 | |
| 20 | |
| 21 | export NDK="/home/tony/Desktop/xcross/android-ndk-r7c" |
| 22 | export SDK="/home/tony/Desktop/xcross/android-sdk-linux_x86/" |
| 23 | export NDKPLATFORM="$NDK/platforms/android-9/arch-arm" |
| 24 | export PATH="$NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/:$NDK:$SDK/tools:$PATH" |
| 25 | |
| 26 | |
| 27 | bash bootstrap.sh && build.sh && package.sh |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | ------- |
| 33 | |
| 34 | |
| 35 | ./bootstrap.sh |
| 36 | Downloads Python-2.7.2 source |
| 37 | patches Python for android |
| 38 | builds hostpython and hostpgen |
| 39 | |
| 40 | |
| 41 | ./build.sh |
| 42 | builds python library for android |
| 43 | |
| 44 | |
| 45 | ./package.sh |
| 46 | creates python_rxx.zip and python_extras_rxx.zip |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | current status: |
| 52 | Python build finished, but the necessary bits to build these modules were not found: |
| 53 | _bsddb _curses _curses_panel |
| 54 | _tkinter bsddb185 bz2 |
| 55 | dbm dl gdbm |
| 56 | imageop linuxaudiodev nis |
| 57 | ossaudiodev readline sunaudiodev |
| 58 | To find the necessary bits, look in setup.py in detect_modules() for the module's name. |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | Failed to build these modules: |
| 64 | _ctypes_test _locale audioop |
| 65 | grp spwd |
| 66 | }}} |