Building for OSX Python3 - uclatommy/kivy GitHub Wiki

Build for OSX and Python3

The kivy documentation recommends installing dependencies using brew, however, the setup.py file looks for these dependencies in the OS X frameworks library. Brew does not install to these directories, so a modification is needed in setup.py to look for these dependencies where brew had installed them.

$ brew install sdl2
$ brew install sdl2_image
$ brew install sdl2_ttf
$ brew install sdl2_mixer
$ brew install gstreamer

Modify the setup.py to skip detection of sdl2 libraries and set the link flags manually. If you need to find the correct link flags, type this in terminal:

$ sdl2-config --cflags --libs

For gstreamer, use this:

$ pkg-config --cflags gstreamer-1.0
$ pkg-config --libs gstreamer-1.0

Here's how I modified setup.py to compile with gstreamer.

Open terminal and cd into the kivy directory. Compile kivy

$ python3 setup.py build_ext --inplace -f