File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed
Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change 1+ Python Cross Compiling Example
2+ ==============================
3+
4+ This repository is a worked example of cross compiling a non-trivial Python app
5+ to run on Android. It is the companion to the Python Cross-Compiling Guide (as
6+ yet unpublished). The makefile above will download all dependencies, build
7+ them, and produce a tarball containing:
8+
9+ - Python 3.6 for Android (ARM)
10+ - numpy
11+ - Pandas
12+ - matplotlib
13+ - Pillow
14+ - Example Python scripts
15+
16+
17+ Building
18+ ========
19+
20+ The makefile is written and tested on Ubuntu 16.04. Consult
21+ ``docker/Dockerfile `` in this repository for details of the prerequisites that
22+ should be installed on the build machine.
23+
24+ To build, it should be enough to run ``make ``.
25+
26+ To build using Docker:
27+
28+ .. code :: sh
29+
30+ $ docker run --rm \
31+ -v /path/to/working:/working \
32+ -v /path/to/output:/output \
33+ -v /path/to/this/repo:/source \
34+ benfogle/python-cross-compiling-example
35+
36+ Where ``working `` is a scratch directory for intermediate build files.
37+
38+
39+ Running
40+ =======
41+
42+ To run, use adb to push the resulting files to the Android device. Rather than
43+ run Python directly, which requires setting ``LD_LIBRARY_PATH ``, run the script
44+ ``bin/apython ``, which will set it for you. Examples are in the
45+ ``examples `` directory.
46+
You can’t perform that action at this time.
0 commit comments