mapnik: fix relative path in paths.py

Add patch to mapnik.rb to use an absolute path into site-packages
rather than a relative path in the file `paths.py`.  The upstream
bug report is noted in the formula comments and is where the patch
offered by the developer came from.

Fixes Homebrew/homebrew#12026.
Closes Homebrew/homebrew#12043.

Signed-off-by: Charlie Sharpsteen <source@sharpsteen.net>
master
nibbles 2bits 2012-05-03 15:43:36 -07:00 committed by Charlie Sharpsteen
parent 829beb0b8a
commit b1efcd3f38
1 changed files with 22 additions and 0 deletions

View File

@ -14,6 +14,12 @@ class Mapnik < Formula
depends_on 'boost'
depends_on 'cairomm' => :optional
# Reported upstream: https://github.com/mapnik/mapnik/issues/1171
# Fix is not yet in HEAD as of 3 MAY 2012, but likely will be in 2.0.2.
def patches
DATA
end
def install
ENV.x11 # for freetype-config
@ -50,3 +56,19 @@ class Mapnik < Formula
"python" + `python -c 'import sys;print(sys.version[:3])'`.strip
end
end
__END__
--- a/bindings/python/build.py
+++ b/bindings/python/build.py
@@ -143,10 +143,7 @@ paths += "__all__ = [mapniklibpath,inputpluginspath,fontscollectionpath]\n"
if not os.path.exists('mapnik'):
os.mkdir('mapnik')
-if hasattr(os.path,'relpath'): # python 2.6 and above
- file('mapnik/paths.py','w').write(paths % (os.path.relpath(env['MAPNIK_LIB_DIR'],target_path)))
-else:
- file('mapnik/paths.py','w').write(paths % (env['MAPNIK_LIB_DIR']))
+file('mapnik/paths.py','w').write(paths % (env['MAPNIK_LIB_DIR']))
# force open perms temporarily so that `sudo scons install`
# does not later break simple non-install non-sudo rebuild