Merge remote-tracking branch 'origin/master'

This commit is contained in:
Artem Pavlenko 2011-12-14 14:01:34 +00:00
commit d128333a75
4 changed files with 15 additions and 24 deletions

View file

@ -41,8 +41,10 @@ def is_py3():
prefix = env['PREFIX']
target_path = os.path.normpath(env['PYTHON_INSTALL_LOCATION'] + os.path.sep + 'mapnik')
target_path_deprecated = os.path.normpath(env['PYTHON_INSTALL_LOCATION'] + os.path.sep + 'mapnik2')
libraries = ['mapnik','png']
libraries = ['mapnik']
libraries.append('png')
if env['JPEG']:
libraries.append('jpeg')
@ -121,22 +123,24 @@ else:
paths = '''
"""Configuration paths of Mapnik fonts and input plugins (auto-generated by SCons)."""
import os
from os.path import normpath,join,dirname
mapniklibpath = '%s'
mapniklibpath = normpath(join(dirname(__file__),mapniklibpath))
'''
paths += "inputpluginspath = os.path.normpath(mapniklibpath + '/input')\n"
paths += "inputpluginspath = join(mapniklibpath,'input')\n"
if env['SYSTEM_FONTS']:
paths += "fontscollectionpath = os.path.normpath('%s')" % env['SYSTEM_FONTS']
paths += "fontscollectionpath = normpath('%s')\n" % env['SYSTEM_FONTS']
else:
paths += "fontscollectionpath = os.path.normpath(mapniklibpath + '/fonts')"
paths += "fontscollectionpath = join(mapniklibpath,'fonts')\n"
paths += "__all__ = [mapniklibpath,inputpluginspath,fontscollectionpath]\n"
if not os.path.exists('mapnik'):
os.mkdir('mapnik')
file('mapnik/paths.py','w').write(paths % (env['MAPNIK_LIB_DIR']))
file('mapnik/paths.py','w').write(paths % (os.path.relpath(env['MAPNIK_LIB_DIR'],target_path)))
# force open perms temporarily so that `sudo scons install`
# does not later break simple non-install non-sudo rebuild
@ -152,8 +156,7 @@ if 'install' in COMMAND_LINE_TARGETS:
init_module = env.Install(target_path, init_files)
env.Alias(target='install', source=init_module)
# install mapnik2 module which redirects to mapnik and issues DeprecatedWarning
path = os.path.normpath(env['PYTHON_INSTALL_LOCATION'] + os.path.sep + 'mapnik2')
init_mapnik2 = env.Install(path, 'mapnik2/__init__.py')
init_mapnik2 = env.Install(target_path_deprecated, 'mapnik2/__init__.py')
env.Alias(target='install', source=init_mapnik2)
# fix perms and install the custom generated 'paths.py'
@ -204,4 +207,5 @@ if 'uninstall' not in COMMAND_LINE_TARGETS:
env['create_uninstall_target'](env, target_path)
env['create_uninstall_target'](env, target_path_deprecated)

View file

@ -1,3 +0,0 @@
mapniklibpath = '@PACKAGE_LIB_DIR@'
inputpluginspath = mapniklibpath + '/input'
fontscollectionpath = '@SYSTEM_FONTS_DIR@/truetype/ttf-dejavu'

View file

@ -7,25 +7,15 @@
</Rule>
</Style>
<!-- layer created by ogr like: ogr2ogr -t_srs EPSG:4326 -f SQLite ../sqlite/world.sqlite world_merc.shp -->
<!-- here we read with the ogr plugin -->
<Layer name="world_borders1" srs="+init=epsg:4326">
<StyleName>world_borders_style1</StyleName>
<Datasource>
<Parameter name="type">ogr</Parameter>
<Parameter name="file">../sqlite/world.sqlite</Parameter>
<Parameter name="layer">world_merc</Parameter>
</Datasource>
</Layer>
<Style name="world_borders_style2">
<Rule>
<PolygonSymbolizer fill="yellow" gamma="0.5"/>
</Rule>
</Style>
<!-- here we read with native sqlite plugin -->
<!-- layer created by ogr like: ogr2ogr -t_srs EPSG:4326 -f SQLite ../sqlite/world.sqlite world_merc.shp -->
<Layer name="world_borders2" srs="+init=epsg:4326">
<StyleName>world_borders_style1</StyleName>
<StyleName>world_borders_style2</StyleName>
<Datasource>
<Parameter name="type">sqlite</Parameter>

View file

@ -12,7 +12,7 @@ def usage():
def main():
try:
opts, args = getopt.getopt(sys.argv[1:], "hvqp:", ["help", "prefix="])
except getopt.GetoptError as err:
except getopt.GetoptError,err:
print(str(err))
usage()
sys.exit(2)