-
-
Save mikekelly/1493280 to your computer and use it in GitHub Desktop.
Install PyGTK via Homebrew and virtualenv
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
# This LOOKS pretty straightforward, but it took awhile to sort out issues with | |
# py2cairo and pygobject, so I hope I've saved you some time :-) | |
# | |
# This assumes you already subscribe to a nice clean virtualenvwrapper workflow | |
# -- see https://gist.github.com/771394 if you need advice on getting there. | |
# There are some optional dependencies omitted, so if you're going to be doing | |
# heavy development with these libs, you may want to look into them. | |
# | |
# We go to some configure option pains to avoid polluting the system-level | |
# Python, and `brew link`ing Cairo which is keg-only by default. | |
brew install cairo && brew install gtk+ | |
# Have a coffee. Better yet, a meal. | |
mkvirtualenv --no-site-packages pygtk | |
workon pygtk | |
# NOTE: pycairo uses a nonstandard build system, the autotools approach is | |
# officially unsupported. I couldn't get the latest version (1.10.0 at time of | |
# writing) to work with either approach, so I punted and used autotools here | |
# with the next-most-recent version. | |
curl -O http://cairographics.org/releases/py2cairo-1.8.10.tar.gz | |
tar xzf py2cairo-1.8.10.tar.gz && cd py2cairo-1.8.10 | |
./configure --prefix=$VIRTUAL_ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/Cellar/cairo/1.10.2/lib/pkgconfig | |
make | |
make install | |
# pygobject | |
# introspection no worky: https://github.com/mxcl/homebrew/pull/4353 | |
curl -O http://ftp.gnome.org/pub/GNOME/sources/pygobject/2.28/pygobject-2.28.6.tar.bz2 | |
tar xf pygobject-2.28.6.tar.bz2 && cd pygobject-2.28.6 | |
./configure --prefix=$VIRTUAL_ENV --disable-introspection | |
make | |
make install | |
# pygtk | |
curl -O http://ftp.gnome.org/pub/GNOME/sources/pygtk/2.24/pygtk-2.24.0.tar.bz2 | |
tar xf pygtk-2.24.0.tar.bz2 && cd pygtk-2.24.0 | |
./configure --prefix=$VIRTUAL_ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$VIRTUAL_ENV/lib/pkgconfig | |
make # moar coffee nao | |
make install | |
# There's a short test script you can run from the REPL here, if you want to | |
# verify that things are working: | |
# | |
# http://faq.pygtk.org/index.py?file=faq21.001.htp&req=show | |
# |
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
#!/bin/sh | |
# ~/bin/openxenmanager | |
source ~/.virtualenvs/pygtk/bin/activate | |
cd $HOME/src/python/openxenmanager | |
python window.py | |
deactivate |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment