2011-12-06 18:18:42 +01:00
|
|
|
Kivy for IOS
|
|
|
|
============
|
|
|
|
|
2015-08-13 05:11:32 +02:00
|
|
|
This toolchain is designed to compile the necessary libraries for iOS to run
|
|
|
|
your application and manage the creation of the Xcode project.
|
2011-12-06 18:18:42 +01:00
|
|
|
|
2015-08-13 05:11:32 +02:00
|
|
|
Currently, we do not provide any binary distributions of this toolchain, but we
|
|
|
|
aim to. Until then, you do need to compile it at least once before creating
|
|
|
|
your Xcode project.
|
2015-02-20 11:34:06 +01:00
|
|
|
|
|
|
|
The toolchain supports:
|
|
|
|
|
|
|
|
- iPhone Simulator (x86 and x86_64)
|
|
|
|
- iPhone / iOS (armv7 and arm64)
|
|
|
|
|
2015-08-13 05:11:32 +02:00
|
|
|
These recipes are not ported to the new toolchain yet:
|
2015-02-24 12:03:54 +01:00
|
|
|
|
|
|
|
- openssl
|
|
|
|
- openssl-link
|
2015-02-25 19:48:58 +01:00
|
|
|
- lxml
|
2015-02-24 12:03:54 +01:00
|
|
|
|
2015-02-20 11:34:06 +01:00
|
|
|
|
|
|
|
Requirements
|
|
|
|
------------
|
|
|
|
|
2015-08-13 05:11:32 +02:00
|
|
|
Currently, the toolchain requires a few tools for compilation. You will need:
|
2015-02-20 11:34:06 +01:00
|
|
|
|
2015-08-13 05:11:32 +02:00
|
|
|
#. Xcode 6 or above, with an iOS SDK and command line tools installed::
|
2015-03-05 17:29:44 +01:00
|
|
|
|
|
|
|
xcode-select --install
|
|
|
|
|
2015-08-13 05:11:32 +02:00
|
|
|
#. Using brew, you can install the following dependencies::
|
2012-07-07 22:19:36 +02:00
|
|
|
|
2015-02-20 11:34:06 +01:00
|
|
|
brew install autoconf automake libtool pkg-config
|
2012-07-07 22:19:36 +02:00
|
|
|
brew link libtool
|
2012-07-18 19:52:11 +02:00
|
|
|
|
2015-02-20 11:34:06 +01:00
|
|
|
#. Install Cython (0.21)::
|
2012-12-14 00:54:05 +01:00
|
|
|
|
|
|
|
# pip method if available (sudo might be needed.)
|
2015-02-20 11:34:06 +01:00
|
|
|
pip install cython==0.21
|
|
|
|
|
|
|
|
|
|
|
|
Using the toolchain
|
|
|
|
-------------------
|
|
|
|
|
|
|
|
Any Python extensions or C/C++ library must be compiled: you need to have what
|
|
|
|
we call a `recipe` to compile it. For example, Python, libffi, SDL2, SDL_image,
|
|
|
|
freetype... all the dependencies, compilation and packaging instructions are
|
|
|
|
contained in a `recipe`.
|
|
|
|
|
2015-08-13 05:11:32 +02:00
|
|
|
You can list the available recipes and their versions with::
|
2015-02-20 11:34:06 +01:00
|
|
|
|
|
|
|
$ ./toolchain.py recipes
|
|
|
|
freetype 2.5.5
|
|
|
|
hostpython 2.7.1
|
|
|
|
ios master
|
|
|
|
kivy ios-poly-arch
|
|
|
|
libffi 3.2.1
|
|
|
|
pyobjus master
|
|
|
|
python 2.7.1
|
|
|
|
sdl2 iOS-improvements
|
|
|
|
sdl2_image 2.0.0
|
|
|
|
sdl2_mixer 2.0.0
|
|
|
|
sdl2_ttf 2.0.12
|
|
|
|
|
2015-08-13 05:11:32 +02:00
|
|
|
Then, start the compilation with::
|
2015-02-20 11:34:06 +01:00
|
|
|
|
|
|
|
$ ./toolchain.py build kivy
|
|
|
|
|
2015-08-13 05:11:32 +02:00
|
|
|
The Kivy recipe depends on several others, like the sdl* and python recipes.
|
|
|
|
These may in turn depend on others e.g. sdl2_ttf depends on freetype, etc.
|
|
|
|
You can think of it as follows: the kivy recipe will compile everything
|
2015-02-20 11:34:06 +01:00
|
|
|
necessary for a minimal working version of Kivy.
|
|
|
|
|
2015-08-13 05:11:32 +02:00
|
|
|
Don't grab a coffee, just do diner. Compiling all the libraries for the first
|
|
|
|
time, 4x over (remember, 4 archs, 2 per platforms), will take time. (TODO:
|
|
|
|
provide a way to not compile for the simulator.).
|
2015-02-20 11:34:06 +01:00
|
|
|
|
|
|
|
Create the Xcode project
|
|
|
|
------------------------
|
|
|
|
|
2015-08-13 05:11:32 +02:00
|
|
|
The `toolchain.py` can create the initial Xcode project for you::
|
2015-02-20 11:34:06 +01:00
|
|
|
|
|
|
|
$ # ./toolchain.py create <title> <app_directory>
|
|
|
|
$ ./toolchain.py create Touchtracer ~/code/kivy/examples/demo/touchtracer
|
|
|
|
|
|
|
|
Your app directory must contain a main.py. A directory named `<title>-ios`
|
|
|
|
will be created, with an Xcode project in it.
|
2015-08-13 05:11:32 +02:00
|
|
|
You can open the Xcode project using::
|
2015-02-20 11:34:06 +01:00
|
|
|
|
|
|
|
$ open touchtracer-ios/touchtracer.xcodeproj
|
|
|
|
|
|
|
|
Then click on `Play`, and enjoy.
|
|
|
|
|
|
|
|
.. notes::
|
|
|
|
|
|
|
|
Everytime you press `Play`, your application directory will be synced to
|
|
|
|
the `<title>-ios/YourApp` directory. Don't make changes in the -ios
|
|
|
|
directory directly.
|
|
|
|
|
2015-03-05 17:29:44 +01:00
|
|
|
FAQ
|
|
|
|
---
|
|
|
|
|
|
|
|
Fatal error: "stdio.h" file not found
|
|
|
|
You need to install the Command line tools: `xcode-select --install`
|