[Python-ideas] Adding iOS/Android support to Python

Russell Keith-Magee russell at keith-magee.com
Sun Oct 26 01:40:47 CEST 2014


On Sat, Oct 25, 2014 at 11:42 PM, Antoine Pitrou <solipsis at pitrou.net>
wrote:

> On Sat, 25 Oct 2014 10:20:05 +0800
> Russell Keith-Magee <russell at keith-magee.com>
> wrote:
> >
> > In particular, there are four areas where I can see changes required:
> >
> >  1) At least 2 new sys.platform definitions - "ios" and "android" (a
> third
> > "iossimulator" platform might also be needed - the iOS simulator has
> enough
> > differences that it can be helpful to be able to identify the platform)
>
> "ios" and "android" sound ok to me. A specific platform for the
> simulator sounds wrong, though. If it simulates iOS, it should
> certainly simulate its platform identification.
>

The iOS simulator is an odd beast. Yes, it's *mostly* like the actual
device, but there are a couple of places where you need to be aware that
you're on a simulator, and deal with it accordingly. For one thing, it's an
i386 "device", rather than ARM; there are also some subtle differences in
the way it deals with device "hardware", like the camera, or interacts with
built-in apps (like the Photo library).

However, for the sake of simplicity, I'll start by assuming that there's
just one "iOS" platform.


> >  2) Modifications to the build system to support cross-platform builds
> for
> > mobile - AFAICT, cross platform builds currently only work on Linux and
> > require readelf; iOS libraries can only be built on Mac, and building
> > Android libraries don't require readelf (AFAICT).
>
> I don't know anything about cross-compiling. The best is that you try
> to whip up a patch and submit it on the tracker.
>
> Also, I suggest you tackle one system at a time. It will be easier to
> review and accept patches if they target only Android or only iOS, as
> opposed to both at the same time.
>

Understood.

>  3) Disabling certain modules on mobile platforms. Supporting modules like
> > linuxaudiodev, ossaudiodev, readline, curses, idle and tkinter on mobile
> > platforms doesn't make much sense; modules likes bsddb and bz2 are
> > difficult to support due to library dependencies; and the need for
> modules
> > like multiprocessing is arguable (and difficult to support on mobile).
>
> Special support for this isn't necessary. If setup.py doesn't find the
> necessary external dependencies, it will skip building those modules.
> If OTOH those modules are built, you can remove them when creating your
> installer (I imagine you won't use "setup.py install" on those
> platforms).
>

Good point - I hadn't thought of that.

Yours,
Russ Magee %-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20141026/48adb735/attachment.html>


More information about the Python-ideas mailing list