In build.py, the use of PKG_CONFIG_PATH caused a KeyError if it was not defined. The patch checks if PKG_CONFIG_PATH is defined, and uses it if necessary.
Minimum pkg-config version was lowered to 0.22, since it seems to work just fine.
Changed OGRE version to >=, since Gazebo works with 1.7.0 SVN.
Thanks for the patch.
The changes have been made in SVN trunk.
Thank you for your contribution.