Created
December 5, 2012 14:30
-
-
Save tito/4215906 to your computer and use it in GitHub Desktop.
Notes for rebuilding Kivy OSX package / Python 2.7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Kivy OSX - Portable package | |
Librairies: | |
- pygame | |
- gstreamer (avec tous les plugins) | |
- pygst (gst-python) | |
- docutils | |
Global way to work: | |
- clean your env, everywhere (brew, python etc.) | |
- `python` should be the system python 2.7 | |
- brew install sdl sdl_ttf sdl_image sdl_mixer smpeg portmidi mercurial | |
- brew install gstreamer gst-plugins-good gst-plugins-bad gst-plugins-ugly | |
(if one fail (bad or ugly), just somewhere, edit the formula (brew edit gst-plugins-bad), install deps by hand except the one that fail. then install the original formula with: brew install --ignore-dependencies gst-plugins-bad. (i don't remember if it's the bad or ugly.)) | |
- brew install gst-ffmpeg | |
- brew install gst-python | |
- brew install pip | |
- sudo pip install docutils | |
- install pygame | |
- get kivy master into ~/code/kivy | |
TEST. | |
- python -c 'import pygst; pygst.require("0.10"); import gst' | |
if one plugin fail to import 'libgstfaad', just remove it. i didn't been able to get it work. | |
- download the portable-deps-osx.zip, unzip | |
create a build.sh script at the same level of portable-deps-osx directory (not inside) with: | |
rm portable-deps-osx.zip | |
pushd . | |
cd portable-deps-osx/Kivy.app/Contents/Resources | |
python build_lib_directory.py | |
popd | |
zip -r9 portable-deps-osx.zip portable-deps-osx | |
pushd ~/code/kivy | |
make distclean | |
git clean -dxf | |
python setup.py build_portable --deps ~/Downloads/deps/portable-deps-osx.zip | |
umount /Volumes/Kivy | |
open Kivy.dmg | |
sleep 10 | |
rm -rf /Applications/Kivy.app | |
cp -a /Volumes/Kivy/Kivy.app /Applications | |
umount /Volumes/Kivy | |
--> the /Application/Kivy.app shoudl be at the latest version. | |
To test, ensure your have a clean env. What i did was: | |
Clean the env: | |
cd /usr/local | |
unset PYTHONPATH | |
mv lib lib.old; mv bin bin.old; mv /usr/local/Cellar/gstreamer/0.10.36/libexec/gstreamer-0.10{,.old} | |
Test: | |
/Applications/Kivy.app/Contents/Resources/script | |
And try: | |
import pygame | |
pygame.__file__ | |
pygame.image.get_extended() # should return 1 | |
import pygst | |
pygst.__file__ | |
pygst.require('0.10') | |
import gst | |
# some eroors, but it should be ok. | |
import docutils | |
docutils.__file__ | |
Then... just use directly the script to execute few examples of Kivy. | |
To restore the env: | |
cd /usr/local | |
mv lib.old lib; mv bin.old bin; mv /usr/local/Cellar/gstreamer/0.10.36/libexec/gstreamer-0.10{.old,} | |
Attempted methods: | |
- Uninstall XQuartz (to be sure) | |
launchctl unload /Library/LaunchAgents/org.macosforge.xquartz.startx.plist | |
sudo launchctl unload /Library/LaunchDaemons/org.macosforge.xquartz.privileged_startx.plist | |
sudo rm -rf /opt/X11* /Library/Launch*/org.macosforge.xquartz.* /Applications/Utilities/XQuartz.app /etc/*paths.d/*XQuartz | |
sudo pkgutil --forget org.macosforge.xquartz.pkg | |
- Install libs | |
sudo easy_install-2.7 pip | |
sudo pip --upgrade numpy | |
brew install sdl sdl_ttf sdl_image sdl_mixer smpeg portmidi | |
- Install gst-plugins-base, gst-plugins-good, gst-plugins-ugly with --ignore-dependencies, just edit the formula, install reps by hands, just avoid pang and gtk+ | |
Manual installation of gst-python-0.10.22: | |
PKG_CONFIG_PATH=/usr/local/Cellar/libxml2/2.8.0/lib/pkgconfig/:/usr/local/Cellar/libffi/3.0.11/lib/pkgconfig:/usr/local/Cellar/pygobject/2.28.6/lib/pkgconfig/ ./configure | |
For gst-plugins-ugly: i've removed: libcdio |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment