Skip to content

Commit e297fe3

Browse files
committed
Added README
1 parent 65c053b commit e297fe3

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

README.rst

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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+

0 commit comments

Comments
 (0)