Index: Makefile
===================================================================
RCS file: /cvs/ports/graphics/mapnik/Makefile,v
retrieving revision 1.37
diff -u -p -u -p -r1.37 Makefile
--- Makefile	23 Feb 2021 19:39:25 -0000	1.37
+++ Makefile	20 May 2021 14:52:46 -0000
@@ -1,43 +1,37 @@
 # $OpenBSD: Makefile,v 1.37 2021/02/23 19:39:25 sthen Exp $
 
-BROKEN =	undefined reference to '_ZN6icu_5613UnicodeStringC1EOS0_'
-
-# out of memory, renderer_common/process_group_symbolizer.cpp
-# powerpc &sparc64 OOM's on expression_grammar.cpp
-ONLY_FOR_ARCHS =	amd64
-
 COMMENT =	toolkit for developing mapping applications
 
-DISTNAME =	mapnik-v3.0.10
+# Check if next release incorporates support for new PROJ
+V =		3.1.0
+DISTNAME =	mapnik-v${V}
 PKGNAME =	${DISTNAME:S/v//}
 EXTRACT_SUFX =	.tar.bz2
-REVISION =	5
 
-SHARED_LIBS =	mapnik 3.0 #3.0
+SHARED_LIBS =	mapnik 4.0 #3.0
 CATEGORIES =	graphics geo
 
-HOMEPAGE =	http://mapnik.org/
-MAINTAINER =	Landry Breuil <landry@openbsd.org>
+HOMEPAGE =	https://mapnik.org/
+MAINTAINER =	Josh Grosse <josh@jggimi.net>
 DPB_PROPERTIES = nojunk
 
 # LGPLv2.1
 PERMIT_PACKAGE =	Yes
 
-WANTLIB += X11 Xau Xdmcp Xext Xrender boost_filesystem-mt
-WANTLIB += boost_program_options-mt boost_regex-mt harfbuzz webp
-WANTLIB += boost_system-mt c cairo expat fontconfig freetype 
-WANTLIB += gdal glib-2.0 gobject-2.0 iconv icuuc intl jpeg m pcre pixman-1
-WANTLIB += png>=17.0 pq proj pthread sqlite3 tiff
-WANTLIB += xcb xcb-render xcb-shm z ${COMPILER_LIBCXX}
+WANTLIB += X11 Xau Xdmcp Xext Xrender boost_filesystem
+WANTLIB += boost_program_options boost_regex harfbuzz webp
+WANTLIB += boost_system c cairo expat ffi fontconfig freetype
+WANTLIB += gdal glib-2.0 gobject-2.0 icudata icui18n icuuc
+WANTLIB += intl jpeg m pcre pixman-1 png>=17.0 pq pthread
+WANTLIB += sqlite3 tiff xcb xcb-render xcb-shm xml2 z ${COMPILER_LIBCXX}
 
-MASTER_SITES =	http://mapnik.s3.amazonaws.com/dist/v3.0.10/
+MASTER_SITES =	https://github.com/mapnik/mapnik/releases/download/v${V}/
 MODULES =	devel/scons \
 		lang/python
 MODPY_VERSION =	${MODPY_DEFAULT_VERSION_2}
 
-# clang doesnt ship cstdint ?
+# C++14
 COMPILER =	base-clang ports-gcc
-MODGCC4_ARCHS =	amd64 i386 powerpc sparc64
 
 TEST_DEPENDS =	shells/bash \
 		${BUILD_PKGPATH}
@@ -46,7 +40,6 @@ LIB_DEPENDS =	devel/boost>=1.58 \
 		databases/sqlite3 \
 		graphics/cairo \
 		graphics/libwebp \
-		devel/proj \
 		devel/harfbuzz \
 		geo/gdal \
 		textproc/icu4c
@@ -60,14 +53,19 @@ MODSCONS_FLAGS =	PREFIX="${TRUEPREFIX}" 
 			HB_LIBS=${LOCALBASE}/lib \
 			WARNING_CXXFLAGS="-I${X11BASE}/include/freetype2" \
 			SYSTEM_FONTS=${X11BASE}/lib/X11/fonts/TTF/ \
+			CUSTOM_LDFLAGS="-L${LOCALBASE}/lib -L${X11BASE}/lib" \
 			FAST=yes \
-			INPUT_PLUGINS=raster,postgis,shape,gdal,ogr,sqlite
+			INPUT_PLUGINS=raster,postgis,shape,gdal,ogr,sqlite \
+			XMLPARSER=libxml2
 
 pre-configure:
 	# subst shlib version
 	${SUBST_CMD} ${WRKSRC}/src/build.py
 
 do-test:
+	# Test data cuold be fetched from github and extracted to test subdir.
+	# https://github.com/mapnik/test-data
+	# https://github.com/mapnik/test-data-visual
 	# warning: some tests may swap your machine to death
 	# python_tests.datasource_test.test_hit_grid may stall gobbling all cpu
 	# python_tests.geometry_io_test.test_wkb_parsing may segfault
Index: distinfo
===================================================================
RCS file: /cvs/ports/graphics/mapnik/distinfo,v
retrieving revision 1.5
diff -u -p -u -p -r1.5 distinfo
--- distinfo	4 Sep 2016 16:46:57 -0000	1.5
+++ distinfo	20 May 2021 14:52:46 -0000
@@ -1,2 +1,2 @@
-SHA256 (mapnik-v3.0.10.tar.bz2) = NkC87Bl6NO4HgVPmZ8NEM9pbceAvH6fBSAEtl702qjk=
-SIZE (mapnik-v3.0.10.tar.bz2) = 86209028
+SHA256 (mapnik-v3.1.0.tar.bz2) = Q9dhgtKpdSErStEVJMdOV3V2wRA5/atShrgoOX2OYmE=
+SIZE (mapnik-v3.1.0.tar.bz2) = 10110740
Index: patches/patch-SConstruct
===================================================================
RCS file: /cvs/ports/graphics/mapnik/patches/patch-SConstruct,v
retrieving revision 1.7
diff -u -p -u -p -r1.7 patch-SConstruct
--- patches/patch-SConstruct	4 Sep 2016 16:46:57 -0000	1.7
+++ patches/patch-SConstruct	20 May 2021 14:52:46 -0000
@@ -1,8 +1,9 @@
 $OpenBSD: patch-SConstruct,v 1.7 2016/09/04 16:46:57 landry Exp $
 2nd chunk is needed for proper boost_thread detection
---- SConstruct.orig	Fri Feb 26 03:02:05 2016
-+++ SConstruct	Sun Sep  4 17:29:08 2016
-@@ -290,7 +290,7 @@ opts.AddVariables(
+Index: SConstruct
+--- SConstruct.orig
++++ SConstruct
+@@ -297,7 +297,7 @@ opts.AddVariables(
      ('CUSTOM_LDFLAGS', 'Custom linker flags, e.g. -L<lib dir> if you have libraries in a nonstandard directory <lib dir>', ''),
      EnumVariable('LINKING', "Set library format for libmapnik",'shared', ['shared','static']),
      EnumVariable('RUNTIME_LINK', "Set preference for linking dependencies",'shared', ['shared','static']),
@@ -10,14 +11,14 @@ $OpenBSD: patch-SConstruct,v 1.7 2016/09
 +    EnumVariable('OPTIMIZATION','Set compiler optimization level','2', ['0','1','2','3','4','s']),
      # Note: setting DEBUG=True will override any custom OPTIMIZATION level
      BoolVariable('DEBUG', 'Compile a debug version of Mapnik', 'False'),
-     BoolVariable('DEBUG_UNDEFINED', 'Compile a version of Mapnik using clang/llvm undefined behavior asserts', 'False'),
-@@ -1415,6 +1415,9 @@ if not preconfigured:
-             # of attaching to cxxflags after configure
-             if env['PLATFORM'] == 'SunOS':
-                 env.Append(CXXFLAGS = '-pthreads')
-+            if env['PLATFORM'] == 'OpenBSD':
-+                env.Append(CXXFLAGS = '-pthread')
-+
+     BoolVariable('COVERAGE', 'Compile a libmapnik and plugins with --coverage', 'False'),
+@@ -1364,6 +1364,9 @@ if not preconfigured:
+ 
+     thread_suffix = 'mt'
+     if env['PLATFORM'] == 'FreeBSD':
++        thread_suffix = ''
++        env.Append(LIBS = 'pthread')
++    if env['PLATFORM'] == 'OpenBSD':
+         thread_suffix = ''
+         env.Append(LIBS = 'pthread')
  
-         # if requested, sort LIBPATH and CPPPATH before running CheckLibWithHeader tests
-         if env['PRIORITIZE_LINKING']:
Index: patches/patch-src_build_py
===================================================================
RCS file: /cvs/ports/graphics/mapnik/patches/patch-src_build_py,v
retrieving revision 1.5
diff -u -p -u -p -r1.5 patch-src_build_py
--- patches/patch-src_build_py	4 Sep 2016 16:46:57 -0000	1.5
+++ patches/patch-src_build_py	20 May 2021 14:52:46 -0000
@@ -1,9 +1,10 @@
 $OpenBSD: patch-src_build_py,v 1.5 2016/09/04 16:46:57 landry Exp $
---- src/build.py.orig	Fri Feb 26 03:02:05 2016
-+++ src/build.py	Sun Sep  4 17:29:08 2016
+Index: src/build.py
+--- src/build.py.orig
++++ src/build.py
 @@ -37,9 +37,6 @@ def call(cmd, silent=True):
      elif not silent:
-         print stderr
+         print (stderr)
  
 -def ldconfig(*args,**kwargs):
 -    call('ldconfig')
@@ -11,7 +12,7 @@ $OpenBSD: patch-src_build_py,v 1.5 2016/
  if env['LINKING'] == 'static':
      lib_env.Append(CXXFLAGS="-fPIC")
  
-@@ -136,7 +133,7 @@ else: # unix, non-macos
+@@ -140,7 +137,7 @@ else: # unix, non-macos
          else:
              mapnik_lib_link_flag += ' -Wl,-h,%s' %  mapnik_libname
      else: # Linux and others
@@ -20,7 +21,7 @@ $OpenBSD: patch-src_build_py,v 1.5 2016/
              lib_env['LIBS'].append('dl')
          mapnik_lib_link_flag += ' -Wl,-rpath-link,.'
          if env['ENABLE_SONAME']:
-@@ -434,9 +431,7 @@ else:
+@@ -450,9 +447,7 @@ else:
              os.remove(trgt)
          os.symlink(os.path.basename(src), trgt)
  
@@ -31,7 +32,7 @@ $OpenBSD: patch-src_build_py,v 1.5 2016/
      target = os.path.join(env['MAPNIK_LIB_BASE_DEST'], soFile)
  
      if 'uninstall' not in COMMAND_LINE_TARGETS:
-@@ -446,30 +441,8 @@ else:
+@@ -462,30 +457,8 @@ else:
              mapnik = lib_env_final.SharedLibrary(env['MAPNIK_NAME'], source)
          result = env.InstallAs(target=target, source=mapnik)
          env.Alias(target='install', source=result)
Index: patches/patch-test_run
===================================================================
RCS file: /cvs/ports/graphics/mapnik/patches/patch-test_run,v
retrieving revision 1.1
diff -u -p -u -p -r1.1 patch-test_run
--- patches/patch-test_run	18 Sep 2015 20:07:09 -0000	1.1
+++ patches/patch-test_run	20 May 2021 14:52:46 -0000
@@ -1,17 +1,20 @@
 $OpenBSD: patch-test_run,v 1.1 2015/09/18 20:07:09 landry Exp $
 find -quit is only in gfind
---- test/run.orig	Sat Aug  8 17:20:43 2015
-+++ test/run	Sat Aug  8 17:20:55 2015
-@@ -19,12 +19,10 @@ if [ -d "test/data" ]; then
-     failures=$((failures+$?))
+Index: test/run
+--- test/run.orig
++++ test/run
+@@ -29,13 +29,12 @@ if [ -d "test/data" ]; then
  
      run_substep "Running standalone C++ tests..."
+     found_test=false
 -    if [ -n "$(find test/standalone/ -maxdepth 1 -name '*-bin' -print -quit)" ]; then
          for FILE in test/standalone/*-bin; do
-             ${FILE};
-           failures=$((failures+$?))
+           found_test=true
+           ran_a_test=true
+           ${FILE} || failures=$((failures+$?))
          done
 -    fi
- 
-     if [ -d "test/data-visual/styles" ]; then
-         run_substep "Running visual tests..."
++ 
+     if [[ $found_test == false ]]; then
+         run_warn "Skipping standalone tests since they were not built"
+     fi
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/graphics/mapnik/pkg/PLIST,v
retrieving revision 1.4
diff -u -p -u -p -r1.4 PLIST
--- pkg/PLIST	18 Sep 2015 20:07:09 -0000	1.4
+++ pkg/PLIST	20 May 2021 14:52:46 -0000
@@ -1,6 +1,7 @@
 @comment $OpenBSD: PLIST,v 1.4 2015/09/18 20:07:09 landry Exp $
 bin/mapnik-config
-@bin bin/nik2img
+@bin bin/mapnik-index
+@bin bin/mapnik-render
 @bin bin/shapeindex
 include/mapnik/
 include/mapnik/agg/
@@ -139,11 +140,13 @@ include/mapnik/attribute_collector.hpp
 include/mapnik/attribute_descriptor.hpp
 include/mapnik/boolean.hpp
 include/mapnik/box2d.hpp
+include/mapnik/box2d_impl.hpp
 include/mapnik/cairo/
 include/mapnik/cairo/cairo_context.hpp
 include/mapnik/cairo/cairo_image_util.hpp
 include/mapnik/cairo/cairo_render_vector.hpp
 include/mapnik/cairo/cairo_renderer.hpp
+include/mapnik/cairo/render_polygon_pattern.hpp
 include/mapnik/cairo_io.hpp
 include/mapnik/color.hpp
 include/mapnik/color_factory.hpp
@@ -154,6 +157,9 @@ include/mapnik/css_color_grammar.hpp
 include/mapnik/css_color_grammar_impl.hpp
 include/mapnik/csv/
 include/mapnik/csv/csv_grammar.hpp
+include/mapnik/csv/csv_grammar_impl.hpp
+include/mapnik/csv/csv_types.hpp
+include/mapnik/cxx11_support.hpp
 include/mapnik/datasource.hpp
 include/mapnik/datasource_cache.hpp
 include/mapnik/datasource_geometry_type.hpp
@@ -194,6 +200,7 @@ include/mapnik/geometry_fusion_adapted.h
 include/mapnik/geometry_is_empty.hpp
 include/mapnik/geometry_is_simple.hpp
 include/mapnik/geometry_is_valid.hpp
+include/mapnik/geometry_remove_empty.hpp
 include/mapnik/geometry_reprojection.hpp
 include/mapnik/geometry_reprojection_impl.hpp
 include/mapnik/geometry_strategy.hpp
@@ -201,7 +208,6 @@ include/mapnik/geometry_to_path.hpp
 include/mapnik/geometry_transform.hpp
 include/mapnik/geometry_type.hpp
 include/mapnik/geometry_types.hpp
-include/mapnik/geometry_unique.hpp
 include/mapnik/global.hpp
 include/mapnik/gradient.hpp
 include/mapnik/grid/
@@ -213,8 +219,8 @@ include/mapnik/grid/grid_render_marker.h
 include/mapnik/grid/grid_renderer.hpp
 include/mapnik/grid/grid_renderer_base.hpp
 include/mapnik/grid/grid_rendering_buffer.hpp
-include/mapnik/grid/grid_util.hpp
 include/mapnik/grid/grid_view.hpp
+include/mapnik/grid_vertex_converter.hpp
 include/mapnik/group/
 include/mapnik/group/group_layout.hpp
 include/mapnik/group/group_layout_manager.hpp
@@ -248,6 +254,7 @@ include/mapnik/image_view_impl.hpp
 include/mapnik/image_view_null.hpp
 include/mapnik/jpeg_io.hpp
 include/mapnik/json/
+include/mapnik/json/attribute_value_visitor.hpp
 include/mapnik/json/error_handler.hpp
 include/mapnik/json/extract_bounding_box_grammar.hpp
 include/mapnik/json/extract_bounding_box_grammar_impl.hpp
@@ -266,11 +273,12 @@ include/mapnik/json/geometry_grammar.hpp
 include/mapnik/json/geometry_grammar_impl.hpp
 include/mapnik/json/geometry_parser.hpp
 include/mapnik/json/geometry_util.hpp
+include/mapnik/json/positions.hpp
 include/mapnik/json/positions_grammar.hpp
 include/mapnik/json/positions_grammar_impl.hpp
 include/mapnik/json/properties_generator_grammar.hpp
 include/mapnik/json/properties_generator_grammar_impl.hpp
-include/mapnik/json/symbolizer_grammar.hpp
+include/mapnik/json/stringifier.hpp
 include/mapnik/json/topojson_grammar.hpp
 include/mapnik/json/topojson_grammar_impl.hpp
 include/mapnik/json/topojson_utils.hpp
@@ -281,12 +289,19 @@ include/mapnik/layer.hpp
 include/mapnik/load_map.hpp
 include/mapnik/make_unique.hpp
 include/mapnik/map.hpp
+include/mapnik/mapbox/
+include/mapnik/mapbox/optional.hpp
+include/mapnik/mapbox/recursive_wrapper.hpp
+include/mapnik/mapbox/variant.hpp
+include/mapnik/mapbox/variant_io.hpp
+include/mapnik/mapbox/variant_visitor.hpp
 include/mapnik/mapped_memory_cache.hpp
 include/mapnik/marker.hpp
 include/mapnik/marker_cache.hpp
 include/mapnik/marker_helpers.hpp
 include/mapnik/markers_placement.hpp
 include/mapnik/markers_placements/
+include/mapnik/markers_placements/basic.hpp
 include/mapnik/markers_placements/interior.hpp
 include/mapnik/markers_placements/line.hpp
 include/mapnik/markers_placements/point.hpp
@@ -294,7 +309,6 @@ include/mapnik/markers_placements/vertex
 include/mapnik/markers_placements/vertext_last.hpp
 include/mapnik/memory_datasource.hpp
 include/mapnik/memory_featureset.hpp
-include/mapnik/miniz_png.hpp
 include/mapnik/octree.hpp
 include/mapnik/offset_converter.hpp
 include/mapnik/palette.hpp
@@ -341,6 +355,7 @@ include/mapnik/sparsehash/template_util.
 include/mapnik/sparsehash/type_traits.h
 include/mapnik/sql_utils.hpp
 include/mapnik/sse.hpp
+include/mapnik/stringify_macro.hpp
 include/mapnik/svg/
 include/mapnik/svg/geometry_svg_generator.hpp
 include/mapnik/svg/geometry_svg_generator_impl.hpp
@@ -351,11 +366,14 @@ include/mapnik/svg/svg_path_adapter.hpp
 include/mapnik/svg/svg_path_attributes.hpp
 include/mapnik/svg/svg_path_commands.hpp
 include/mapnik/svg/svg_path_grammar.hpp
+include/mapnik/svg/svg_path_grammar_impl.hpp
 include/mapnik/svg/svg_path_parser.hpp
 include/mapnik/svg/svg_points_grammar.hpp
+include/mapnik/svg/svg_points_grammar_impl.hpp
 include/mapnik/svg/svg_renderer_agg.hpp
 include/mapnik/svg/svg_storage.hpp
 include/mapnik/svg/svg_transform_grammar.hpp
+include/mapnik/svg/svg_transform_grammar_impl.hpp
 include/mapnik/symbolizer.hpp
 include/mapnik/symbolizer_base.hpp
 include/mapnik/symbolizer_default_values.hpp
@@ -407,6 +425,7 @@ include/mapnik/transform_path_adapter.hp
 include/mapnik/transform_processor.hpp
 include/mapnik/unicode.hpp
 include/mapnik/util/
+include/mapnik/util/char_array_buffer.hpp
 include/mapnik/util/const_rendering_buffer.hpp
 include/mapnik/util/container_adapter.hpp
 include/mapnik/util/conversions.hpp
@@ -423,12 +442,12 @@ include/mapnik/util/geometry_to_wkt.hpp
 include/mapnik/util/hsl.hpp
 include/mapnik/util/is_clockwise.hpp
 include/mapnik/util/math.hpp
+include/mapnik/util/name_to_int.hpp
 include/mapnik/util/noncopyable.hpp
 include/mapnik/util/path_iterator.hpp
-include/mapnik/util/recursive_wrapper.hpp
 include/mapnik/util/rounding_cast.hpp
 include/mapnik/util/singleton.hpp
-include/mapnik/util/spirit_transform_attribute.hpp
+include/mapnik/util/spatial_index.hpp
 include/mapnik/util/timer.hpp
 include/mapnik/util/trim.hpp
 include/mapnik/util/utf_conv_win.hpp
@@ -447,6 +466,8 @@ include/mapnik/vertex_processor.hpp
 include/mapnik/vertex_vector.hpp
 include/mapnik/view_strategy.hpp
 include/mapnik/view_transform.hpp
+include/mapnik/warning_ignore.hpp
+include/mapnik/warning_ignore_agg.hpp
 include/mapnik/warp.hpp
 include/mapnik/webp_io.hpp
 include/mapnik/well_known_srs.hpp
@@ -461,8 +482,8 @@ include/mapnik/xml_attribute_cast.hpp
 include/mapnik/xml_loader.hpp
 include/mapnik/xml_node.hpp
 include/mapnik/xml_tree.hpp
-lib/libmapnik-json.a
-lib/libmapnik-wkt.a
+@static-lib lib/libmapnik-json.a
+@static-lib lib/libmapnik-wkt.a
 @lib lib/libmapnik.so.${LIBmapnik_VERSION}
 lib/mapnik/
 lib/mapnik/input/
