pyinstaller: update documentation for pyinstaller 2.0 on osx. we should really push the kivy hook in pyinstaller! refs #659

This commit is contained in:
Mathieu Virbel 2012-09-24 21:40:57 +02:00
parent 72c7eb5deb
commit a0aaab6924
1 changed files with 11 additions and 27 deletions

View File

@ -14,31 +14,12 @@ Requirements
------------
* Latest Kivy (the whole portable package, not only the github sourcecode)
* PyInstaller 1.5: http://www.pyinstaller.org/#Downloads
* PyInstaller 2.0: http://www.pyinstaller.org/#Downloads
.. _mac_Install-configure-PyInstaller:
Ensure you've installed Kivy DMG and installed make-symlink script. `kivy`
command must be accessible from the command line.
Install and configure PyInstaller
---------------------------------
First, we need to correctly setup pyinstaller for 64 bits if you want to be
able to package your Kivy application.
#. Decompress the PyInstaller
#. Open a console, and go to the pyinstaller-1.5 directory
#. Execute the following::
VERSIONER_PYTHON_PREFER_32_BIT=yes python Configure.py
mkdir -p support/loader/Darwin-64bit
pushd support/loader/Darwin-64bit
wget http://www.pyinstaller.org/export/d9bfa9a291cbc0fe77a99e38acb92c79631df5b8/project/support/loader/Darwin-64bit/run
wget http://www.pyinstaller.org/export/d9bfa9a291cbc0fe77a99e38acb92c79631df5b8/project/support/loader/Darwin-64bit/run_d
wget http://www.pyinstaller.org/export/d9bfa9a291cbc0fe77a99e38acb92c79631df5b8/project/support/loader/Darwin-64bit/runw
wget http://www.pyinstaller.org/export/d9bfa9a291cbc0fe77a99e38acb92c79631df5b8/project/support/loader/Darwin-64bit/runw_d
chmod +x run*
popd
Now, your pyinstaller installation is ready to be used !
Then, download and decompress the PyInstaller 2.0.
.. _mac_Create-the-spec-file:
@ -52,8 +33,8 @@ file is named `main.py`. Replace both path/filename according to your system.
#. Open a console
#. Go to the pyinstaller directory, and create the initial specs::
cd pyinstaller-1.5
python Makespec.py --name touchtracer ../kivy/examples/demo/touchtracer/main.py
cd pyinstaller-2.0
kivy pyinstaller.py --name touchtracer ../kivy/examples/demo/touchtracer/main.py
#. The specs file is located on `touchtracer/touchtracer.spec` inside the
pyinstaller directory. Now we need to edit the spec file to add kivy hooks
@ -64,6 +45,9 @@ file is named `main.py`. Replace both path/filename according to your system.
from kivy.tools.packaging.pyinstaller_hooks import install_hooks
install_hooks(globals())
In the `Analysis()` command, remove the `hookspath=None` parameters.
Otherwise, the kivy package hook will not be used at all.
Then, you need to change the `COLLECT()` call to add the data of touchtracer
(`touchtracer.kv`, `particle.png`, ...). Change the line to add a Tree()
object. This Tree will search and add every file found in the touchtracer
@ -84,8 +68,8 @@ Build the spec and create DMG
#. Open a console
#. Go to the pyinstaller directory, and build the spec::
cd pyinstaller-1.5
python Build.py touchtracer/touchtracer.spec
cd pyinstaller-2.0
kivy pyinstaller.py touchtracer/touchtracer.spec
#. The package will be the `touchtracer/dist/touchtracer` directory. Rename it to .app::