scons: normalize paths written to 'paths.py' to avoid double '//'

This commit is contained in:
Dane Springmeyer 2009-03-30 04:15:11 +00:00
parent df7a5b8429
commit 2f04dc753c

View file

@ -50,21 +50,23 @@ headers = [env['PYTHON_INCLUDES']] + env['CPPPATH']
paths = '''
"""Configuration paths of Mapnik fonts and input plugins (autogenerated by SCons)."""
import os
mapniklibpath = '%s'
'''
paths += "inputpluginspath = mapniklibpath + '/input'\n"
paths += "inputpluginspath = os.path.normpath(mapniklibpath + '/input')\n"
if env['SYSTEM_FONTS']:
paths += "fontscollectionpath = '%s'" % env['SYSTEM_FONTS']
paths += "fontscollectionpath = os.path.normpath('%s')" % env['SYSTEM_FONTS']
else:
paths += "fontscollectionpath = mapniklibpath + '/fonts'"
paths += "fontscollectionpath = os.path.normpath(mapniklibpath + '/fonts')"
# write out the location of the 'mapniklibpath' into a python file
# so that the python module can locate it at runtime
exp = r"%s{2,}" % os.sep
# Note: we use prefix here not install_prefix since install_prefix is for package building
# Note: we use prefix rather than install_prefix here since install_prefix is for package building
# and we intend for python to look to the standard prefix location to find the fonts and plugins
mapnik_lib_path = re.sub(exp,os.sep, prefix + '/' + env['LIBDIR_SCHEMA'] + env['LIB_DIR_NAME'])
file('mapnik/paths.py','w').write(paths % (mapnik_lib_path))