Skip to content

Instantly share code, notes, and snippets.

@cuibonobo
Created September 18, 2014 02:00
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cuibonobo/819c22c89a5283e2335c to your computer and use it in GitHub Desktop.
Save cuibonobo/819c22c89a5283e2335c to your computer and use it in GitHub Desktop.
Installing KivEnt on Mac OS X.

Tested on Mac OS X 10.8.5 and 10.9.3.

Not for the faint of heart. Before we begin, you will need to install XQuartz, Homebrew, and virtualenv.

I'm using virtualenv to isolate your global system settings from the KivEnt installation because it's still under heavy development and it's very messy. We'll also be using the virtual environment folder to install Kivy, Cymunk, and KivEnt without needing to add them to your repository or your .gitignore file.

Now follow these steps carefully and you should be up and running:

  • Gain access to homebrew-headonly with brew tap homebrew/headonly. You may want to do a brew update for good measure.
  • SMPEG was moved to homebrew-headonly, so install it with brew install --HEAD smpeg
  • PyGame uses Mercury so we'll need that too: brew install hg
  • Some image, font, and sound libraries: brew install sdl_image sdl_mixer sdl_ttf portmidi
  • Create a virtual environment in your working directory: virtualenv venv
  • Activate the virtual environment with . venv/bin/activate
  • Install PyGame: pip install hg+http://bitbucket.org/pygame/pygame*
  • Install Cython: pip install cython*
  • Go into the venv directory and git clone git@github.com:kivy/kivy.git
  • Go into the kivy directory and install with make*
  • Go back up to venv and git clone git@github.com:tito/cymunk.git
  • Go into the cymunk folder and install with python setup.py build_ext --inplace -f*
  • Create a .pth file at venv/lib/python2.7/site-packages with the following contents:
../../../kivy
../../../cymunk
../../../cymunk/cymunk
../../../cymunk/cymunk/python
  • Deactivate your virtual environment with deactivate and activate it again in order to add Kivy and Cymunk to the Python path
  • Go into venv and git clone git@github.com:Kovak/KivEnt.git
  • Make sure you're in the venv directory and create some symlinks from Kivy to KivEnt with the following commands:
ln -s $PWD/kivy/kivy/graphics/common_subset.h $PWD/KivEnt/kivent/kivent/
ln -s $PWD/kivy/kivy/graphics/gl2platform.h $PWD/KivEnt/kivent/kivent/
ln -s $PWD/kivy/kivy/graphics/khrplatform.h $PWD/KivEnt/kivent/kivent/
  • Go into the KivEnt/kivent folder and install with python setup.py install*

* NOTE: On 10.8.5, your build commands may fail because of a clang error. If a build has failed, you will see something like this:

error: command 'clang' failed with exit status 1

The only way to consistently get rid of this error is to prefix your build commands with sudo ARCHFLAGS="-Wno-error=unused-command-line-argument-hard-error-in-future". For example, instead of python setup.py install you would use sudo ARCHFLAGS="-Wno-error=unused-command-line-argument-hard-error-in-future" python setup.py install.

The commands that may need this fix are marked with an * in the instructions above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment