[mapnik] 01/05: New upstream version 3.0.17+ds

Bas Couwenberg sebastic at debian.org
Wed Nov 29 20:52:39 UTC 2017


This is an automated email from the git hooks/post-receive script.

sebastic pushed a commit to branch master
in repository mapnik.

commit 852ec99b205d51db2feed6e5375a869399276688
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Wed Nov 29 20:50:45 2017 +0100

    New upstream version 3.0.17+ds
---
 .travis.yml                                        | 10 +++-
 CHANGELOG.md                                       |  9 +++
 README.md                                          |  2 +-
 SConstruct                                         | 69 ++++++++++++----------
 bootstrap.sh                                       | 17 +++---
 circle.yml                                         |  1 +
 demo/viewer/build.py                               |  2 +-
 include/mapnik/version.hpp                         |  2 +-
 plugins/input/csv/build.py                         |  2 +-
 plugins/input/geojson/build.py                     |  2 +-
 plugins/input/pgraster/build.py                    |  2 +-
 plugins/input/postgis/build.py                     |  2 +-
 plugins/input/topojson/build.py                    |  2 +-
 scripts/check_glibcxx.sh                           | 36 +++++++++++
 src/build.py                                       | 21 ++++---
 src/font_engine_freetype.cpp                       |  1 +
 .../mapnik/version.hpp => src/glibc_workaround.cpp | 34 +++++++----
 src/text/renderer.cpp                              | 17 +++---
 utils/mapnik-config/build.py                       |  6 +-
 19 files changed, 154 insertions(+), 83 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index d2065e4..38793fd 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -33,7 +33,7 @@ matrix:
     - os: linux
       sudo: false
       compiler: ": clang"
-      env: JOBS=8 CXX="ccache clang++-3.9 -Qunused-arguments" CC="clang-3.9" TRIGGER=true
+      env: JOBS=8 CXX="ccache clang++-3.9 -Qunused-arguments" CC="clang-3.9" ENABLE_GLIBC_WORKAROUND=true TRIGGER=true
       addons:
         apt:
           sources: [ 'ubuntu-toolchain-r-test']
@@ -95,7 +95,7 @@ before_script:
 
 script:
  - export SCONSFLAGS='--debug=time'
- - configure BENCHMARK=${BENCH}
+ - configure BENCHMARK=${BENCH} ENABLE_GLIBC_WORKAROUND=${ENABLE_GLIBC_WORKAROUND:-false}
  - cat config.log
  # we limit the `make` to 40 min
  # to ensure that slow builds still upload their
@@ -108,4 +108,8 @@ script:
  # we allow visual failures with g++ for now: https://github.com/mapnik/mapnik/issues/3567
  - if [[ ${RESULT} != 0 ]] && [[ ${CXX} =~ 'clang++' ]]; then false; fi;
  - enabled ${COVERAGE} coverage
- - enabled ${BENCH} make bench
\ No newline at end of file
+ - enabled ${BENCH} make bench
+ - ./scripts/check_glibcxx.sh
+
+after_success:
+ - enabled ${TRIGGER} trigger_downstream
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8cc955f..d0be79b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,15 @@ Developers: Please commit along with changes.
 
 For a complete change history, see the git log.
 
+## 3.0.17
+
+Released: November 29, 2017
+
+(Packaged from ebdd96c61)
+
+    - Use `Scons 3` as an internal build sytsem + support both Python 2 and 3.
+    - Added glibcxx workaround to support libstdc++-4.8
+
 ## 3.0.16
 
 Released: November 16, 2017
diff --git a/README.md b/README.md
index b58be71..8f4dd2e 100644
--- a/README.md
+++ b/README.md
@@ -28,4 +28,4 @@ Please note that this project is released with a [Contributor Code of Conduct](h
 
 # License
 
-Mapnik software is free and is released under the LGPL ([GNU Lesser General Public License](http://www.gnu.org/licenses/lgpl.html)). Please see [COPYING](https://github.com/mapnik/mapnik/blob/master/COPYING) for more information.
+Mapnik software is free and is released under the LGPL v2.1 ([GNU Lesser General Public License, version 2.1](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html)). Please see [COPYING](https://github.com/mapnik/mapnik/blob/master/COPYING) for more information.
diff --git a/SConstruct b/SConstruct
index a3f725c..4a6641d 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1,6 +1,6 @@
 # This file is part of Mapnik (c++ mapping toolkit)
 #
-# Copyright (C) 2015 Artem Pavlenko
+# Copyright (C) 2017 Artem Pavlenko
 #
 # Mapnik is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -16,6 +16,7 @@
 # License along with this library; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
+from __future__ import print_function # support python2
 
 import os
 import sys
@@ -136,7 +137,7 @@ env = Environment(ENV=os.environ)
 init_environment(env)
 
 def fix_path(path):
-    return os.path.abspath(path)
+    return str(os.path.abspath(path))
 
 def color_print(color,text,newline=True):
     # 1 - red
@@ -145,15 +146,15 @@ def color_print(color,text,newline=True):
     # 4 - blue
     text = "\033[9%sm%s\033[0m" % (color,text)
     if not newline:
-        print text,
+        print (text, end='')
     else:
-        print text
+        print (text)
 
 def regular_print(color,text,newline=True):
     if not newline:
-        print text,
+        print (text, end='')
     else:
-        print text
+        print (text)
 
 def call(cmd, silent=False):
     stdin, stderr = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate()
@@ -244,7 +245,7 @@ def sort_paths(items,priority):
             path_types['other'].append(i)
     # build up new list based on priority list
     for path in priority:
-        if path_types.has_key(path):
+        if path in path_types:
             dirs = path_types[path]
             new.extend(dirs)
             path_types.pop(path)
@@ -308,6 +309,7 @@ opts.AddVariables(
     BoolVariable('USE_CONFIG', "Use SCons user '%s' file (will also write variables after successful configuration)", 'True'),
     BoolVariable('NO_ATEXIT', 'Will prevent Singletons from being deleted atexit of main thread', 'False'),
     BoolVariable('NO_DLCLOSE', 'Will prevent plugins from being unloaded', 'False'),
+    BoolVariable('ENABLE_GLIBC_WORKAROUND', "Workaround known GLIBC symbol exports to allow building against libstdc++-4.8 without binaries needing throw_out_of_range_fmt", 'False'),
     # http://www.scons.org/wiki/GoFastButton
     # http://stackoverflow.com/questions/1318863/how-to-optimize-an-scons-script
     BoolVariable('FAST', "Make SCons faster at the cost of less precise dependency tracking", 'False'),
@@ -509,7 +511,7 @@ elif HELP_REQUESTED:
 # https://github.com/mapnik/mapnik/issues/2112
 if not os.path.exists(SCONS_LOCAL_LOG) and not os.path.exists(SCONS_CONFIGURE_CACHE) \
   and ('-c' in command_line_args or '--clean' in command_line_args):
-    print 'all good: nothing to clean, but you might want to run "make distclean"'
+    print ('all good: nothing to clean, but you might want to run "make distclean"')
     Exit(0)
 
 # initially populate environment with defaults and any possible custom arguments
@@ -519,7 +521,7 @@ opts.Update(env)
 if not force_configure:
     if os.path.exists(SCONS_CONFIGURE_CACHE):
         try:
-            pickled_environment = open(SCONS_CONFIGURE_CACHE, 'r')
+            pickled_environment = open(SCONS_CONFIGURE_CACHE, 'rb')
             pickled_values = pickle.load(pickled_environment)
             for key, value in pickled_values.items():
                 env[key] = value
@@ -551,7 +553,7 @@ elif preconfigured:
         color_print(4,'Using previous successful configuration...')
         color_print(4,'Re-configure by running "python scons/scons.py configure".')
 
-if env.has_key('COLOR_PRINT') and env['COLOR_PRINT'] == False:
+if 'COLOR_PRINT' in env and env['COLOR_PRINT'] == False:
     color_print = regular_print
 
 if sys.platform == "win32":
@@ -620,9 +622,9 @@ def parse_config(context, config, checks='--libs --cflags'):
             else:
                 env.ParseConfig(cmd)
             parsed = True
-        except OSError, e:
+        except OSError as e:
             ret = False
-            print ' (xml2-config not found!)'
+            print (' (xml2-config not found!)')
     if not parsed:
         if config in ('GDAL_CONFIG'):
             # optional deps...
@@ -645,7 +647,7 @@ def get_pkg_lib(context, config, lib):
     parsed = False
     if ret:
         try:
-            value = call(cmd,silent=True)
+            value = call(cmd,silent=True).decode("utf8")
             if ' ' in value:
                 parts = value.split(' ')
                 if len(parts) > 1:
@@ -656,9 +658,9 @@ def get_pkg_lib(context, config, lib):
             else:
                 # osx 1.8 install gives '-framework GDAL'
                 libname = 'gdal'
-        except Exception, e:
+        except Exception as e:
             ret = False
-            print ' unable to determine library name:'# %s' % str(e)
+            print (' unable to determine library name:# {0!s}'.format(e))
             return None
     context.Result( libname )
     return libname
@@ -670,8 +672,8 @@ def parse_pg_config(context, config):
     context.Message( 'Checking for %s... ' % tool)
     ret = context.TryAction(env[config])[0]
     if ret:
-        lib_path = call('%s --libdir' % env[config])
-        inc_path = call('%s --includedir' % env[config])
+        lib_path = call('%s --libdir' % env[config]).decode("utf8")
+        inc_path = call('%s --includedir' % env[config]).decode("utf8")
         env.AppendUnique(CPPPATH = fix_path(inc_path))
         env.AppendUnique(LIBPATH = fix_path(lib_path))
         lpq = env['PLUGINS']['postgis']['lib']
@@ -806,7 +808,7 @@ int main()
     return ret
 
 def CheckIcuData(context, silent=False):
- 
+
     if not silent:
         context.Message('Checking for ICU data directory...')
     ret = context.TryRun("""
@@ -833,7 +835,7 @@ int main() {
     return ret[1].strip()
 
 def CheckGdalData(context, silent=False):
- 
+
     if not silent:
         context.Message('Checking for GDAL data directory...')
     ret = context.TryRun("""
@@ -856,7 +858,7 @@ int main() {
     return ret[1].strip()
 
 def CheckProjData(context, silent=False):
- 
+
     if not silent:
         context.Message('Checking for PROJ_LIB directory...')
     ret = context.TryRun("""
@@ -1234,7 +1236,7 @@ if not preconfigured:
                 if os.path.exists(conf):
                     opts.files.append(conf)
                     color_print(4,"SCons CONFIG found: '%s', variables will be inherited..." % conf)
-                    optfile = file(conf)
+                    optfile = open(conf, 'r')
                     #print optfile.read().replace("\n", " ").replace("'","").replace(" = ","=")
                     optfile.close()
 
@@ -1401,7 +1403,7 @@ if not preconfigured:
                 temp_env.ParseConfig('%s --libs' % env['FREETYPE_CONFIG'])
                 if 'bz2' in temp_env['LIBS']:
                     env['EXTRA_FREETYPE_LIBS'].append('bz2')
-            except OSError,e:
+            except OSError as e:
                 pass
 
     # libxml2 should be optional but is currently not
@@ -1702,7 +1704,7 @@ if not preconfigured:
                                         if not lib in env['LIBS']:
                                             env["SQLITE_LINKFLAGS"].append(lib)
                                             env.Append(LIBS=lib)
-                                except OSError,e:
+                                except OSError as e:
                                     for lib in ["sqlite3","dl","pthread"]:
                                         if not lib in env['LIBS']:
                                             env["SQLITE_LINKFLAGS"].append("lib")
@@ -1785,7 +1787,7 @@ if not preconfigured:
                 env['HAS_CAIRO'] = False
                 env['SKIPPED_DEPS'].append('cairo')
             else:
-                print 'Checking for cairo lib and include paths... ',
+                print ('Checking for cairo lib and include paths... ', end='')
                 cmd = 'pkg-config --libs --cflags cairo'
                 if env['RUNTIME_LINK'] == 'static':
                     cmd += ' --static'
@@ -1802,8 +1804,8 @@ if not preconfigured:
                         if not inc in env['CPPPATH']:
                             env["CAIRO_CPPPATHS"].append(inc)
                     env['HAS_CAIRO'] = True
-                    print 'yes'
-                except OSError,e:
+                    print ('yes')
+                except OSError as e:
                     color_print(1,'no')
                     env['SKIPPED_DEPS'].append('cairo')
                     color_print(1,'pkg-config reported: %s' % e)
@@ -1872,6 +1874,9 @@ if not preconfigured:
         if env['NO_DLCLOSE'] or env['COVERAGE']:
             env.Append(CPPDEFINES = '-DMAPNIK_NO_DLCLOSE')
 
+        if env['ENABLE_GLIBC_WORKAROUND']:
+            env.Append(CPPDEFINES = '-DMAPNIK_ENABLE_GLIBC_WORKAROUND')
+
         # Mac OSX (Darwin) special settings
         if env['PLATFORM'] == 'Darwin':
             pthread = ''
@@ -1955,7 +1960,7 @@ if not preconfigured:
 
         # finish config stage and pickle results
         env = conf.Finish()
-        env_cache = open(SCONS_CONFIGURE_CACHE, 'w')
+        env_cache = open(SCONS_CONFIGURE_CACHE, 'wb')
         pickle_dict = {}
         for i in pickle_store:
             pickle_dict[i] = env.get(i)
@@ -1966,20 +1971,20 @@ if not preconfigured:
         # with a non-root configure following a root install
         # that also triggered a re-configure
         try:
-            os.chmod(SCONS_CONFIGURE_CACHE,0666)
+            os.chmod(SCONS_CONFIGURE_CACHE,0o666)
         except: pass
         try:
-            os.chmod(SCONS_LOCAL_CONFIG,0666)
+            os.chmod(SCONS_LOCAL_CONFIG,0o666)
         except: pass
         try:
-            os.chmod('.sconsign.dblite',0666)
+            os.chmod('.sconsign.dblite',0o666)
         except: pass
         try:
-            os.chmod(SCONS_LOCAL_LOG,0666)
+            os.chmod(SCONS_LOCAL_LOG,0o666)
         except: pass
         try:
             for item in glob('%s/*' % SCONF_TEMP_DIR):
-                os.chmod(item,0666)
+                os.chmod(item, 0o666)
         except: pass
 
         if 'configure' in command_line_args:
diff --git a/bootstrap.sh b/bootstrap.sh
index 030c0dc..c591b11 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -11,7 +11,7 @@ todo
 - shrink icu data
 '
 
-MASON_VERSION="v0.11.1"
+MASON_VERSION="v0.17.0"
 
 function setup_mason() {
     if [[ ! -d ./.mason ]]; then
@@ -45,6 +45,7 @@ function install() {
 }
 
 ICU_VERSION="57.1"
+BOOST_VERSION="1.65.1"
 
 function install_mason_deps() {
     install ccache 3.3.1
@@ -64,15 +65,15 @@ function install_mason_deps() {
     # here by default helps make mapnik-vector-tile builds easier
     install webp 0.6.0 libwebp
     install libgdal 2.1.3 libgdal
-    install boost 1.63.0
-    install boost_libsystem 1.63.0
-    install boost_libfilesystem 1.63.0
-    install boost_libprogram_options 1.63.0
-    install boost_libregex_icu57 1.63.0
+    install boost ${BOOST_VERSION}
+    install boost_libsystem ${BOOST_VERSION}
+    install boost_libfilesystem ${BOOST_VERSION}
+    install boost_libprogram_options ${BOOST_VERSION}
+    install boost_libregex_icu57 ${BOOST_VERSION}
     # technically boost thread and python are not a core dep, but installing
     # here by default helps make python-mapnik builds easier
-    install boost_libthread 1.63.0
-    install boost_libpython 1.63.0
+    install boost_libthread ${BOOST_VERSION}
+    install boost_libpython ${BOOST_VERSION}
     install freetype 2.7.1 libfreetype
     install harfbuzz 1.4.4-ft libharfbuzz
 }
diff --git a/circle.yml b/circle.yml
index 5624c66..02c4147 100644
--- a/circle.yml
+++ b/circle.yml
@@ -32,6 +32,7 @@ database:
     - ./.mason/mason link clang++ ${LLVM_VERSION}
     - ./configure CC="$(pwd)/mason_packages/.link/bin/clang" CXX="$(pwd)/mason_packages/.link/bin/ccache $(pwd)/mason_packages/.link/bin/clang++ -Qunused-arguments"
     - make
+    - nm src/libmapnik* | grep "GLIBCXX_3.4.2[0-9]" || true
   override:
     - psql -c 'create database template_postgis;'
     - psql -c 'create extension postgis;' -d template_postgis
diff --git a/demo/viewer/build.py b/demo/viewer/build.py
index cbd35f7..7c52093 100644
--- a/demo/viewer/build.py
+++ b/demo/viewer/build.py
@@ -43,5 +43,5 @@ ini = ini_template % locals()
 open('viewer.ini','w').write(ini)
 
 try:
-    os.chmod('viewer.ini',0666)
+    os.chmod('viewer.ini',0o666)
 except: pass
diff --git a/include/mapnik/version.hpp b/include/mapnik/version.hpp
index d891d46..244c05d 100644
--- a/include/mapnik/version.hpp
+++ b/include/mapnik/version.hpp
@@ -27,7 +27,7 @@
 
 #define MAPNIK_MAJOR_VERSION 3
 #define MAPNIK_MINOR_VERSION 0
-#define MAPNIK_PATCH_VERSION 16
+#define MAPNIK_PATCH_VERSION 17
 
 #define MAPNIK_VERSION (MAPNIK_MAJOR_VERSION*100000) + (MAPNIK_MINOR_VERSION*100) + (MAPNIK_PATCH_VERSION)
 
diff --git a/plugins/input/csv/build.py b/plugins/input/csv/build.py
index 91675a1..f5e030d 100644
--- a/plugins/input/csv/build.py
+++ b/plugins/input/csv/build.py
@@ -29,7 +29,7 @@ if env.get('BOOST_LIB_VERSION_FROM_HEADER'):
         can_build = True
 
 if not can_build:
-    print 'WARNING: skipping building the optional CSV datasource plugin which requires boost >= 1.56'
+    print ('WARNING: skipping building the optional CSV datasource plugin which requires boost >= 1.56')
 else:
     Import ('plugin_base')
 
diff --git a/plugins/input/geojson/build.py b/plugins/input/geojson/build.py
index a5d738f..d0f8d29 100644
--- a/plugins/input/geojson/build.py
+++ b/plugins/input/geojson/build.py
@@ -29,7 +29,7 @@ if env.get('BOOST_LIB_VERSION_FROM_HEADER'):
         can_build = True
 
 if not can_build:
-    print 'WARNING: skipping building the optional geojson datasource plugin which requires boost >= 1.56'
+    print ('WARNING: skipping building the optional geojson datasource plugin which requires boost >= 1.56')
 else:
 
     Import ('plugin_base')
diff --git a/plugins/input/pgraster/build.py b/plugins/input/pgraster/build.py
index 7d120e4..2549300 100644
--- a/plugins/input/pgraster/build.py
+++ b/plugins/input/pgraster/build.py
@@ -43,7 +43,7 @@ if env['RUNTIME_LINK'] == 'static':
     cmd = 'pkg-config libpq --libs --static'
     try:
         plugin_env.ParseConfig(cmd)
-    except OSError, e:
+    except OSError as e:
         plugin_env.Append(LIBS='pq')
 else:
     plugin_env.Append(LIBS='pq')
diff --git a/plugins/input/postgis/build.py b/plugins/input/postgis/build.py
index 409f88b..c4aabf6 100644
--- a/plugins/input/postgis/build.py
+++ b/plugins/input/postgis/build.py
@@ -42,7 +42,7 @@ if env['RUNTIME_LINK'] == 'static':
     cmd = 'pkg-config libpq --libs --static'
     try:
         plugin_env.ParseConfig(cmd)
-    except OSError, e:
+    except OSError as e:
         plugin_env.Append(LIBS='pq')
 else:
     plugin_env.Append(LIBS='pq')
diff --git a/plugins/input/topojson/build.py b/plugins/input/topojson/build.py
index 3a49320..6df31a3 100644
--- a/plugins/input/topojson/build.py
+++ b/plugins/input/topojson/build.py
@@ -29,7 +29,7 @@ if env.get('BOOST_LIB_VERSION_FROM_HEADER'):
         can_build = True
 
 if not can_build:
-    print 'WARNING: skipping building the optional topojson datasource plugin which requires boost >= 1.56'
+    print ('WARNING: skipping building the optional topojson datasource plugin which requires boost >= 1.56')
 else:
     Import ('plugin_base')
 
diff --git a/scripts/check_glibcxx.sh b/scripts/check_glibcxx.sh
new file mode 100755
index 0000000..ae29893
--- /dev/null
+++ b/scripts/check_glibcxx.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+set -eu
+set -o pipefail
+shopt -s nullglob
+
+: '
+
+Ensure no GLIBCXX_3.4.2x symbols are present in the binary
+if ENABLE_GLIBC_WORKAROUND is set.
+
+If symbols >= 3.4.20 then it means the binaries would not run on ubuntu trusty without upgrading libstdc++
+
+'
+
+FINAL_RETURN_CODE=0
+
+function check() {
+    local RESULT=0
+    nm ${1} | grep "GLIBCXX_3.4.2[0-9]" > /tmp/out.txt || RESULT=$?
+    if [[ ${RESULT} != 0 ]]; then
+        echo "Success: GLIBCXX_3.4.2[0-9] symbols not present in binary (as expected)"
+    else
+        echo "$(cat /tmp/out.txt | c++filt)"
+        if [[ ${ENABLE_GLIBC_WORKAROUND:-false} == true ]]; then
+            FINAL_RETURN_CODE=1
+        fi
+    fi
+}
+
+for i in src/libmapnik*; do
+    echo "checking $i"
+    check $i
+done
+
+exit ${FINAL_RETURN_CODE}
diff --git a/src/build.py b/src/build.py
index 6dd0f24..c5889dc 100644
--- a/src/build.py
+++ b/src/build.py
@@ -35,7 +35,7 @@ def call(cmd, silent=True):
     if not stderr:
         return stdin.strip()
     elif not silent:
-        print stderr
+        print (stderr)
 
 def ldconfig(*args,**kwargs):
     call('ldconfig')
@@ -282,17 +282,17 @@ if env['PLUGIN_LINKING'] == 'static':
                 lib_env.Append(CPPDEFINES = DEF)
                 if DEF not in libmapnik_defines:
                     libmapnik_defines.append(DEF)
-                if plugin_env.has_key('SOURCES') and plugin_env['SOURCES']:
+                if 'SOURCES' in plugin_env and plugin_env['SOURCES']:
                     source += ['../plugins/input/%s/%s' % (plugin, src) for src in plugin_env['SOURCES']]
-                if plugin_env.has_key('CPPDEFINES') and plugin_env['CPPDEFINES']:
+                if 'CPPDEFINES' in plugin_env and plugin_env['CPPDEFINES']:
                     lib_env.AppendUnique(CPPDEFINES=plugin_env['CPPDEFINES'])
-                if plugin_env.has_key('CXXFLAGS') and plugin_env['CXXFLAGS']:
+                if 'CXXFLAGS' in plugin_env and plugin_env['CXXFLAGS']:
                     lib_env.AppendUnique(CXXFLAGS=plugin_env['CXXFLAGS'])
-                if plugin_env.has_key('LINKFLAGS') and plugin_env['LINKFLAGS']:
+                if 'LINKFLAGS' in plugin_env and plugin_env['LINKFLAGS']:
                     lib_env.AppendUnique(LINKFLAGS=plugin_env['LINKFLAGS'])
-                if plugin_env.has_key('CPPPATH') and plugin_env['CPPPATH']:
+                if 'CPPPATH' in plugin_env and plugin_env['CPPPATH']:
                     lib_env.AppendUnique(CPPPATH=copy(plugin_env['CPPPATH']))
-                if plugin_env.has_key('LIBS') and plugin_env['LIBS']:
+                if 'LIBS' in plugin_env and plugin_env['LIBS']:
                     lib_env.AppendUnique(LIBS=plugin_env['LIBS'])
         else:
             print("Notice: dependencies not met for plugin '%s', not building..." % plugin)
@@ -307,6 +307,13 @@ cairo/process_markers_symbolizer.cpp
 cairo/process_group_symbolizer.cpp
 """)
 
+if env['ENABLE_GLIBC_WORKAROUND']:
+    source += Split(
+            """
+            glibc_workaround.cpp
+            """
+        )
+
 if env['HAS_CAIRO']:
     lib_env.AppendUnique(LIBPATH=env['CAIRO_LIBPATHS'])
     lib_env.Append(CPPDEFINES = '-DHAVE_CAIRO')
diff --git a/src/font_engine_freetype.cpp b/src/font_engine_freetype.cpp
index 4d504a8..e8bb492 100644
--- a/src/font_engine_freetype.cpp
+++ b/src/font_engine_freetype.cpp
@@ -53,6 +53,7 @@ namespace mapnik
 {
 template class MAPNIK_DECL singleton<freetype_engine, CreateUsingNew>;
 
+
 bool freetype_engine::is_font_file(std::string const& file_name)
 {
     // only accept files that will be matched by freetype2's `figurefiletype()`
diff --git a/include/mapnik/version.hpp b/src/glibc_workaround.cpp
similarity index 58%
copy from include/mapnik/version.hpp
copy to src/glibc_workaround.cpp
index d891d46..27c97f4 100644
--- a/include/mapnik/version.hpp
+++ b/src/glibc_workaround.cpp
@@ -2,7 +2,7 @@
  *
  * This file is part of Mapnik (c++ mapping toolkit)
  *
- * Copyright (C) 2015 Artem Pavlenko
+ * Copyright (C) 2017 Artem Pavlenko
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -20,19 +20,29 @@
  *
  *****************************************************************************/
 
-#ifndef MAPNIK_VERSION_HPP
-#define MAPNIK_VERSION_HPP
+#ifdef __linux__
 
-#include <mapnik/stringify_macro.hpp>
+#ifdef MAPNIK_ENABLE_GLIBC_WORKAROUND
 
-#define MAPNIK_MAJOR_VERSION 3
-#define MAPNIK_MINOR_VERSION 0
-#define MAPNIK_PATCH_VERSION 16
+#include <stdexcept>
 
-#define MAPNIK_VERSION (MAPNIK_MAJOR_VERSION*100000) + (MAPNIK_MINOR_VERSION*100) + (MAPNIK_PATCH_VERSION)
+// https://github.com/bitcoin/bitcoin/pull/4042
+// allows building against libstdc++-dev-4.9 while avoiding
+// GLIBCXX_3.4.20 dep
+// This is needed because libstdc++ itself uses this API - its not
+// just an issue of your code using it, ughhh
 
-#define MAPNIK_VERSION_STRING   MAPNIK_STRINGIFY(MAPNIK_MAJOR_VERSION) "." \
-                                MAPNIK_STRINGIFY(MAPNIK_MINOR_VERSION) "." \
-                                MAPNIK_STRINGIFY(MAPNIK_PATCH_VERSION)
+namespace std
+{
 
-#endif // MAPNIK_VERSION_HPP
+void __throw_out_of_range_fmt(const char *, ...) __attribute__((__noreturn__));
+void __throw_out_of_range_fmt(const char *err, ...)
+{
+    // Safe and over-simplified version. Ignore the format and print it as-is.
+    __throw_out_of_range(err);
+}
+}
+
+#endif // MAPNIK_ENABLE_GLIBC_WORKAROUND
+
+#endif // __linux__
diff --git a/src/text/renderer.cpp b/src/text/renderer.cpp
index a549d6c..163d11c 100644
--- a/src/text/renderer.cpp
+++ b/src/text/renderer.cpp
@@ -178,16 +178,13 @@ void agg_text_renderer<T>::render(glyph_positions const& pos)
                 if (!error)
                 {
                     FT_BitmapGlyph bit = reinterpret_cast<FT_BitmapGlyph>(g);
-                    if (bit->bitmap.pixel_mode != FT_PIXEL_MODE_BGRA)
-                    {
-                        composite_bitmap(pixmap_,
-                                         &bit->bitmap,
-                                         halo_fill,
-                                         bit->left,
-                                         height - bit->top,
-                                         halo_opacity,
-                                         halo_comp_op_);
-                    }
+                    composite_bitmap(pixmap_,
+                                     &bit->bitmap,
+                                     halo_fill,
+                                     bit->left,
+                                     height - bit->top,
+                                     halo_opacity,
+                                     halo_comp_op_);
                 }
             }
             else
diff --git a/utils/mapnik-config/build.py b/utils/mapnik-config/build.py
index cc34908..e96559f 100644
--- a/utils/mapnik-config/build.py
+++ b/utils/mapnik-config/build.py
@@ -43,7 +43,7 @@ def GetMapnikLibVersion():
     return version_string
 
 if (GetMapnikLibVersion() != config_env['MAPNIK_VERSION_STRING']):
-    print 'Error: version.hpp mismatch (%s) to cached value (%s): please reconfigure mapnik' % (GetMapnikLibVersion(),config_env['MAPNIK_VERSION_STRING'])
+    print ('Error: version.hpp mismatch (%s) to cached value (%s): please reconfigure mapnik' % (GetMapnikLibVersion(),config_env['MAPNIK_VERSION_STRING']))
     Exit(1)
 
 config_variables = '''#!/usr/bin/env bash
@@ -77,7 +77,7 @@ def write_config(configuration,template,config_file):
     template = open(template,'r').read()
     open(config_file,'w').write(config_variables  % configuration + template)
     try:
-        os.chmod(config_file,0755)
+        os.chmod(config_file, 0o755)
     except: pass
 
 
@@ -183,7 +183,7 @@ if 'install' in COMMAND_LINE_TARGETS:
     env.Command(full_target, config_file,
        [
        Copy("$TARGET","$SOURCE"),
-       Chmod("$TARGET", 0755),
+       Chmod("$TARGET", 0o755),
        ])
 
 config_env['create_uninstall_target'](env,os.path.join(target_path,config_file))

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/mapnik.git



More information about the Pkg-grass-devel mailing list