-
-
Save jegger/9549865 to your computer and use it in GitHub Desktop.
# Inspired by: | |
# - https://gist.github.com/goldsmith/7262122 | |
# - https://gist.github.com/brousch/6589386 | |
#### Some hints #### | |
# Currently kivy apps only work on monitor 1 (multiple monitor setup) | |
# You have to place the terminal which runs kivy on the monitor 1 or make the app fullscreen. | |
# Make sure you have the "command line tools" for mavericks installed! | |
# (xcode-select --install) | |
# Install brew | |
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" | |
# Install requiered packages | |
brew install mercurial sdl sdl_image sdl_mixer sdl_ttf portmidi | |
# Install smpeg package via another brew tap | |
brew tap homebrew/headonly | |
brew install smpeg --HEAD | |
# Create virtualenv | |
sudo pip install virtualenv | |
virtualenv venv | |
# Install cython | |
export CFLAGS="-arch i386 -arch x86_64" | |
export FFLAGS="-m32 -m64" | |
export LDFLAGS="-Wall -undefined dynamic_lookup -bundle -arch i386 -arch x86_64" | |
export CC=gcc | |
export CXX="g++ -arch i386 -arch x86_64" | |
venv/bin/pip install cython==0.21.2 | |
rm -rf cython | |
# Install pygame | |
hg clone https://bitbucket.org/pygame/pygame | |
cd pygame | |
../venv/bin/python setup.py build | |
../venv/bin/python setup.py install | |
cd .. | |
rm -rf pygame | |
# Install kivy | |
git clone https://github.com/kivy/kivy | |
cd kivy | |
../venv/bin/python setup.py install | |
cd .. | |
rm -rf kivy |
L23: I used brew mercurial
L35: I had to use cython==0.21.2
L49: I had to use make force
@jacobvalenta thanks, I updated the gist. But make force was not necessary for me.
Thanks! This helped a lot
This could be a really dumb question, but why use rm -rf (remove symlinks) after installing cython, pygame and kivy? Also at L32 is there a need to specify a specific version of cython - why not let pip install the latest version? Other than these questions, thank you for this very handy set of instructions. Thanks for any answers.
@kkc15 -rf is for removing the hole directory (not symlinks). I just remove them as they are not needed anymore (as they are in the virtualenv now). Regarding the Cython version: I follow the general rule to specify a version of a package, if possible, as a further version may break the build process (you never know, but you know it worked with the one specified). Cython is a special case anyway as it behaves sometimes unpredictable...
Works Great! although it made me use Cython version 0.27.3 and used brew install smpeg instead of brew install smpeg --HEAD
Thanks for this script. With use of your suggestions we could install Kivy successfully on a OSX system.