@@ -24,32 +24,30 @@ for packaging. Otherwise the latest build from kivy.org using Kivy
24
24
master will be downloaded and used.
25
25
26
26
If you want to package for python 3.x.x simply download the package
27
- named Kivy3.7z from the download sectoin of Kivy.org and extract it
28
- to Kivy.app in /Applications.
29
-
30
- Then run.
27
+ named Kivy3.7z from the download section of kivy.org and extract it
28
+ to Kivy.app in /Applications, then run::
31
29
32
30
buildozer osx debug
33
31
34
- Once the app is packaged, you might want to remove extra un needed
35
- packages like gstreamer framework etc from it if you don't use video.
36
- Same logic implies for other things you do not use, just reduce
37
- the package to it's minimal state that is needed for the app to run.
32
+ Once the app is packaged, you might want to remove unneeded
33
+ packages like gstreamer, if you don't need video support .
34
+ Same logic applies for other things you do not use, just reduce
35
+ the package to its minimal state that is needed for the app to run.
38
36
39
- As a example we are including the showcase example packaged using
40
- this method for both python 2 (9.xMB) and 3(15.xMB), you can find the
41
- packages here
37
+ As an example we are including the showcase example packaged using
38
+ this method for both Python 2 (9.xMB) and 3 (15.xMB), you can find the
39
+ packages here:
42
40
https://drive.google.com/drive/folders/0B1WO07-OL50_alFzSXJUajBFdnc .
43
41
44
42
That's it. Enjoy!
45
43
46
- buildozer right now uses the Kivy sdk method to package your app.
44
+ Buildozer right now uses the Kivy SDK to package your app.
47
45
If you want to control more details about your app than buildozer
48
- currently offers then you can use the following method ` using Kivy SDK `
49
- mentioned below.
46
+ currently offers then you can use the SDK directly, as detailed in the
47
+ section below.
50
48
51
- Using Kivy SDK
52
- --------------
49
+ Using the Kivy SDK
50
+ ------------------
53
51
54
52
Since version 1.9.0, Kivy is released for the OS X platform in a
55
53
self-contained, portable distribution.
@@ -96,11 +94,11 @@ To install any module you need to install the module like so::
96
94
97
95
Where are the modules/files installed?
98
96
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
99
- Inside the relocatable venv within the app at::
97
+ Inside the portable venv within the app at::
100
98
101
99
Kivy.app/Contents/Resources/venv/
102
100
103
- If you install a module that install's a binary for example like kivy-garden
101
+ If you install a module that installs a binary for example like kivy-garden
104
102
That binary will be only available from the venv above, as in after you do::
105
103
106
104
kivy -m pip install kivy-garden
@@ -112,14 +110,14 @@ The garden lib will be only available when you activate this env.
112
110
deactivate
113
111
114
112
To install binary files
115
- ~~~~~~~~~~~~~~~~~~~~~~
113
+ ~~~~~~~~~~~~~~~~~~~~~~~
116
114
117
115
Just copy the binary to the Kivy.app/Contents/Resources/venv/bin/ directory.
118
116
119
- To Include other frameworks
117
+ To include other frameworks
120
118
~~~~~~~~~~~~~~~~~~~~~~~~~~~
121
119
Kivy.app comes with SDL2 and Gstreamer frameworks provided.
122
- To Include frameworks other than the ones provided do the following::
120
+ To include frameworks other than the ones provided do the following::
123
121
124
122
git clone http://github.com/tito/osxrelocator
125
123
export PYTHONPATH=~/path/to/osxrelocator
@@ -130,12 +128,12 @@ To Include frameworks other than the ones provided do the following::
130
128
Do not forget to replace <Framework_name> with your framework.
131
129
This tool `osxrelocator ` essentially changes the path for the
132
130
libs in the framework such that they are relative to the executable
133
- within the .app. Making the Framework relocatable with the .app.
131
+ within the .app, making the Framework portable with the .app.
134
132
135
133
136
134
Shrinking the app size
137
135
^^^^^^^^^^^^^^^^^^^^^^
138
- The app has of considerable size right now, however the unneeded parts can be
136
+ The app has a considerable size right now, however the unneeded parts can be
139
137
removed from the package.
140
138
141
139
For example if you don't use GStreamer, simply remove it from
@@ -165,26 +163,26 @@ This should give you a compressed dmg that will further shrink the size of your
165
163
.. _osx_pyinstaller :
166
164
167
165
168
- Using Pyinstaller without brew
169
- ------------------------------
170
- First install Kivy and it's dependencies without using homebrew as mentioned here
171
- http://kivy.org/docs/installation/installation.html#development-version
166
+ Using PyInstaller without Homebrew
167
+ ----------------------------------
168
+ First install Kivy and its dependencies without using Homebrew as mentioned here
169
+ http://kivy.org/docs/installation/installation.html#development-version.
172
170
173
- Once you have kivy and it's deps installed then you need to install pyinstaller
171
+ Once you have kivy and its deps installed, you need to install PyInstaller.
174
172
175
- let 's assume we use a folder like `testpackaging `::
173
+ Let 's assume we use a folder like `testpackaging `::
176
174
177
175
cd testpackaging
178
176
git clone http://github.com/pyinstaller/pyinstaller
179
-
180
- create a file named as touchtracer.spec in this directory and paste the following
181
- into it editing ::
177
+
178
+ Create a file named touchtracer.spec in this directory and add the following
179
+ code to it ::
182
180
183
181
# -*- mode: python -*-
184
-
182
+
185
183
block_cipher = None
186
184
from kivy.tools.packaging.pyinstaller_hooks import get_deps_all, hookspath, runtime_hooks
187
-
185
+
188
186
a = Analysis(['/path/to/yout/folder/containing/examples/demo/touchtracer/main.py'],
189
187
pathex=['/path/to/yout/folder/containing/testpackaging'],
190
188
binaries=None,
@@ -217,22 +215,22 @@ into it editing ::
217
215
icon=None,
218
216
bundle_identifier=None)
219
217
220
- Change the paths ::
218
+ Change the paths with your relevant paths ::
221
219
222
220
a = Analysis(['/path/to/yout/folder/containing/examples/demo/touchtracer/main.py'],
223
221
pathex=['/path/to/yout/folder/containing/testpackaging'],
224
222
...
225
223
...
226
224
coll = COLLECT(exe, Tree('../kivy/examples/demo/touchtracer/'),
227
225
228
- By your relevant paths, then run the following command::
226
+ Then run the following command::
229
227
230
228
pyinstaller/pyinstaller.py touchtracer.spec
231
229
232
230
Replace `touchtracer ` with your app where appropriate.
233
- This will give you a <yourapp>.app in dist/ folder.
234
-
235
-
231
+ This will give you a <yourapp>.app in the dist/ folder.
232
+
233
+
236
234
Using PyInstaller and Homebrew
237
235
------------------------------
238
236
.. note ::
@@ -344,16 +342,3 @@ If your project depends on GStreamer::
344
342
If you are using Python from Homebrew you currently also need the following step until `this pull request <https://github.com/Homebrew/homebrew/pull/46097 >`_ gets merged::
345
343
346
344
$ brew reinstall --with-python --build-bottle https://github.com/cbenhagen/homebrew/raw/patch-3/Library/Formula/gst-python.rb
347
-
348
-
349
- SDL 2 HEAD for ``Window.on_dropfile `` support
350
- """""""""""""""""""""""""""""""""""""""""""""
351
-
352
- You can install the newest SDL 2 library which supports ``on_dropfile `` with::
353
-
354
- $ brew reinstall --build-bottle --HEAD sdl2
355
-
356
- Or you build 2.0.3 with the following patches (untested):
357
-
358
- - https://hg.libsdl.org/SDL/rev/2cc90bb31777
359
- - https://hg.libsdl.org/SDL/rev/63c4d6f1f85f
0 commit comments