scons: support MAPNIK_NAME option to customize libmapnik name for custom packaging

This commit is contained in:
Dane Springmeyer 2014-06-09 13:55:56 -07:00
parent f66d93d0ec
commit d0b357cab7
28 changed files with 36 additions and 35 deletions

View file

@ -316,6 +316,7 @@ opts.AddVariables(
('PATH', 'A custom path (or multiple paths divided by ":") to append to the $PATH env to prioritize usage of command line programs (if multiple are present on the system)', ''),
('PATH_REMOVE', 'A path prefix to exclude from all known command and compile paths (create multiple excludes separated by :)', ''),
('PATH_REPLACE', 'Two path prefixes (divided with a :) to search/replace from all known command and compile paths', ''),
('MAPNIK_NAME', 'Name of library', 'mapnik'),
# Boost variables
# default is '/usr/include', see FindBoost method below
@ -1152,9 +1153,9 @@ if not preconfigured:
env['MAPNIK_FONTS_DEST'] = os.path.join(env['MAPNIK_LIB_DIR_DEST'],'fonts')
if env['LINKING'] == 'static':
env['MAPNIK_LIB_NAME'] = '${LIBPREFIX}mapnik${LIBSUFFIX}'
env['MAPNIK_LIB_NAME'] = '${LIBPREFIX}${MAPNIK_NAME}${LIBSUFFIX}'
else:
env['MAPNIK_LIB_NAME'] = '${SHLIBPREFIX}mapnik${SHLIBSUFFIX}'
env['MAPNIK_LIB_NAME'] = '${SHLIBPREFIX}${MAPNIK_NAME}${SHLIBSUFFIX}'
if env['PKG_CONFIG_PATH']:
env['ENV']['PKG_CONFIG_PATH'] = os.path.realpath(env['PKG_CONFIG_PATH'])

View file

@ -7,7 +7,7 @@ Import ('env')
test_env = env.Clone()
test_env['LIBS'] = copy(env['LIBMAPNIK_LIBS'])
test_env.AppendUnique(LIBS='mapnik')
test_env.AppendUnique(LIBS=env['MAPNIK_NAME'])
test_env.AppendUnique(CXXFLAGS='-g')
if 'g++' in env['CXX']:
test_env.Append(CXXFLAGS='-fPIC')

View file

@ -119,7 +119,7 @@ configuration = {
"git_describe": git_describe,
"version_string": config_env['MAPNIK_VERSION_STRING'],
"version": config_env['MAPNIK_VERSION'],
"mapnik_libname": 'mapnik',
"mapnik_libname": env['MAPNIK_NAME'],
"mapnik_libpath": lib_path,
"ldflags": ldflags,
"dep_libs": dep_libs,

View file

@ -40,7 +40,7 @@ def is_py3():
prefix = env['PREFIX']
target_path = os.path.normpath(env['PYTHON_INSTALL_LOCATION'] + os.path.sep + 'mapnik')
target_path = os.path.normpath(env['PYTHON_INSTALL_LOCATION'] + os.path.sep + env['MAPNIK_NAME'])
target_path_deprecated = os.path.normpath(env['PYTHON_INSTALL_LOCATION'] + os.path.sep + 'mapnik2')
py_env = env.Clone()
@ -48,7 +48,7 @@ py_env.Append(CPPPATH = env['PYTHON_INCLUDES'])
py_env.Append(CPPDEFINES = env['LIBMAPNIK_DEFINES'])
py_env['LIBS'] = ['mapnik',env['BOOST_PYTHON_LIB']]
py_env['LIBS'] = [env['MAPNIK_NAME'],env['BOOST_PYTHON_LIB']]
link_all_libs = env['LINKING'] == 'static' or env['RUNTIME_LINK'] == 'static' or (env['PLATFORM'] == 'Darwin' and not env['PYTHON_DYNAMIC_LOOKUP'])
@ -135,8 +135,8 @@ else:
paths += "__all__ = [mapniklibpath,inputpluginspath,fontscollectionpath]\n"
if not os.path.exists('mapnik'):
os.mkdir('mapnik')
if not os.path.exists(env['MAPNIK_NAME']):
os.mkdir(env['MAPNIK_NAME'])
file('mapnik/paths.py','w').write(paths % (env['MAPNIK_LIB_DIR']))

View file

@ -429,7 +429,7 @@ def PostGIS(**keywords):
cursor_size -- integer size of binary cursor to use (default: 0, no binary cursor is used)
>>> from mapnik import PostGIS, Layer
>>> params = dict(dbname='mapnik',table='osm',user='postgres',password='gis')
>>> params = dict(dbname=env['MAPNIK_NAME'],table='osm',user='postgres',password='gis')
>>> params['estimate_extent'] = False
>>> params['extent'] = '-20037508,-19929239,20037508,19929239'
>>> postgis = PostGIS(**params)

View file

@ -40,7 +40,7 @@ if env['HAS_CAIRO']:
demo_env.PrependUnique(CPPPATH=env['CAIRO_CPPPATHS'])
demo_env.Append(CPPDEFINES = '-DHAVE_CAIRO')
libraries = ['mapnik']
libraries = [env['MAPNIK_NAME']]
libraries.extend(copy(env['LIBMAPNIK_LIBS']))
rundemo = demo_env.Program('rundemo', source, LIBS=libraries)

View file

@ -39,7 +39,7 @@ libraries.append('boost_system%s' % env['BOOST_APPEND'])
libraries.append(env['ICU_LIB_NAME'])
if env['PLUGIN_LINKING'] == 'shared':
libraries.append('mapnik')
libraries.append(env['MAPNIK_NAME'])
TARGET = plugin_env.SharedLibrary('../%s' % PLUGIN_NAME,
SHLIBPREFIX='',

View file

@ -45,7 +45,7 @@ if env['RUNTIME_LINK'] == 'static':
libraries = copy(plugin_env['LIBS'])
if env['PLUGIN_LINKING'] == 'shared':
libraries.insert(0,'mapnik')
libraries.insert(0,env['MAPNIK_NAME'])
libraries.append(env['ICU_LIB_NAME'])
libraries.append('boost_system%s' % env['BOOST_APPEND'])

View file

@ -42,7 +42,7 @@ libraries.append('boost_system%s' % env['BOOST_APPEND'])
# libraries.append('boost_thread%s' % env['BOOST_APPEND'])
if env['PLUGIN_LINKING'] == 'shared':
libraries.append('mapnik')
libraries.append(env['MAPNIK_NAME'])
TARGET = plugin_env.SharedLibrary('../%s' % PLUGIN_NAME,
SHLIBPREFIX='',

View file

@ -41,7 +41,7 @@ libraries.append('boost_system%s' % env['BOOST_APPEND'])
libraries.append(env['ICU_LIB_NAME'])
if env['PLUGIN_LINKING'] == 'shared':
libraries.append('mapnik')
libraries.append(env['MAPNIK_NAME'])
TARGET = plugin_env.SharedLibrary('../%s' % PLUGIN_NAME,
SHLIBPREFIX='',

View file

@ -51,7 +51,7 @@ libraries = copy(plugin_env['LIBS'])
plugin_env.Append(CXXFLAGS=cxxflags)
if env['PLUGIN_LINKING'] == 'shared':
libraries.insert(0,'mapnik')
libraries.insert(0,env['MAPNIK_NAME'])
libraries.append(env['ICU_LIB_NAME'])
libraries.append('boost_system%s' % env['BOOST_APPEND'])

View file

@ -60,7 +60,7 @@ libraries.append(env['ICU_LIB_NAME'])
libraries.append('boost_system%s' % env['BOOST_APPEND'])
if env['PLUGIN_LINKING'] == 'shared':
libraries.append('mapnik')
libraries.append(env['MAPNIK_NAME'])
TARGET = plugin_env.SharedLibrary('../%s' % PLUGIN_NAME,
SHLIBPREFIX='',

View file

@ -51,7 +51,7 @@ else:
libraries = copy(plugin_env['LIBS'])
if env['PLUGIN_LINKING'] == 'shared':
libraries.insert(0,'mapnik')
libraries.insert(0,env['MAPNIK_NAME'])
libraries.append(env['ICU_LIB_NAME'])
libraries.append('boost_system%s' % env['BOOST_APPEND'])
libraries.append('boost_regex%s' % env['BOOST_APPEND'])

View file

@ -69,7 +69,7 @@ else:
plugin_env.Append(LINKFLAGS=python_link_flag)
if env['PLUGIN_LINKING'] == 'shared':
libraries.append('mapnik')
libraries.append(env['MAPNIK_NAME'])
TARGET = plugin_env.SharedLibrary('../%s' % PLUGIN_NAME,
SHLIBPREFIX='',
SHLIBSUFFIX='.input',

View file

@ -40,7 +40,7 @@ libraries.append(env['ICU_LIB_NAME'])
libraries.append('boost_system%s' % env['BOOST_APPEND'])
if env['PLUGIN_LINKING'] == 'shared':
libraries.append('mapnik')
libraries.append(env['MAPNIK_NAME'])
TARGET = plugin_env.SharedLibrary('../%s' % PLUGIN_NAME,
SHLIBPREFIX='',

View file

@ -39,7 +39,7 @@ libraries.append(env['ICU_LIB_NAME'])
libraries.append('boost_system%s' % env['BOOST_APPEND'])
if env['PLUGIN_LINKING'] == 'shared':
libraries.append('mapnik')
libraries.append(env['MAPNIK_NAME'])
TARGET = plugin_env.SharedLibrary('../%s' % PLUGIN_NAME,
SHLIBPREFIX='',

View file

@ -49,7 +49,7 @@ plugin_env.Append(CXXFLAGS=cxxflags)
plugin_env.Append(CPPDEFINES=cppdefines)
if env['PLUGIN_LINKING'] == 'shared':
libraries.append('mapnik')
libraries.append(env['MAPNIK_NAME'])
TARGET = plugin_env.SharedLibrary('../shape',
SHLIBSUFFIX='.input',

View file

@ -44,7 +44,7 @@ if env['SQLITE_LINKFLAGS']:
plugin_env.Append(LINKFLAGS=linkflags)
if env['PLUGIN_LINKING'] == 'shared':
libraries.append('mapnik')
libraries.append(env['MAPNIK_NAME'])
TARGET = plugin_env.SharedLibrary('../%s' % PLUGIN_NAME,
SHLIBPREFIX='',

View file

@ -51,7 +51,7 @@ if env['PLUGIN_LINKING'] == 'shared':
install_dest = env['MAPNIK_INPUT_PLUGINS_DEST']
# only link mapnik if we are build an external shared object
libraries.append('mapnik')
libraries.append(env['MAPNIK_NAME'])
TARGET = plugin_env.SharedLibrary(
# the name of the target to build, eg 'sqlite.input'

View file

@ -43,7 +43,7 @@ libraries.append('boost_system%s' % env['BOOST_APPEND'])
# libraries.append('boost_thread%s' % env['BOOST_APPEND'])
if env['PLUGIN_LINKING'] == 'shared':
libraries.append('mapnik')
libraries.append(env['MAPNIK_NAME'])
TARGET = plugin_env.SharedLibrary('../%s' % PLUGIN_NAME,
SHLIBPREFIX='',

View file

@ -391,9 +391,9 @@ if env['PLATFORM'] == 'Darwin' or not env['ENABLE_SONAME']:
target_path = env['MAPNIK_LIB_BASE_DEST']
if 'uninstall' not in COMMAND_LINE_TARGETS:
if env['LINKING'] == 'static':
mapnik = lib_env_final.StaticLibrary('mapnik', source)
mapnik = lib_env_final.StaticLibrary(env['MAPNIK_NAME'], source)
else:
mapnik = lib_env_final.SharedLibrary('mapnik', source)
mapnik = lib_env_final.SharedLibrary(env['MAPNIK_NAME'], source)
result = env.Install(target_path, mapnik)
env.Alias(target='install', source=result)
@ -415,9 +415,9 @@ else:
if 'uninstall' not in COMMAND_LINE_TARGETS:
if env['LINKING'] == 'static':
mapnik = lib_env_final.StaticLibrary('mapnik', source)
mapnik = lib_env_final.StaticLibrary(env['MAPNIK_NAME'], source)
else:
mapnik = lib_env_final.SharedLibrary('mapnik', source)
mapnik = lib_env_final.SharedLibrary(env['MAPNIK_NAME'], source)
result = env.InstallAs(target=target, source=mapnik)
env.Alias(target='install', source=result)
if result:

View file

@ -10,7 +10,7 @@ if not env['CPP_TESTS']:
for cpp_test_bin in glob.glob('*-bin'):
os.unlink(cpp_test_bin)
else:
test_env['LIBS'] = ['mapnik']
test_env['LIBS'] = [env['MAPNIK_NAME']]
test_env.AppendUnique(LIBS=copy(env['LIBMAPNIK_LIBS']))
if env['RUNTIME_LINK'] == 'static' and env['PLATFORM'] == 'Linux':
test_env.AppendUnique(LIBS='dl')

View file

@ -4,7 +4,7 @@ from copy import copy
Import ('env')
libraries = ['mapnik']
libraries = [env['MAPNIK_NAME']]
libraries.extend(copy(env['LIBMAPNIK_LIBS']))
for cpp_test in glob.glob('*_test.cpp'):

View file

@ -19,7 +19,7 @@ if env['HAS_CAIRO']:
program_env.Append(CPPDEFINES = '-DHAVE_CAIRO')
boost_program_options = 'boost_program_options%s' % env['BOOST_APPEND']
libraries = ['mapnik',boost_program_options]
libraries = [env['MAPNIK_NAME'],boost_program_options]
libraries.extend(copy(env['LIBMAPNIK_LIBS']))
if env['RUNTIME_LINK'] == 'static' and env['PLATFORM'] == 'Linux':
libraries.append('dl')

View file

@ -37,7 +37,7 @@ headers = ['#plugins/input/ogr'] + env['CPPPATH']
program_env['LIBS'] = [env['PLUGINS']['ogr']['lib']]
# Link Library to Dependencies
program_env['LIBS'].append('mapnik')
program_env['LIBS'].append(env['MAPNIK_NAME'])
program_env['LIBS'].append(env['ICU_LIB_NAME'])
program_env['LIBS'].append('boost_system%s' % env['BOOST_APPEND'])
program_env['LIBS'].append('boost_program_options%s' % env['BOOST_APPEND'])

View file

@ -47,7 +47,7 @@ program_env.PrependUnique(CPPPATH=['#plugins/input/postgis'])
libraries = []
boost_program_options = 'boost_program_options%s' % env['BOOST_APPEND']
libraries.extend([boost_program_options,'sqlite3','pq','mapnik','icuuc'])
libraries.extend([boost_program_options,'sqlite3','pq',env['MAPNIK_NAME'],'icuuc'])
if env.get('BOOST_LIB_VERSION_FROM_HEADER'):
boost_version_from_header = int(env['BOOST_LIB_VERSION_FROM_HEADER'].split('_')[1])

View file

@ -39,7 +39,7 @@ headers = ['#plugins/input/shape'] + env['CPPPATH']
boost_program_options = 'boost_program_options%s' % env['BOOST_APPEND']
boost_system = 'boost_system%s' % env['BOOST_APPEND']
libraries = ['mapnik', boost_program_options, boost_system]
libraries = [env['MAPNIK_NAME'], boost_program_options, boost_system]
if env['RUNTIME_LINK'] == 'static':
libraries.extend(copy(env['LIBMAPNIK_LIBS']))
if env['PLATFORM'] == 'Linux':

View file

@ -41,7 +41,7 @@ if env['HAS_CAIRO']:
program_env.Append(CPPDEFINES = '-DHAVE_CAIRO')
boost_program_options = 'boost_program_options%s' % env['BOOST_APPEND']
libraries = ['mapnik',boost_program_options]
libraries = [env['MAPNIK_NAME'],boost_program_options]
libraries.extend(copy(env['LIBMAPNIK_LIBS']))
if env['RUNTIME_LINK'] == 'static' and env['PLATFORM'] == 'Linux':
libraries.append('dl')