From 884db7de8c282557a9765c7c6f9d02d49ced061d Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 26 Aug 2014 12:43:11 -0700 Subject: [PATCH 01/59] fix issue 1 from #2396 --- include/mapnik/symbolizer.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/mapnik/symbolizer.hpp b/include/mapnik/symbolizer.hpp index 346a67e0d..a58bb0d46 100644 --- a/include/mapnik/symbolizer.hpp +++ b/include/mapnik/symbolizer.hpp @@ -539,7 +539,7 @@ MAPNIK_DECL boost::optional get_optional(symbolizer_base const& sym, keys key } template -constexpr auto to_integral(Enum e) -> typename std::underlying_type::type +auto to_integral(Enum e) -> typename std::underlying_type::type { return static_cast::type>(e); } From 8d448dad5c41589f93b193485e335a6e7ccf0a48 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 26 Aug 2014 12:43:31 -0700 Subject: [PATCH 02/59] fix issue 2 from #2396 --- src/agg/process_group_symbolizer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/agg/process_group_symbolizer.cpp b/src/agg/process_group_symbolizer.cpp index 8b497ee22..b48cbf1cc 100644 --- a/src/agg/process_group_symbolizer.cpp +++ b/src/agg/process_group_symbolizer.cpp @@ -46,7 +46,7 @@ namespace mapnik { struct thunk_renderer : public util::static_visitor<> { using renderer_type = agg_renderer; - using buffer_type = typename renderer_type::buffer_type; + using buffer_type = renderer_type::buffer_type; using text_renderer_type = agg_text_renderer; thunk_renderer(renderer_type &ren, From 147375e1973963bd8846f3c6b2ae17d7edb6c250 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 26 Aug 2014 13:23:48 -0700 Subject: [PATCH 03/59] workaround issue 3 from #2396 --- src/expression_grammar.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/expression_grammar.cpp b/src/expression_grammar.cpp index 682de90b0..59492ac5e 100644 --- a/src/expression_grammar.cpp +++ b/src/expression_grammar.cpp @@ -22,6 +22,7 @@ // NOTE: we define this here in a cpp because def is needed twice: // once by src/expression.cpp and once by mapnik/transform_expression_grammar_impl.hpp +#define BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES #include #include #include From c1140fb2eaa0cb29b559bfd2d2a1785d0c3efe30 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 26 Aug 2014 19:01:45 -0700 Subject: [PATCH 04/59] fix issue 4 of #2396 --- src/symbolizer_keys.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/symbolizer_keys.cpp b/src/symbolizer_keys.cpp index a2d343edb..f6615c3e9 100644 --- a/src/symbolizer_keys.cpp +++ b/src/symbolizer_keys.cpp @@ -29,8 +29,10 @@ namespace mapnik { +static constexpr std::uint8_t const_max_key = static_cast(keys::MAX_SYMBOLIZER_KEY); + // tuple -> name, default value, enumeration to string converter lambda, target property type -static const property_meta_type key_meta[to_integral(keys::MAX_SYMBOLIZER_KEY)] = +static const property_meta_type key_meta[const_max_key] = { property_meta_type{ "gamma", 1.0, nullptr, property_types::target_double}, property_meta_type{ "gamma-method", static_cast(GAMMA_POWER), nullptr, property_types::target_gamma_method}, @@ -127,7 +129,7 @@ mapnik::keys get_key(std::string const& name) { std::string name_copy(name); boost::algorithm::replace_all(name_copy,"_","-"); - for (unsigned i=0; i< to_integral(keys::MAX_SYMBOLIZER_KEY) ; ++i) + for (unsigned i=0; i< const_max_key ; ++i) { property_meta_type const& item = key_meta[i]; if (name_copy == std::get<0>(item)) @@ -139,4 +141,4 @@ mapnik::keys get_key(std::string const& name) return static_cast(0); } -} +} \ No newline at end of file From f364069e252d58200862e1f10ee940223beb5f92 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 26 Aug 2014 19:11:44 -0700 Subject: [PATCH 05/59] fix issue 6 from #2396 --- include/mapnik/renderer_common/process_building_symbolizer.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/mapnik/renderer_common/process_building_symbolizer.hpp b/include/mapnik/renderer_common/process_building_symbolizer.hpp index 5785e7bda..e4e8ab78e 100644 --- a/include/mapnik/renderer_common/process_building_symbolizer.hpp +++ b/include/mapnik/renderer_common/process_building_symbolizer.hpp @@ -28,6 +28,7 @@ #include #include +#include namespace mapnik { From 5789777199214ef85d3318c738eadc65e768e226 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 26 Aug 2014 19:23:24 -0700 Subject: [PATCH 06/59] fix issue 7 from #2396 --- src/text/vertex_cache.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/text/vertex_cache.cpp b/src/text/vertex_cache.cpp index 56790f879..244d404bc 100644 --- a/src/text/vertex_cache.cpp +++ b/src/text/vertex_cache.cpp @@ -20,12 +20,10 @@ * *****************************************************************************/ // mapnik +#include #include #include -// boost - - namespace mapnik { From ee1c2aec4724517865cb8af799a5536d617299e7 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 26 Aug 2014 19:24:06 -0700 Subject: [PATCH 07/59] use icu shaper to avoid needing to build harfbuzz right now - refs #2396 --- src/text/text_layout.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/text/text_layout.cpp b/src/text/text_layout.cpp index aac5b3d88..9e1d24834 100644 --- a/src/text/text_layout.cpp +++ b/src/text/text_layout.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include // ICU #include @@ -229,7 +229,7 @@ void text_layout::clear() void text_layout::shape_text(text_line & line) { - harfbuzz_shaper::shape_text(line, itemizer_, width_map_, font_manager_, scale_factor_); + icu_shaper::shape_text(line, itemizer_, width_map_, font_manager_, scale_factor_); } void text_layout::evaluate_properties(feature_impl const& feature, attributes const& attrs) From a8e8632572b41a449f99e9b32052ca5915c0a89f Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 26 Aug 2014 19:24:53 -0700 Subject: [PATCH 08/59] don't trust __cplusplus - addresses issue 5 from #2396 --- include/mapnik/make_unique.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/mapnik/make_unique.hpp b/include/mapnik/make_unique.hpp index aeda304a2..ea2974cf0 100644 --- a/include/mapnik/make_unique.hpp +++ b/include/mapnik/make_unique.hpp @@ -25,7 +25,8 @@ #include -#if __cplusplus <= 201103L +// http://stackoverflow.com/questions/14131454/visual-studio-2012-cplusplus-and-c-11 +#if defined(_MSC_VER) && _MSC_VER < 1800 || !defined(_MSC_VER) && __cplusplus <= 201103L namespace std { From 0635052349c2ba1d6f5b5dd79c80babed21d705e Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 26 Aug 2014 20:01:59 -0700 Subject: [PATCH 09/59] fix CTP 2013 issue 8 from #2396 --- include/mapnik/group/group_rule.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/mapnik/group/group_rule.hpp b/include/mapnik/group/group_rule.hpp index 267093b78..b971c040c 100644 --- a/include/mapnik/group/group_rule.hpp +++ b/include/mapnik/group/group_rule.hpp @@ -40,7 +40,7 @@ struct MAPNIK_DECL group_rule { using symbolizers = std::vector; - group_rule(const expression_ptr& filter = std::make_shared(true), + group_rule(const expression_ptr& filter = expression_ptr(new expr_node), const expression_ptr& repeat_key = expression_ptr()); group_rule &operator=(const group_rule &rhs); From 91da442cdd40290d2cab8315d63b1966c319c477 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 26 Aug 2014 20:39:08 -0700 Subject: [PATCH 10/59] fix issue 9 for 2013 CTP from #2396 --- src/load_map.cpp | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/src/load_map.cpp b/src/load_map.cpp index f4e6663b7..2732728dd 100644 --- a/src/load_map.cpp +++ b/src/load_map.cpp @@ -777,6 +777,46 @@ void map_parser::parse_symbolizers(rule & rule, xml_node const & node) rule.reserve(node.size()); for (auto const& sym_node : node) { +#if defined(_MSC_VER) && _MSC_VER <= 1800 + std::string const& name = sym_node.name(); + if (name == "PointSymbolizer") { + parse_point_symbolizer(rule, sym_node); + sym_node.set_processed(true); + } else if (name == "LinePatternSymbolizer") { + parse_line_pattern_symbolizer(rule, sym_node); + sym_node.set_processed(true); + } else if (name == "PolygonPatternSymbolizer") { + parse_polygon_pattern_symbolizer(rule, sym_node); + sym_node.set_processed(true); + } else if (name == "TextSymbolizer") { + parse_text_symbolizer(rule, sym_node); + sym_node.set_processed(true); + } else if (name == "ShieldSymbolizer") { + parse_shield_symbolizer(rule, sym_node); + sym_node.set_processed(true); + } else if (name == "LineSymbolizer") { + parse_line_symbolizer(rule, sym_node); + sym_node.set_processed(true); + } else if (name == "PolygonSymbolizer") { + parse_polygon_symbolizer(rule, sym_node); + sym_node.set_processed(true); + } else if (name == "BuildingSymbolizer") { + parse_building_symbolizer(rule, sym_node); + sym_node.set_processed(true); + } else if (name == "RasterSymbolizer") { + parse_raster_symbolizer(rule, sym_node); + sym_node.set_processed(true); + } else if (name == "MarkersSymbolizer") { + parse_markers_symbolizer(rule, sym_node); + sym_node.set_processed(true); + } else if (name == "GroupSymbolizer") { + parse_group_symbolizer(rule, sym_node); + sym_node.set_processed(true); + } else if (name == "DebugSymbolizer") { + parse_debug_symbolizer(rule, sym_node); + sym_node.set_processed(true); + } +#else switch (name2int(sym_node.name().c_str())) { case name2int("PointSymbolizer"): @@ -830,6 +870,7 @@ void map_parser::parse_symbolizers(rule & rule, xml_node const & node) default: break; } +#endif } } From 7ff712af529ba86bcd741b0a44957b90d227fa03 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 28 Aug 2014 17:24:17 -0700 Subject: [PATCH 11/59] remove unused code --- include/mapnik/symbolizer.hpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/include/mapnik/symbolizer.hpp b/include/mapnik/symbolizer.hpp index 1e5f2dc5f..181881281 100644 --- a/include/mapnik/symbolizer.hpp +++ b/include/mapnik/symbolizer.hpp @@ -538,12 +538,6 @@ boost::optional get_optional(symbolizer_base const& sym, keys key) return boost::optional(); } -template -auto to_integral(Enum e) -> typename std::underlying_type::type -{ - return static_cast::type>(e); -} - using property_meta_type = std::tuple, property_types>; MAPNIK_DECL property_meta_type const& get_meta(mapnik::keys key); MAPNIK_DECL mapnik::keys get_key(std::string const& name); From 37f4c574f3e94f2b27fecf0d232d49d653a95c12 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 28 Aug 2014 18:49:56 -0700 Subject: [PATCH 12/59] remove unused function::name that does not compile with msvs 2013 - refs #2396 --- src/function_call.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/function_call.cpp b/src/function_call.cpp index 4eba797c8..45538aa60 100644 --- a/src/function_call.cpp +++ b/src/function_call.cpp @@ -31,7 +31,6 @@ namespace mapnik { struct exp_impl { //using type = T; - static constexpr char const* name = "exp"; value_type operator() (value_type const& val) const { return std::exp(val.to_double()); @@ -42,7 +41,6 @@ struct exp_impl // sin struct sin_impl { - static constexpr char const* name = "sin"; value_type operator() (value_type const& val) const { return std::sin(val.to_double()); @@ -52,7 +50,6 @@ struct sin_impl // cos struct cos_impl { - static constexpr char const* name = "cos"; value_type operator() (value_type const& val) const { return std::cos(val.to_double()); @@ -62,7 +59,6 @@ struct cos_impl // tan struct tan_impl { - static constexpr char const* name = "tan"; value_type operator() (value_type const& val) const { return std::tan(val.to_double()); @@ -82,7 +78,6 @@ struct atan_impl // abs struct abs_impl { - static constexpr char const* name = "abs"; value_type operator() (value_type const& val) const { return std::fabs(val.to_double()); From 324fb11f66ac80891229dc184dcd5167fbbbd9bf Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 28 Aug 2014 18:51:27 -0700 Subject: [PATCH 13/59] include - fixes msvs compile - refs #2396 --- include/mapnik/vertex_vector.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/mapnik/vertex_vector.hpp b/include/mapnik/vertex_vector.hpp index 174b43d4c..e21769c57 100644 --- a/include/mapnik/vertex_vector.hpp +++ b/include/mapnik/vertex_vector.hpp @@ -34,6 +34,7 @@ // stl #include #include // required for memcpy with linux/g++ +#include namespace mapnik { From b93d0e97e06b8008a1ad9a467e2b5ec5fc599405 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 28 Aug 2014 18:57:59 -0700 Subject: [PATCH 14/59] remove one more unused function::name that does not compile with msvs 2013 - refs #2396 --- src/function_call.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/function_call.cpp b/src/function_call.cpp index 45538aa60..e1725bb22 100644 --- a/src/function_call.cpp +++ b/src/function_call.cpp @@ -68,7 +68,6 @@ struct tan_impl // atan struct atan_impl { - static constexpr char const* name = "atan"; value_type operator()(value_type const& val) const { return std::atan(val.to_double()); From e146dee620499d1a0c807ab4e73d2abcfaab3767 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 28 Aug 2014 19:06:03 -0700 Subject: [PATCH 15/59] c++ style --- tests/cpp_tests/image_io_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cpp_tests/image_io_test.cpp b/tests/cpp_tests/image_io_test.cpp index aae80ede0..2767bc2e0 100644 --- a/tests/cpp_tests/image_io_test.cpp +++ b/tests/cpp_tests/image_io_test.cpp @@ -23,7 +23,7 @@ int main(int argc, char** argv) { mapnik::image_data_32 im(256,256); unsigned char* bytes = im.getBytes(); - mapnik::image_data_32 * im_ptr = new mapnik::image_data_32(256,256,(unsigned int *)bytes); + mapnik::image_data_32 * im_ptr = new mapnik::image_data_32(im.width(),im.height(),static_cast(bytes)); unsigned char* same_bytes = im_ptr->getBytes(); BOOST_TEST(bytes == same_bytes); delete im_ptr; From 6f3b8f969d4477ac7062f749bf7f68d24a4088ae Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 28 Aug 2014 19:06:17 -0700 Subject: [PATCH 16/59] params: make msvs happy --- include/mapnik/params.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/mapnik/params.hpp b/include/mapnik/params.hpp index 5bccdd7a0..6699e631e 100644 --- a/include/mapnik/params.hpp +++ b/include/mapnik/params.hpp @@ -100,6 +100,13 @@ boost::optional parameters::get(std::string const& key) co template MAPNIK_DECL boost::optional parameters::get(std::string const& key, mapnik::boolean_type const& default_opt_value) const; + +template MAPNIK_DECL +boost::optional parameters::get(std::string const& key) const; +template MAPNIK_DECL +boost::optional parameters::get(std::string const& key, + mapnik::value_null const& default_opt_value) const; + #endif } From 6074e87bbb2be7d4b8336969c5a6ac2ad2f1f447 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 28 Aug 2014 19:29:07 -0700 Subject: [PATCH 17/59] include optional - fix msvs compile - refs #2396 --- plugins/input/shape/shape_io.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/input/shape/shape_io.hpp b/plugins/input/shape/shape_io.hpp index 2147a6bf3..727310c0e 100644 --- a/plugins/input/shape/shape_io.hpp +++ b/plugins/input/shape/shape_io.hpp @@ -29,6 +29,9 @@ #include // boost +#include + +// stl #include #include "dbfile.hpp" From 8e8bc6c74595a6f0f0c62f2aa3d3bd632f46b7dd Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 28 Aug 2014 20:52:18 -0700 Subject: [PATCH 18/59] dodge linking error with image_data on windows - refs #2396 --- tests/cpp_tests/image_io_test.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/cpp_tests/image_io_test.cpp b/tests/cpp_tests/image_io_test.cpp index 2767bc2e0..ddd5b2baf 100644 --- a/tests/cpp_tests/image_io_test.cpp +++ b/tests/cpp_tests/image_io_test.cpp @@ -21,14 +21,15 @@ int main(int argc, char** argv) boost::optional type; try { +#if !defined(_MSC_VER) mapnik::image_data_32 im(256,256); - unsigned char* bytes = im.getBytes(); - mapnik::image_data_32 * im_ptr = new mapnik::image_data_32(im.width(),im.height(),static_cast(bytes)); - unsigned char* same_bytes = im_ptr->getBytes(); - BOOST_TEST(bytes == same_bytes); + mapnik::image_data_32::pixel_type * data = im.getData(); + mapnik::image_data_32 * im_ptr = new mapnik::image_data_32(im.width(),im.height(),data); + mapnik::image_data_32::pixel_type * same_data = im_ptr->getData(); + BOOST_TEST(data == same_data); delete im_ptr; - BOOST_TEST(bytes == same_bytes); - + BOOST_TEST(data == same_data); +#endif BOOST_TEST(set_working_dir(args)); #if defined(HAVE_JPEG) From 726d27866cedbe30f40299e3639745f0012aaaee Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 28 Aug 2014 22:18:12 -0700 Subject: [PATCH 19/59] hookk up harfbuzz --- build.bat | 310 +++++++++++++++++++++++++++++++++++++ mapnik.gyp | 437 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 747 insertions(+) create mode 100644 build.bat create mode 100644 mapnik.gyp diff --git a/build.bat b/build.bat new file mode 100644 index 000000000..52c620522 --- /dev/null +++ b/build.bat @@ -0,0 +1,310 @@ +@echo off + +::git clone https://chromium.googlesource.com/external/gyp.git +::CALL "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86 +::SET PATH=C:\Python27;%PATH% + +::ddt ..\mapnik-sdk +::IF ERRORLEVEL NEQ 0 GOTO ERROR +::ddt build\Release +::IF ERRORLEVEL NEQ 0 GOTO ERROR + +if NOT EXIST gyp ( + CALL git clone https://chromium.googlesource.com/external/gyp.git gyp + IF %ERRORLEVEL% NEQ 0 GOTO ERROR +) + +:: run find command and bail on error +:: this ensures we have the unix find command on path +:: before trying to run gyp +find deps/clipper/src/ -name "*.cpp" +IF %ERRORLEVEL% NEQ 0 GOTO ERROR + +CALL gyp\gyp.bat mapnik.gyp --depth=. ^ + -Dincludes=%CD%/../mapnik-sdk/includes ^ + -Dlibs=%CD%/../mapnik-sdk/libs ^ + -f msvs -G msvs_version=2013 ^ + --generator-output=build ^ + --no-duplicate-basename-check +IF %ERRORLEVEL% NEQ 0 GOTO ERROR + +if NOT EXIST ..\mapnik-sdk ( + mkdir ..\mapnik-sdk + mkdir ..\mapnik-sdk\bin + mkdir ..\mapnik-sdk\includes + mkdir ..\mapnik-sdk\share + mkdir ..\mapnik-sdk\libs + mkdir ..\mapnik-sdk\libs\mapnik\input + mkdir ..\mapnik-sdk\libs\mapnik\fonts +) +IF %ERRORLEVEL% NEQ 0 GOTO ERROR + +SET DEPSDIR=.. + +:: includes +xcopy /i /d /s /q %DEPSDIR%\harfbuzz-build\harfbuzz\hb-version.h ..\mapnik-sdk\includes\harfbuzz\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\harfbuzz\src\hb.h ..\mapnik-sdk\includes\harfbuzz\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +::xcopy /i /d /s /q %DEPSDIR%\harfbuzz\src\hb-icu.h ..\mapnik-sdk\includes\harfbuzz\ /Y +::IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\harfbuzz\src\hb-shape-plan.h ..\mapnik-sdk\includes\harfbuzz\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\harfbuzz\src\hb-shape.h ..\mapnik-sdk\includes\harfbuzz\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\harfbuzz\src\hb-set.h ..\mapnik-sdk\includes\harfbuzz\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\harfbuzz\src\hb-ft.h ..\mapnik-sdk\includes\harfbuzz\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\harfbuzz\src\hb-buffer.h ..\mapnik-sdk\includes\harfbuzz\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\harfbuzz\src\hb-unicode.h ..\mapnik-sdk\includes\harfbuzz\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\harfbuzz\src\hb-common.h ..\mapnik-sdk\includes\harfbuzz\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\harfbuzz\src\hb-blob.h ..\mapnik-sdk\includes\harfbuzz\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\harfbuzz\src\hb-font.h ..\mapnik-sdk\includes\harfbuzz\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\harfbuzz\src\hb-face.h ..\mapnik-sdk\includes\harfbuzz\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\harfbuzz\src\hb-deprecated.h ..\mapnik-sdk\includes\harfbuzz\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\boost_1_56_0\boost ..\mapnik-sdk\includes\boost /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\icu\include\unicode ..\mapnik-sdk\includes\unicode /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\freetype\include ..\mapnik-sdk\includes\freetype2 /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\libxml2\include ..\mapnik-sdk\includes\libxml2 /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\zlib-1.2.5\zlib.h ..\mapnik-sdk\includes\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\zlib-1.2.5\zconf.h ..\mapnik-sdk\includes\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\libpng\png.h ..\mapnik-sdk\includes\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\libpng\pnglibconf.h ..\mapnik-sdk\includes\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\libpng\pngconf.h ..\mapnik-sdk\includes\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\jpeg\jpeglib.h ..\mapnik-sdk\includes\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\jpeg\jconfig.h ..\mapnik-sdk\includes\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\jpeg\jmorecfg.h ..\mapnik-sdk\includes\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\webp\src\webp ..\mapnik-sdk\includes\webp /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\proj\src\proj_api.h ..\mapnik-sdk\includes\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\libtiff\libtiff\tiff.h ..\mapnik-sdk\includes\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\libtiff\libtiff\tiffvers.h ..\mapnik-sdk\includes\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\libtiff\libtiff\tiffconf.h ..\mapnik-sdk\includes\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\libtiff\libtiff\tiffio.h ..\mapnik-sdk\includes\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\cairo\cairo-version.h ..\mapnik-sdk\includes\cairo\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\cairo\src\cairo-features.h ..\mapnik-sdk\includes\cairo\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\cairo\src\cairo.h ..\mapnik-sdk\includes\cairo\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\cairo\src\cairo-deprecated.h ..\mapnik-sdk\includes\cairo\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\cairo\src\cairo-svg.h ..\mapnik-sdk\includes\cairo\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\cairo\src\cairo-svg-surface-private.h ..\mapnik-sdk\includes\cairo\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\cairo\src\cairo-pdf.h ..\mapnik-sdk\includes\cairo\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\cairo\src\cairo-ft.h ..\mapnik-sdk\includes\cairo\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\cairo\src\cairo-ps.h ..\mapnik-sdk\includes\cairo\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\protobuf\vsprojects\include ..\mapnik-sdk\includes\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR + +:: libs +xcopy /i /d /s /q %DEPSDIR%\harfbuzz-build\Release\harfbuzz.lib ..\mapnik-sdk\libs\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\freetype\freetype.lib ..\mapnik-sdk\libs\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\icu\lib\icuuc.lib ..\mapnik-sdk\libs\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\icu\lib\icuin.lib ..\mapnik-sdk\libs\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\icu\bin\icuuc53.dll ..\mapnik-sdk\libs\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\icu\bin\icudt53.dll ..\mapnik-sdk\libs\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\icu\bin\icuin53.dll ..\mapnik-sdk\libs\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\libxml2\win32\bin.msvc\libxml2_a.lib ..\mapnik-sdk\libs\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\libxml2\win32\bin.msvc\libxml2_a_dll.lib ..\mapnik-sdk\libs\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\libxml2\win32\bin.msvc\libxml2.dll ..\mapnik-sdk\libs\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\libxml2\win32\bin.msvc\libxml2.lib ..\mapnik-sdk\libs\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\libtiff\libtiff\libtiff.dll ..\mapnik-sdk\libs\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +::xcopy /i /d /s /q %DEPSDIR%\libtiff\libtiff\libtiff.lib ..\mapnik-sdk\libs\ /Y +::IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\libtiff\libtiff\libtiff_i.lib ..\mapnik-sdk\libs\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\zlib-1.2.5\zlib.lib ..\mapnik-sdk\libs\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\proj\src\proj.lib ..\mapnik-sdk\libs\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\webp\output\release-dynamic\x86\lib\libwebp_dll.lib ..\mapnik-sdk\libs\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\webp\output\release-dynamic\x86\bin\libwebp.dll ..\mapnik-sdk\libs\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\libpng\projects\vstudio\Release\libpng16.lib ..\mapnik-sdk\libs\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\libpng\projects\vstudio\Release\libpng16.dll ..\mapnik-sdk\libs\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\jpeg\libjpeg.lib ..\mapnik-sdk\libs\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\cairo\src\release\cairo-static.lib ..\mapnik-sdk\libs\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\cairo\src\release\cairo.lib ..\mapnik-sdk\libs\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\cairo\src\release\cairo.dll ..\mapnik-sdk\libs\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\boost_1_56_0\stage\lib\* ..\mapnik-sdk\libs\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\protobuf\vsprojects\Release\libprotobuf-lite.lib ..\mapnik-sdk\libs\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR + +:: data +xcopy /i /d /s /q %DEPSDIR%\proj\nad ..\mapnik-sdk\share\proj /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\gdal\data ..\mapnik-sdk\share\gdal +IF %ERRORLEVEL% NEQ 0 GOTO ERROR + +:: bin +xcopy /i /d /s /q %DEPSDIR%\protobuf\vsprojects\Release\protoc.exe ..\mapnik-sdk\bin /Y +xcopy /i /d /s /q mapnik-config.bat ..\mapnik-sdk\bin /Y + +:: headers for plugins +xcopy /i /d /s /q %DEPSDIR%\postgresql\src\interfaces\libpq\libpq-fe.h ..\mapnik-sdk\includes\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\postgresql\src\include\postgres_ext.h ..\mapnik-sdk\includes\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\postgresql\src\include\pg_config_ext.h ..\mapnik-sdk\includes\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\sqlite\sqlite3.h ..\mapnik-sdk\includes\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +::xcopy /i /d /s /q %DEPSDIR%\gdal\gcore\*h ..\mapnik-sdk\includes\gdal\ /Y +::IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\gdal\ogr\ogr_feature.h ..\mapnik-sdk\includes\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\gdal\ogr\ogr_spatialref.h ..\mapnik-sdk\includes\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\gdal\ogr\ogr_geometry.h ..\mapnik-sdk\includes\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\gdal\ogr\ogr_core.h ..\mapnik-sdk\includes\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\gdal\ogr\ogr_featurestyle.h ..\mapnik-sdk\includes\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\gdal\ogr\ogrsf_frmts\ogrsf_frmts.h ..\mapnik-sdk\includes\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\gdal\ogr\ogr_srs_api.h ..\mapnik-sdk\includes\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\gdal\gcore\gdal_priv.h ..\mapnik-sdk\includes\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\gdal\gcore\gdal_frmts.h ..\mapnik-sdk\includes\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\gdal\gcore\gdal.h ..\mapnik-sdk\includes\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\gdal\gcore\gdal_version.h ..\mapnik-sdk\includes\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\gdal\port\cpl_minixml.h ..\mapnik-sdk\includes\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\gdal\port\cpl_atomic_ops.h ..\mapnik-sdk\includes\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\gdal\port\cpl_string.h ..\mapnik-sdk\includes\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\gdal\port\cpl_conv.h ..\mapnik-sdk\includes\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\gdal\port\cpl_vsi.h ..\mapnik-sdk\includes\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\gdal\port\cpl_virtualmem.h ..\mapnik-sdk\includes\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\gdal\port\cpl_error.h ..\mapnik-sdk\includes\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\gdal\port\cpl_progress.h ..\mapnik-sdk\includes\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\gdal\port\cpl_port.h ..\mapnik-sdk\includes\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\gdal\port\cpl_config.h ..\mapnik-sdk\includes\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR + +:: libs for plugins +xcopy /i /d /s /q %DEPSDIR%\postgresql\src\interfaces\libpq\Release\libpq.lib ..\mapnik-sdk\libs\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\postgresql\src\interfaces\libpq\Release\libpq.dll ..\mapnik-sdk\libs\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\sqlite\sqlite3.lib ..\mapnik-sdk\libs\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\gdal\gdal_i.lib ..\mapnik-sdk\libs\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +:: NOTE: impossible to statically link gdal due to: +:: http://stackoverflow.com/questions/4596212/c-odbc-refuses-to-statically-link-to-libcmt-lib-under-vs2010 +::xcopy /i /d /s /q %DEPSDIR%\gdal\gdal.lib ..\mapnik-sdk\libs\ /Y +::IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\gdal\gdal111.dll ..\mapnik-sdk\libs\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\expat\win32\bin\Release\libexpat.lib ..\mapnik-sdk\libs\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q %DEPSDIR%\expat\win32\bin\Release\libexpat.dll ..\mapnik-sdk\libs\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR + +:: detect trouble with mimatched linking +dumpbin /directives ..\mapnik-sdk\libs\*lib | grep LIBCMT + +::msbuild /m:2 /t:mapnik /p:BuildInParellel=true .\build\mapnik.sln /p:Configuration=Release + +msbuild /m:2 /p:BuildInParellel=true .\build\mapnik.sln /p:Configuration=Release +:: /t:rebuild +:: /v:diag > build.log +IF %ERRORLEVEL% NEQ 0 GOTO ERROR + +:: run tests +SET PATH=%CD%\..\mapnik-sdk\libs;%PATH% +for %%t in (build\Release\*test.exe) do ( %%t -d %CD% ) + +:: install mapnik libs +xcopy /i /d /s /q .\build\Release\mapnik.lib ..\mapnik-sdk\libs\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q .\build\Release\mapnik.dll ..\mapnik-sdk\libs\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR + +:: plugins +xcopy /i /d /s /q .\build\Release\*input ..\mapnik-sdk\libs\mapnik\input\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR + +:: install mapnik headers +xcopy /i /d /s /q .\deps\mapnik\sparsehash ..\mapnik-sdk\includes\mapnik\sparsehash /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q .\deps\agg\include ..\mapnik-sdk\includes\mapnik\agg /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q .\deps\clipper\include ..\mapnik-sdk\includes\mapnik\agg /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q .\include\mapnik ..\mapnik-sdk\includes\mapnik /Y + + +GOTO DONE + +:ERROR +echo ----------ERROR MAPNIK -------------- +echo ERRORLEVEL %ERRORLEVEL% + +:DONE + +EXIT /b %ERRORLEVEL% diff --git a/mapnik.gyp b/mapnik.gyp new file mode 100644 index 000000000..401779277 --- /dev/null +++ b/mapnik.gyp @@ -0,0 +1,437 @@ +{ + 'includes': [ + './common.gypi' + ], + 'variables': { + 'includes%':'', + 'libs%':'', + 'common_defines': [ + 'BIGINT', + 'BOOST_REGEX_HAS_ICU', + 'HAVE_JPEG', + 'MAPNIK_USE_PROJ4', + 'HAVE_PNG', + 'HAVE_TIFF', + 'HAVE_WEBP', + 'MAPNIK_THREADSAFE', + 'HAVE_CAIRO', + 'GRID_RENDERER', + 'SVG_RENDERER' + ], + 'common_includes': [ + './include', # mapnik + './deps/', # mapnik/sparsehash + './deps/agg/include/', # agg + './deps/clipper/include/', # clipper + './', # boost shim + '<@(includes)/', + '<@(includes)/freetype2', + '<@(includes)/libxml2', + '<@(includes)/cairo' + ], + "conditions": [ + ["OS=='win'", { + 'common_defines': ['LIBXML_STATIC'], # static libxml: libxml2_a.lib + 'common_libraries': [] + }, { + 'common_defines': ['SHAPE_MEMORY_MAPPED_FILE','U_CHARSET_IS_UTF8=1'], + 'common_libraries': [ + '-Wl,-search_paths_first', + '-stdlib=libstdc++', + '-L<@(libs)' + ] + }] + ] + }, + 'targets': [ + { + 'target_name': 'mapnik', + 'product_name': 'mapnik', + 'type': 'shared_library', + 'sources': [ + ' Date: Fri, 29 Aug 2014 00:05:34 -0700 Subject: [PATCH 20/59] re-enable harfbuzz shaper --- common.gypi | 124 +++++++++++++++ include/mapnik/text/harfbuzz_shaper.hpp | 12 +- mapnik-config.bat | 203 ++++++++++++++++++++++++ src/text/text_layout.cpp | 4 +- 4 files changed, 338 insertions(+), 5 deletions(-) create mode 100644 common.gypi create mode 100644 mapnik-config.bat diff --git a/common.gypi b/common.gypi new file mode 100644 index 000000000..d5280d71c --- /dev/null +++ b/common.gypi @@ -0,0 +1,124 @@ +{ + 'target_defaults': { + 'default_configuration': 'Release', + 'msbuild_toolset':'CTP_Nov2013', + 'msvs_configuration_platform': 'Win32', + 'msvs_disabled_warnings': [ 4068,4244,4005,4506,4345,4804,4805,4661 ], + 'xcode_settings': { + 'CLANG_CXX_LIBRARY': 'libstdc++', + 'CLANG_CXX_LANGUAGE_STANDARD':'c++03', + 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0', + 'MACOSX_DEPLOYMENT_TARGET':'10.9', + 'WARNING_CFLAGS': [ + '-Wall', + '-Wextra', + '-pedantic', + '-Wno-parentheses', + '-Wno-char-subscripts', + '-Wno-unused-parameter', + '-Wno-c++11-narrowing', + '-Wno-c++11-long-long', + '-Wno-unsequenced', + '-Wno-sign-compare', + '-Wno-unused-function', + '-Wno-redeclared-class-member', + '-Wno-c99-extensions', + '-Wno-c++11-extra-semi', + '-Wno-variadic-macros', + '-Wno-c++11-extensions', + '-Wno-unused-const-variable' + ] + }, + 'msvs_settings': { + 'VCCLCompilerTool': { + 'ObjectFile': '$(IntDir)/%(RelativeDir)/', # support similiarly named files in different directories + 'ExceptionHandling': 1, # /EHsc + 'RuntimeTypeInfo': 'true', # /GR + 'RuntimeLibrary': '2' # 2:/MD + } + }, + 'defines': [ 'BOOST_SPIRIT_USE_PHOENIX_V3=1' ], + 'cflags_cc': ['-std=c++03'], + 'conditions': [ + ['OS=="win"', { + 'defines': ['_WINDOWS'] + }] + ], + 'configurations': { + 'Debug': { + 'defines!': [ + 'NDEBUG' + ], + 'cflags_cc!': [ + '-O3', + '-O2', + '-Os', + '-DNDEBUG' + ], + 'cflags': [ '-g', '-O0' ], + 'defines': [ 'DEBUG' ], + 'xcode_settings': { + 'GCC_OPTIMIZATION_LEVEL': '0', + 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'YES', + 'DEAD_CODE_STRIPPING': 'NO', + 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'NO' + }, + 'msvs_settings': { + 'VCCLCompilerTool': { + 'RuntimeLibrary': '3', # /MDd + 'Optimization': 0, # /Od, no optimization + 'MinimalRebuild': 'false', + 'OmitFramePointers': 'false', + 'BasicRuntimeChecks': 3 # /RTC1 + }, + 'VCLinkerTool': { + 'AdditionalOptions': [ + #'/NODEFAULTLIB:msvcrt.lib' + ] + } + } + }, + 'Release': { + 'cflags': [ '-O3' ], + 'defines': [ 'NDEBUG' ], + 'xcode_settings': { + 'GCC_OPTIMIZATION_LEVEL': '3', + 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO', + 'DEAD_CODE_STRIPPING': 'YES', + 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES' + }, + 'msvs_settings': { + 'VCCLCompilerTool': { + 'RuntimeLibrary': '2', #0:/MT, 2:/MD, + 'Optimization': 3, # /Ox, full optimization + 'FavorSizeOrSpeed': 1, # /Ot, favour speed over size + 'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible + #'WholeProgramOptimization': 'true', # /GL, whole program optimization, needed for LTCG + 'OmitFramePointers': 'true', + #'EnableFunctionLevelLinking': 'true', + 'EnableIntrinsicFunctions': 'true', + 'AdditionalOptions': [ + '/MP', # compile across multiple CPUs + ], + 'DebugInformationFormat': '0' + }, + 'VCLibrarianTool': { + 'AdditionalOptions': [ + '/LTCG' # link time code generation + ], + }, + 'VCLinkerTool': { + #'LinkTimeCodeGeneration': 1, # link-time code generation + #'OptimizeReferences': 2, # /OPT:REF + #'EnableCOMDATFolding': 2, # /OPT:ICF + 'LinkIncremental': 2, # force incremental linking + 'GenerateDebugInformation': 'false', + 'AdditionalOptions': [ + #'/NODEFAULTLIB:libcmt.lib' + ], + } + } + } + } + } +} diff --git a/include/mapnik/text/harfbuzz_shaper.hpp b/include/mapnik/text/harfbuzz_shaper.hpp index 4d0ab729f..efabcbf4d 100644 --- a/include/mapnik/text/harfbuzz_shaper.hpp +++ b/include/mapnik/text/harfbuzz_shaper.hpp @@ -33,11 +33,17 @@ // harfbuzz #include #include -#include +//#include namespace mapnik { +static inline hb_script_t _icu_script_to_script(UScriptCode script) +{ + if (script == USCRIPT_INVALID_CODE) return HB_SCRIPT_INVALID; + return hb_script_from_string(uscript_getShortName(script), -1); +} + struct harfbuzz_shaper { static void shape_text(text_line & line, @@ -55,7 +61,7 @@ static void shape_text(text_line & line, auto hb_buffer_deleter = [](hb_buffer_t * buffer) { hb_buffer_destroy(buffer);}; const std::unique_ptr buffer(hb_buffer_create(),hb_buffer_deleter); - hb_buffer_set_unicode_funcs(buffer.get(), hb_icu_get_unicode_funcs()); + //hb_buffer_set_unicode_funcs(buffer.get(), hb_icu_get_unicode_funcs()); hb_buffer_pre_allocate(buffer.get(), length); mapnik::value_unicode_string const& text = itemizer.text(); @@ -72,7 +78,7 @@ static void shape_text(text_line & line, hb_buffer_clear_contents(buffer.get()); hb_buffer_add_utf16(buffer.get(), text.getBuffer(), text.length(), text_item.start, text_item.end - text_item.start); hb_buffer_set_direction(buffer.get(), (text_item.rtl == UBIDI_RTL)?HB_DIRECTION_RTL:HB_DIRECTION_LTR); - hb_buffer_set_script(buffer.get(), hb_icu_script_to_script(text_item.script)); + hb_buffer_set_script(buffer.get(), _icu_script_to_script(text_item.script)); hb_font_t *font(hb_ft_font_create(face->get_face(), nullptr)); hb_shape(font, buffer.get(), nullptr, 0); hb_font_destroy(font); diff --git a/mapnik-config.bat b/mapnik-config.bat new file mode 100644 index 000000000..0393e6029 --- /dev/null +++ b/mapnik-config.bat @@ -0,0 +1,203 @@ +@echo off + +set MAPNIK_VERSION=2.3.0 +set MAPNIK_VERSION_NUMBER=200300 +::SET CUR_PATH=%CD% +::cd %CD%/../ +set MAPNIK_PREFIX=%~dp0 +:: strip trailing \ +set MAPNIK_PREFIX=%MAPNIK_PREFIX:~0,-1% +:: get dirname +for %%F in (%MAPNIK_PREFIX%) do set MAPNIK_PREFIX=%%~dpF +:: strip trailing \ +set MAPNIK_PREFIX=%MAPNIK_PREFIX:~0,-1% +:: now make double \\ for gyp +set MAPNIK_PREFIX=%MAPNIK_PREFIX:\=\\% +set MAPNIK_LIBS=%MAPNIK_PREFIX%\\libs +set MAPNIK_INCLUDES=%MAPNIK_PREFIX%\\includes +set MAPNIK_INPUT_PLUGINS_DIRECTORY=%MAPNIK_PREFIX%\\libs\\mapnik\\input +set MAPNIK_FONTS_DIRECTORY=%MAPNIK_PREFIX%\\libs\\mapnik\\fonts + +if /i "%1"=="" ( + goto help + goto exit_error +) + +if /i "%1"=="-v" ( + echo %MAPNIK_VERSION% + goto exit_ok +) + +if /i "%1"=="--version" ( + echo %MAPNIK_VERSION% + goto exit_ok +) + +if /i "%1"=="--version-number" ( + echo %MAPNIK_VERSION_NUMBER% + goto exit_ok +) + +if /i "%1"=="--git-revision" ( + echo TODO + goto exit_ok +) + +if /i "%1"=="--git-describe" ( + echo TODO + goto exit_ok +) + +if /i "%1"=="help" ( + goto help + goto exit_ok +) + +if /i "%1"=="--help" ( + goto help + goto exit_ok +) + +if /i "%1"=="-help" ( + goto help + goto exit_ok +) + +if /i "%1"=="-h" ( + goto help + goto exit_ok +) + +if /i "%1"=="/help" ( + goto help + goto exit_ok +) + +if /i "%1"=="?" ( + goto help + goto exit_ok +) + +if /i "%1"=="-?" ( + goto help + goto exit_ok +) + +if /i "%1"=="--?" ( + goto help + goto exit_ok +) + +if /i "%1"=="/?" ( + goto help + goto exit_ok +) + +set hit="" + +if /i "%1"=="--prefix" ( + echo %MAPNIK_PREFIX% + set hit="yes" +) + +if /i "%1"=="--input-plugins" ( + echo %MAPNIK_INPUT_PLUGINS_DIRECTORY% + set hit="yes" +) + +if /i "%1"=="--fonts" ( + echo %MAPNIK_FONTS_DIRECTORY% + set hit="yes" +) + +if /i "%1"=="--lib-name" ( + echo mapnik + set hit="yes" +) + +if /i "%1"=="--libs" ( + echo mapnik.lib + set hit="yes" +) + +@rem TODO - figure out how to avoid hardcoding these library names +if /i "%1"=="--dep-libs" ( + echo libpng16.lib zlib.lib libwebp.lib libjpeg.lib icuuc.lib icuin.lib cairo.lib libboost_system-vc120-mt-1_56.lib libxml2_a.lib ws2_32.lib + set hit="yes" +) + +if /i "%1"=="--ldflags" ( + echo %MAPNIK_LIBS% + set hit="yes" +) + +if /i "%1"=="--defines" ( + echo _WINDOWS HAVE_JPEG HAVE_PNG HAVE_WEBP HAVE_TIFF MAPNIK_USE_PROJ4 BOOST_REGEX_HAS_ICU GRID_RENDERER SVG_RENDERER MAPNIK_THREADSAFE BIGINT HAVE_LIBXML2 HAVE_CAIRO LIBXML_STATIC + set hit="yes" +) + +@rem /MD is multithreaded dynamic linking - http://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx +@rem /EHsc is to support c++ exceptions - http://msdn.microsoft.com/en-us/library/1deeycx5(v=vs.80).aspx +@rem /GR is to support rtti (runtime type detection) - http://msdn.microsoft.com/en-us/library/we6hfdy0.aspx +if /i "%1"=="--cxxflags" ( + echo /MD /EHsc /GR + set hit="yes" +) + +if /i "%1"=="--includes" ( + echo %MAPNIK_INCLUDES% %MAPNIK_INCLUDES%\\mapnik\\agg + set hit="yes" +) + +if /i "%1"=="--all-flags" ( + @rem nothing here yet + echo "" + set hit="yes" +) + +if /i "%1"=="--cxx" ( + @rem nothing here yet + echo "" + set hit="yes" +) + +if /i "%1"=="--cflags" ( + @rem nothing here yet + echo "" + set hit="yes" +) + +if /i "%1"=="--dep-includes" ( + @rem nothing here yet + echo %MAPNIK_INCLUDES%\\cairo %MAPNIK_INCLUDES%\\freetype2 %MAPNIK_INCLUDES%\\google %MAPNIK_INCLUDES%\\libxml2 + set hit="yes" +) + +@rem if we got here print warning +if /i %hit%=="" ( + echo unknown option %1 1>&2 +) + +goto exit_ok + +:help +echo Usage: mapnik-config +echo Examples: +echo --libs : provide lib name for mapnik.dll +echo --defines : provide compiler defines needed for this mapnik build +echo --dep-libs : provide lib names of depedencies +echo --ldflags : provide lib paths to depedencies +echo --cxxflags : provide compiler flags +echo --includes : provide header paths for mapnik +echo --dep-includes : provide header paths for dependencies +echo --input-plugins : provide path to input plugins directory +echo --fonts : provide path to fonts directory + + +:exit_error +@rem exit /b 1 +goto :EOF + +:exit_ok +@rem exit /b 0 +goto :EOF \ No newline at end of file diff --git a/src/text/text_layout.cpp b/src/text/text_layout.cpp index 9e1d24834..aac5b3d88 100644 --- a/src/text/text_layout.cpp +++ b/src/text/text_layout.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include // ICU #include @@ -229,7 +229,7 @@ void text_layout::clear() void text_layout::shape_text(text_line & line) { - icu_shaper::shape_text(line, itemizer_, width_map_, font_manager_, scale_factor_); + harfbuzz_shaper::shape_text(line, itemizer_, width_map_, font_manager_, scale_factor_); } void text_layout::evaluate_properties(feature_impl const& feature, attributes const& attrs) From c5833e8724b6bafcd7142bb678a50fd4fd44c045 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 29 Aug 2014 00:31:10 -0700 Subject: [PATCH 21/59] run tests after copying mapnik.lib in place --- build.bat | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/build.bat b/build.bat index 52c620522..481d1ba65 100644 --- a/build.bat +++ b/build.bat @@ -275,10 +275,6 @@ msbuild /m:2 /p:BuildInParellel=true .\build\mapnik.sln /p:Configuration=Release :: /v:diag > build.log IF %ERRORLEVEL% NEQ 0 GOTO ERROR -:: run tests -SET PATH=%CD%\..\mapnik-sdk\libs;%PATH% -for %%t in (build\Release\*test.exe) do ( %%t -d %CD% ) - :: install mapnik libs xcopy /i /d /s /q .\build\Release\mapnik.lib ..\mapnik-sdk\libs\ /Y IF %ERRORLEVEL% NEQ 0 GOTO ERROR @@ -298,6 +294,9 @@ xcopy /i /d /s /q .\deps\clipper\include ..\mapnik-sdk\includes\mapnik\agg /Y IF %ERRORLEVEL% NEQ 0 GOTO ERROR xcopy /i /d /s /q .\include\mapnik ..\mapnik-sdk\includes\mapnik /Y +:: run tests +SET PATH=%CD%\..\mapnik-sdk\libs;%PATH% +::for %%t in (build\Release\*test.exe) do ( %%t -d %CD% ) GOTO DONE From 363850585424e3d1bcceaf83b468e1d11aeff7d0 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 29 Aug 2014 10:35:54 -0700 Subject: [PATCH 22/59] add correct webp lib --- mapnik-config.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mapnik-config.bat b/mapnik-config.bat index 0393e6029..741ab74e6 100644 --- a/mapnik-config.bat +++ b/mapnik-config.bat @@ -122,7 +122,7 @@ if /i "%1"=="--libs" ( @rem TODO - figure out how to avoid hardcoding these library names if /i "%1"=="--dep-libs" ( - echo libpng16.lib zlib.lib libwebp.lib libjpeg.lib icuuc.lib icuin.lib cairo.lib libboost_system-vc120-mt-1_56.lib libxml2_a.lib ws2_32.lib + echo libpng16.lib zlib.lib libwebp_dll.lib libjpeg.lib icuuc.lib icuin.lib cairo.lib libboost_system-vc120-mt-1_56.lib libxml2_a.lib ws2_32.lib set hit="yes" ) From 8d7bf7a8da7afa7eadb270d6a0e3d1a623c1b42b Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 29 Aug 2014 11:01:04 -0700 Subject: [PATCH 23/59] fix imagedata visability on windows --- include/mapnik/image_data.hpp | 3 +-- tests/cpp_tests/image_io_test.cpp | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/include/mapnik/image_data.hpp b/include/mapnik/image_data.hpp index 599387e04..f576e09d0 100644 --- a/include/mapnik/image_data.hpp +++ b/include/mapnik/image_data.hpp @@ -25,7 +25,6 @@ // mapnik #include -#include // stl #include @@ -35,7 +34,7 @@ namespace mapnik { template -class MAPNIK_DECL ImageData +class ImageData { public: using pixel_type = T; diff --git a/tests/cpp_tests/image_io_test.cpp b/tests/cpp_tests/image_io_test.cpp index ddd5b2baf..e9c010ff9 100644 --- a/tests/cpp_tests/image_io_test.cpp +++ b/tests/cpp_tests/image_io_test.cpp @@ -21,7 +21,6 @@ int main(int argc, char** argv) boost::optional type; try { -#if !defined(_MSC_VER) mapnik::image_data_32 im(256,256); mapnik::image_data_32::pixel_type * data = im.getData(); mapnik::image_data_32 * im_ptr = new mapnik::image_data_32(im.width(),im.height(),data); @@ -29,7 +28,6 @@ int main(int argc, char** argv) BOOST_TEST(data == same_data); delete im_ptr; BOOST_TEST(data == same_data); -#endif BOOST_TEST(set_working_dir(args)); #if defined(HAVE_JPEG) From cc5d80cb4d64c9ce8d60ab0249c515eb3a7c7e6b Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 29 Aug 2014 16:45:54 -0700 Subject: [PATCH 24/59] msvs 2014 built boost libs --- mapnik.gyp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/mapnik.gyp b/mapnik.gyp index 401779277..01e04c430 100644 --- a/mapnik.gyp +++ b/mapnik.gyp @@ -78,10 +78,10 @@ ["OS=='win'", { 'defines': ['MAPNIK_EXPORTS'], 'libraries':[ - 'libboost_filesystem-vc120-mt-1_56.lib', - 'libboost_regex-vc120-mt-1_56.lib', - 'libboost_thread-vc120-mt-1_56.lib', - 'libboost_system-vc120-mt-1_56.lib', + 'libboost_filesystem-vc140-mt-1_56.lib', + 'libboost_regex-vc140-mt-1_56.lib', + 'libboost_thread-vc140-mt-1_56.lib', + 'libboost_system-vc140-mt-1_56.lib', 'libpng16.lib', 'proj.lib', 'libtiff_i.lib', @@ -153,8 +153,8 @@ "conditions": [ ["OS=='win'", { 'libraries':[ - 'libboost_thread-vc120-mt-1_56.lib', - 'libboost_system-vc120-mt-1_56.lib', + 'libboost_thread-vc140-mt-1_56.lib', + 'libboost_system-vc140-mt-1_56.lib', 'icuuc.lib' ], },{ @@ -174,8 +174,8 @@ "conditions": [ ["OS=='win'", { 'libraries':[ - 'libboost_thread-vc120-mt-1_56.lib', - 'libboost_system-vc120-mt-1_56.lib', + 'libboost_thread-vc140-mt-1_56.lib', + 'libboost_system-vc140-mt-1_56.lib', 'icuuc.lib' ], },{ @@ -204,8 +204,8 @@ 'libraries': [ 'gdal_i.lib', 'libexpat.lib', - 'libboost_thread-vc120-mt-1_56.lib', - 'libboost_system-vc120-mt-1_56.lib', + 'libboost_thread-vc140-mt-1_56.lib', + 'libboost_system-vc140-mt-1_56.lib', 'icuuc.lib', 'odbccp32.lib' ] @@ -225,8 +225,8 @@ 'libraries': [ 'gdal_i.lib', 'libexpat.lib', - 'libboost_thread-vc120-mt-1_56.lib', - 'libboost_system-vc120-mt-1_56.lib', + 'libboost_thread-vc140-mt-1_56.lib', + 'libboost_system-vc140-mt-1_56.lib', 'icuuc.lib', 'odbccp32.lib' ] @@ -420,7 +420,7 @@ "conditions": [ ["OS=='win'", { 'libraries':[ - 'libboost_thread-vc120-mt-1_56.lib' + 'libboost_thread-vc140-mt-1_56.lib' ], 'defines': ['MAPNIK_EXPORTS'] },{ From 15356f63203742b462cb40aed547c93c24545a39 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 29 Aug 2014 16:46:23 -0700 Subject: [PATCH 25/59] handle wchar_t UChar typedef on windows --- include/mapnik/text/harfbuzz_shaper.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/mapnik/text/harfbuzz_shaper.hpp b/include/mapnik/text/harfbuzz_shaper.hpp index efabcbf4d..61270e04d 100644 --- a/include/mapnik/text/harfbuzz_shaper.hpp +++ b/include/mapnik/text/harfbuzz_shaper.hpp @@ -76,7 +76,7 @@ static void shape_text(text_line & line, { ++pos; hb_buffer_clear_contents(buffer.get()); - hb_buffer_add_utf16(buffer.get(), text.getBuffer(), text.length(), text_item.start, text_item.end - text_item.start); + hb_buffer_add_utf16(buffer.get(), reinterpret_cast(text.getBuffer()), text.length(), text_item.start, text_item.end - text_item.start); hb_buffer_set_direction(buffer.get(), (text_item.rtl == UBIDI_RTL)?HB_DIRECTION_RTL:HB_DIRECTION_LTR); hb_buffer_set_script(buffer.get(), _icu_script_to_script(text_item.script)); hb_font_t *font(hb_ft_font_create(face->get_face(), nullptr)); From 6b364aedf147df7c032abcd89fd2b63247ef3b2c Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 29 Aug 2014 16:46:38 -0700 Subject: [PATCH 26/59] harfbuzz in mapnik-config.bat --- mapnik-config.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mapnik-config.bat b/mapnik-config.bat index 741ab74e6..4889fba62 100644 --- a/mapnik-config.bat +++ b/mapnik-config.bat @@ -122,7 +122,7 @@ if /i "%1"=="--libs" ( @rem TODO - figure out how to avoid hardcoding these library names if /i "%1"=="--dep-libs" ( - echo libpng16.lib zlib.lib libwebp_dll.lib libjpeg.lib icuuc.lib icuin.lib cairo.lib libboost_system-vc120-mt-1_56.lib libxml2_a.lib ws2_32.lib + echo libpng16.lib zlib.lib harfbuzz.lib libwebp_dll.lib libjpeg.lib icuuc.lib icuin.lib cairo.lib libboost_system-vc120-mt-1_56.lib libxml2_a.lib ws2_32.lib set hit="yes" ) From a2927c123bf77f428437ea7ce5832cae8231fd29 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 29 Aug 2014 16:58:13 -0700 Subject: [PATCH 27/59] C++11 mode via v140 toolset + libc++ --- common.gypi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common.gypi b/common.gypi index d5280d71c..2d9f9fe3e 100644 --- a/common.gypi +++ b/common.gypi @@ -1,12 +1,12 @@ { 'target_defaults': { 'default_configuration': 'Release', - 'msbuild_toolset':'CTP_Nov2013', + 'msbuild_toolset':'v140', 'msvs_configuration_platform': 'Win32', 'msvs_disabled_warnings': [ 4068,4244,4005,4506,4345,4804,4805,4661 ], 'xcode_settings': { - 'CLANG_CXX_LIBRARY': 'libstdc++', - 'CLANG_CXX_LANGUAGE_STANDARD':'c++03', + 'CLANG_CXX_LIBRARY': 'libc++', + 'CLANG_CXX_LANGUAGE_STANDARD':'c++11', 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0', 'MACOSX_DEPLOYMENT_TARGET':'10.9', 'WARNING_CFLAGS': [ From c7f58ee64c59157117b46f00e246f5bbed4bf0bc Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 29 Aug 2014 17:41:29 -0700 Subject: [PATCH 28/59] clean up harfbuzz->icu interface --- include/mapnik/text/harfbuzz_shaper.hpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/include/mapnik/text/harfbuzz_shaper.hpp b/include/mapnik/text/harfbuzz_shaper.hpp index 61270e04d..e9af8e93e 100644 --- a/include/mapnik/text/harfbuzz_shaper.hpp +++ b/include/mapnik/text/harfbuzz_shaper.hpp @@ -29,11 +29,11 @@ #include // stl #include +#include // harfbuzz #include #include -//#include namespace mapnik { @@ -41,7 +41,17 @@ namespace mapnik static inline hb_script_t _icu_script_to_script(UScriptCode script) { if (script == USCRIPT_INVALID_CODE) return HB_SCRIPT_INVALID; - return hb_script_from_string(uscript_getShortName(script), -1); + return hb_script_from_string(uscript_getShortName(script), -1); +} + +static inline const uint16_t * uchar_to_utf16(const UChar* src) +{ + static_assert(sizeof(UChar) == sizeof(uint16_t),"UChar is eq size to uint16_t"); +#if defined(_MSC_VER) + return reinterpret_cast(src); +#else + return src; +#endif } struct harfbuzz_shaper @@ -61,7 +71,6 @@ static void shape_text(text_line & line, auto hb_buffer_deleter = [](hb_buffer_t * buffer) { hb_buffer_destroy(buffer);}; const std::unique_ptr buffer(hb_buffer_create(),hb_buffer_deleter); - //hb_buffer_set_unicode_funcs(buffer.get(), hb_icu_get_unicode_funcs()); hb_buffer_pre_allocate(buffer.get(), length); mapnik::value_unicode_string const& text = itemizer.text(); @@ -76,7 +85,7 @@ static void shape_text(text_line & line, { ++pos; hb_buffer_clear_contents(buffer.get()); - hb_buffer_add_utf16(buffer.get(), reinterpret_cast(text.getBuffer()), text.length(), text_item.start, text_item.end - text_item.start); + hb_buffer_add_utf16(buffer.get(), uchar_to_utf16(text.getBuffer()), text.length(), text_item.start, text_item.end - text_item.start); hb_buffer_set_direction(buffer.get(), (text_item.rtl == UBIDI_RTL)?HB_DIRECTION_RTL:HB_DIRECTION_LTR); hb_buffer_set_script(buffer.get(), _icu_script_to_script(text_item.script)); hb_font_t *font(hb_ft_font_create(face->get_face(), nullptr)); From 3004dfc8c19fa3f48f466d254a5e0cd442acb4ac Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 29 Aug 2014 18:52:52 -0700 Subject: [PATCH 29/59] fix conversions test with msvs 2014 --- tests/cpp_tests/conversions_test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/cpp_tests/conversions_test.cpp b/tests/cpp_tests/conversions_test.cpp index ab1088c31..6f750840a 100644 --- a/tests/cpp_tests/conversions_test.cpp +++ b/tests/cpp_tests/conversions_test.cpp @@ -5,13 +5,13 @@ #include #include -#if defined(_MSC_VER) +#if defined(_MSC_VER) && _MSC_VER < 1900 #include #endif int main(int argc, char** argv) { - #if defined(_MSC_VER) + #if defined(_MSC_VER) && _MSC_VER < 1900 unsigned int old = _set_output_format(_TWO_DIGIT_EXPONENT); #endif std::vector args; From aba0d790dce8d91aa9b62047dd405cd8fb14f863 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 29 Aug 2014 18:53:10 -0700 Subject: [PATCH 30/59] start running tests again --- build.bat | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build.bat b/build.bat index 481d1ba65..02ce518b3 100644 --- a/build.bat +++ b/build.bat @@ -293,10 +293,13 @@ IF %ERRORLEVEL% NEQ 0 GOTO ERROR xcopy /i /d /s /q .\deps\clipper\include ..\mapnik-sdk\includes\mapnik\agg /Y IF %ERRORLEVEL% NEQ 0 GOTO ERROR xcopy /i /d /s /q .\include\mapnik ..\mapnik-sdk\includes\mapnik /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR :: run tests SET PATH=%CD%\..\mapnik-sdk\libs;%PATH% -::for %%t in (build\Release\*test.exe) do ( %%t -d %CD% ) +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +for %%t in (build\Release\*test.exe) do ( call %%t -d %CD% ) +IF %ERRORLEVEL% NEQ 0 GOTO ERROR GOTO DONE @@ -305,5 +308,6 @@ echo ----------ERROR MAPNIK -------------- echo ERRORLEVEL %ERRORLEVEL% :DONE +echo DONE building Mapnik EXIT /b %ERRORLEVEL% From c36767af9e900dfd8e6ae9121162b521fe6a1905 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 29 Aug 2014 18:56:03 -0700 Subject: [PATCH 31/59] msvc 2014 linking fixes --- mapnik.gyp | 137 +++++++++++++++++++++++++++++++++-------------------- 1 file changed, 85 insertions(+), 52 deletions(-) diff --git a/mapnik.gyp b/mapnik.gyp index 01e04c430..7b22e1615 100644 --- a/mapnik.gyp +++ b/mapnik.gyp @@ -31,7 +31,7 @@ ], "conditions": [ ["OS=='win'", { - 'common_defines': ['LIBXML_STATIC'], # static libxml: libxml2_a.lib + 'common_defines': ['LIBXML_STATIC','BOOST_LIB_TOOLSET=vc140','BOOST_COMPILER=14.0'], # static libxml: libxml2_a.lib 'common_libraries': [] }, { 'common_defines': ['SHAPE_MEMORY_MAPPED_FILE','U_CHARSET_IS_UTF8=1'], @@ -251,16 +251,8 @@ 'secur32.lib', 'icuuc.lib', 'ws2_32.lib', - ], - # TODO - ideally we find a way to avoid this - # currently needed to dodge double-linking - 'msvs_settings': { - 'VCLinkerTool': { - 'AdditionalOptions': [ - '/NODEFAULTLIB:libcmt.lib' - ], - } - } + 'libboost_regex-vc140-mt-1_56.lib' + ] } , { 'libraries': [ ' Date: Fri, 29 Aug 2014 19:05:15 -0700 Subject: [PATCH 32/59] Avoid boost auto-link warnings --- mapnik.gyp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mapnik.gyp b/mapnik.gyp index 7b22e1615..f2abaa5e3 100644 --- a/mapnik.gyp +++ b/mapnik.gyp @@ -31,7 +31,7 @@ ], "conditions": [ ["OS=='win'", { - 'common_defines': ['LIBXML_STATIC','BOOST_LIB_TOOLSET=vc140','BOOST_COMPILER=14.0'], # static libxml: libxml2_a.lib + 'common_defines': ['LIBXML_STATIC','BOOST_LIB_TOOLSET="vc140"','BOOST_COMPILER="14.0"'], # static libxml: libxml2_a.lib 'common_libraries': [] }, { 'common_defines': ['SHAPE_MEMORY_MAPPED_FILE','U_CHARSET_IS_UTF8=1'], From 43eb395839e17d126215242a10fb87e88058ce9d Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 29 Aug 2014 19:45:49 -0700 Subject: [PATCH 33/59] fixup mapnik-config.bat defines and link flags --- mapnik-config.bat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mapnik-config.bat b/mapnik-config.bat index 4889fba62..d43c7297f 100644 --- a/mapnik-config.bat +++ b/mapnik-config.bat @@ -122,7 +122,7 @@ if /i "%1"=="--libs" ( @rem TODO - figure out how to avoid hardcoding these library names if /i "%1"=="--dep-libs" ( - echo libpng16.lib zlib.lib harfbuzz.lib libwebp_dll.lib libjpeg.lib icuuc.lib icuin.lib cairo.lib libboost_system-vc120-mt-1_56.lib libxml2_a.lib ws2_32.lib + echo libpng16.lib zlib.lib harfbuzz.lib libwebp_dll.lib libjpeg.lib icuuc.lib icuin.lib cairo.lib libboost_system-vc140-mt-1_56.lib libxml2_a.lib ws2_32.lib set hit="yes" ) @@ -132,7 +132,7 @@ if /i "%1"=="--ldflags" ( ) if /i "%1"=="--defines" ( - echo _WINDOWS HAVE_JPEG HAVE_PNG HAVE_WEBP HAVE_TIFF MAPNIK_USE_PROJ4 BOOST_REGEX_HAS_ICU GRID_RENDERER SVG_RENDERER MAPNIK_THREADSAFE BIGINT HAVE_LIBXML2 HAVE_CAIRO LIBXML_STATIC + echo _WINDOWS BOOST_ALL_NO_LIB BOOST_LIB_TOOLSET="vc140" BOOST_COMPILER="14.0" BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES HAVE_JPEG HAVE_PNG HAVE_WEBP HAVE_TIFF MAPNIK_USE_PROJ4 BOOST_REGEX_HAS_ICU GRID_RENDERER SVG_RENDERER MAPNIK_THREADSAFE BIGINT HAVE_LIBXML2 HAVE_CAIRO LIBXML_STATIC set hit="yes" ) From 5bf866bbcb1f24a5c61a2569d9db715b1eb69196 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Sun, 31 Aug 2014 04:19:15 +0000 Subject: [PATCH 34/59] adapt to zlib and harfbuzz build changes --- build.bat | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build.bat b/build.bat index 02ce518b3..d514fe8b7 100644 --- a/build.bat +++ b/build.bat @@ -78,9 +78,9 @@ xcopy /i /d /s /q %DEPSDIR%\freetype\include ..\mapnik-sdk\includes\freetype2 /Y IF %ERRORLEVEL% NEQ 0 GOTO ERROR xcopy /i /d /s /q %DEPSDIR%\libxml2\include ..\mapnik-sdk\includes\libxml2 /Y IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\zlib-1.2.5\zlib.h ..\mapnik-sdk\includes\ /Y +xcopy /i /d /s /q %DEPSDIR%\zlib\zlib.h ..\mapnik-sdk\includes\ /Y IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\zlib-1.2.5\zconf.h ..\mapnik-sdk\includes\ /Y +xcopy /i /d /s /q %DEPSDIR%\zlib\zconf.h ..\mapnik-sdk\includes\ /Y IF %ERRORLEVEL% NEQ 0 GOTO ERROR xcopy /i /d /s /q %DEPSDIR%\libpng\png.h ..\mapnik-sdk\includes\ /Y IF %ERRORLEVEL% NEQ 0 GOTO ERROR @@ -128,7 +128,7 @@ xcopy /i /d /s /q %DEPSDIR%\protobuf\vsprojects\include ..\mapnik-sdk\includes\ IF %ERRORLEVEL% NEQ 0 GOTO ERROR :: libs -xcopy /i /d /s /q %DEPSDIR%\harfbuzz-build\Release\harfbuzz.lib ..\mapnik-sdk\libs\ /Y +xcopy /i /d /s /q %DEPSDIR%\harfbuzz-build\harfbuzz.lib ..\mapnik-sdk\libs\ /Y IF %ERRORLEVEL% NEQ 0 GOTO ERROR xcopy /i /d /s /q %DEPSDIR%\freetype\freetype.lib ..\mapnik-sdk\libs\ /Y IF %ERRORLEVEL% NEQ 0 GOTO ERROR @@ -156,7 +156,7 @@ IF %ERRORLEVEL% NEQ 0 GOTO ERROR ::IF %ERRORLEVEL% NEQ 0 GOTO ERROR xcopy /i /d /s /q %DEPSDIR%\libtiff\libtiff\libtiff_i.lib ..\mapnik-sdk\libs\ /Y IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\zlib-1.2.5\zlib.lib ..\mapnik-sdk\libs\ /Y +xcopy /i /d /s /q %DEPSDIR%\zlib\zlib.lib ..\mapnik-sdk\libs\ /Y IF %ERRORLEVEL% NEQ 0 GOTO ERROR xcopy /i /d /s /q %DEPSDIR%\proj\src\proj.lib ..\mapnik-sdk\libs\ /Y IF %ERRORLEVEL% NEQ 0 GOTO ERROR From ddb6e7e007aeee76c4040658e4ebc05f40931d28 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Sun, 31 Aug 2014 06:30:04 +0000 Subject: [PATCH 35/59] remove tabs from mapnik.gyp --- mapnik.gyp | 112 ++++++++++++++++++++++++++--------------------------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/mapnik.gyp b/mapnik.gyp index f2abaa5e3..11fd6defe 100644 --- a/mapnik.gyp +++ b/mapnik.gyp @@ -76,7 +76,7 @@ ], "conditions": [ ["OS=='win'", { - 'defines': ['MAPNIK_EXPORTS'], + 'defines': ['MAPNIK_EXPORTS'], 'libraries':[ 'libboost_filesystem-vc140-mt-1_56.lib', 'libboost_regex-vc140-mt-1_56.lib', @@ -96,7 +96,7 @@ 'freetype.lib', 'zlib.lib', 'cairo.lib', - 'harfbuzz.lib' + 'harfbuzz.lib' ] },{ 'libraries':[ @@ -207,7 +207,7 @@ 'libboost_thread-vc140-mt-1_56.lib', 'libboost_system-vc140-mt-1_56.lib', 'icuuc.lib', - 'odbccp32.lib' + 'odbccp32.lib' ] } , { 'libraries': [ ' Date: Sun, 31 Aug 2014 07:01:06 +0000 Subject: [PATCH 36/59] attempt to build the python bindings (TODO: symbol errors wrt to swap) --- build.bat | 6 +++++- mapnik.gyp | 40 +++++++++++++++++++++++++++++++++++++- src/expression_grammar.cpp | 1 - 3 files changed, 44 insertions(+), 3 deletions(-) diff --git a/build.bat b/build.bat index d514fe8b7..ddf012910 100644 --- a/build.bat +++ b/build.bat @@ -270,7 +270,7 @@ dumpbin /directives ..\mapnik-sdk\libs\*lib | grep LIBCMT ::msbuild /m:2 /t:mapnik /p:BuildInParellel=true .\build\mapnik.sln /p:Configuration=Release -msbuild /m:2 /p:BuildInParellel=true .\build\mapnik.sln /p:Configuration=Release +msbuild /m:%NUMBER_OF_PROCESSORS% /p:BuildInParellel=true .\build\mapnik.sln /p:Configuration=Release :: /t:rebuild :: /v:diag > build.log IF %ERRORLEVEL% NEQ 0 GOTO ERROR @@ -281,6 +281,10 @@ IF %ERRORLEVEL% NEQ 0 GOTO ERROR xcopy /i /d /s /q .\build\Release\mapnik.dll ..\mapnik-sdk\libs\ /Y IF %ERRORLEVEL% NEQ 0 GOTO ERROR +:: move python binding into local testable location +xcopy /i /d /s /q .\build\Release\_mapnik.so bindings\python\mapnik\ /Y + + :: plugins xcopy /i /d /s /q .\build\Release\*input ..\mapnik-sdk\libs\mapnik\input\ /Y IF %ERRORLEVEL% NEQ 0 GOTO ERROR diff --git a/mapnik.gyp b/mapnik.gyp index 11fd6defe..28dc0af52 100644 --- a/mapnik.gyp +++ b/mapnik.gyp @@ -31,7 +31,12 @@ ], "conditions": [ ["OS=='win'", { - 'common_defines': ['LIBXML_STATIC','BOOST_LIB_TOOLSET="vc140"','BOOST_COMPILER="14.0"'], # static libxml: libxml2_a.lib + 'common_defines': [ + 'LIBXML_STATIC', # static libxml: libxml2_a.lib + 'BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES', + 'BOOST_LIB_TOOLSET="vc140"', + 'BOOST_COMPILER="14.0"' + ], 'common_libraries': [] }, { 'common_defines': ['SHAPE_MEMORY_MAPPED_FILE','U_CHARSET_IS_UTF8=1'], @@ -144,6 +149,39 @@ } } }, + { + "target_name": "_mapnik", + "type": "loadable_module", + "product_extension": "so", + "sources": [ ' #include #include From beaf7a56cc4270f308ff505817ef4201b71c225d Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Sun, 31 Aug 2014 07:44:41 +0000 Subject: [PATCH 37/59] fix linking problems from python --- include/mapnik/layer.hpp | 1 - include/mapnik/rule.hpp | 2 -- src/feature_type_style.cpp | 21 ++++++++------------- src/layer.cpp | 33 ++++++++++++++------------------- src/rule.cpp | 21 ++++++++------------- 5 files changed, 30 insertions(+), 48 deletions(-) diff --git a/include/mapnik/layer.hpp b/include/mapnik/layer.hpp index 0de81ffa1..9ce8ff7f9 100644 --- a/include/mapnik/layer.hpp +++ b/include/mapnik/layer.hpp @@ -205,7 +205,6 @@ public: void reset_buffer_size(); ~layer(); private: - friend void swap(layer & lhs, layer & rhs); std::string name_; std::string srs_; double min_zoom_; diff --git a/include/mapnik/rule.hpp b/include/mapnik/rule.hpp index a6968a8d1..9ae718124 100644 --- a/include/mapnik/rule.hpp +++ b/include/mapnik/rule.hpp @@ -85,8 +85,6 @@ public: syms_.reserve(size); } -private: - friend void swap(rule & lhs, rule & rhs); }; } diff --git a/src/feature_type_style.cpp b/src/feature_type_style.cpp index 4abbba4a8..d98be3ba8 100644 --- a/src/feature_type_style.cpp +++ b/src/feature_type_style.cpp @@ -61,21 +61,16 @@ feature_type_style::feature_type_style(feature_type_style const& rhs) } feature_type_style& feature_type_style::operator=(feature_type_style rhs) -{ - swap(*this, rhs); - return *this; -} - -void swap( feature_type_style & lhs, feature_type_style & rhs) { using std::swap; - std::swap(lhs.rules_, rhs.rules_); - std::swap(lhs.filter_mode_, rhs.filter_mode_); - std::swap(lhs.filters_, rhs.filters_); - std::swap(lhs.direct_filters_, rhs.direct_filters_); - std::swap(lhs.comp_op_, rhs.comp_op_); - std::swap(lhs.opacity_, rhs.opacity_); - std::swap(lhs.image_filters_inflate_, rhs.image_filters_inflate_); + std::swap(this->rules_, rhs.rules_); + std::swap(this->filter_mode_, rhs.filter_mode_); + std::swap(this->filters_, rhs.filters_); + std::swap(this->direct_filters_, rhs.direct_filters_); + std::swap(this->comp_op_, rhs.comp_op_); + std::swap(this->opacity_, rhs.opacity_); + std::swap(this->image_filters_inflate_, rhs.image_filters_inflate_); + return *this; } bool feature_type_style::operator==(feature_type_style const& rhs) const diff --git a/src/layer.cpp b/src/layer.cpp index 8e91f8929..fb32b26a8 100644 --- a/src/layer.cpp +++ b/src/layer.cpp @@ -73,27 +73,22 @@ layer::layer(layer && rhs) maximum_extent_(std::move(rhs.maximum_extent_)) {} layer& layer::operator=(layer rhs) -{ - swap(*this, rhs); - return *this; -} - -void swap(layer & lhs, layer & rhs) { using std::swap; - std::swap(lhs.name_,rhs.name_); - std::swap(lhs.srs_, rhs.srs_); - std::swap(lhs.min_zoom_, rhs.min_zoom_); - std::swap(lhs.max_zoom_,rhs.max_zoom_); - std::swap(lhs.active_, rhs.active_); - std::swap(lhs.queryable_, rhs.queryable_); - std::swap(lhs.clear_label_cache_, rhs.clear_label_cache_); - std::swap(lhs.cache_features_, rhs.cache_features_); - std::swap(lhs.group_by_, rhs.group_by_); - std::swap(lhs.styles_, rhs.styles_); - std::swap(lhs.ds_, rhs.ds_); - std::swap(lhs.buffer_size_, rhs.buffer_size_); - std::swap(lhs.maximum_extent_, rhs.maximum_extent_); + std::swap(this->name_,rhs.name_); + std::swap(this->srs_, rhs.srs_); + std::swap(this->min_zoom_, rhs.min_zoom_); + std::swap(this->max_zoom_,rhs.max_zoom_); + std::swap(this->active_, rhs.active_); + std::swap(this->queryable_, rhs.queryable_); + std::swap(this->clear_label_cache_, rhs.clear_label_cache_); + std::swap(this->cache_features_, rhs.cache_features_); + std::swap(this->group_by_, rhs.group_by_); + std::swap(this->styles_, rhs.styles_); + std::swap(this->ds_, rhs.ds_); + std::swap(this->buffer_size_, rhs.buffer_size_); + std::swap(this->maximum_extent_, rhs.maximum_extent_); + return *this; } bool layer::operator==(layer const& rhs) const diff --git a/src/rule.cpp b/src/rule.cpp index c786223e5..8a3c0b21d 100644 --- a/src/rule.cpp +++ b/src/rule.cpp @@ -61,7 +61,14 @@ rule::rule(rule const& rhs) rule& rule::operator=(rule rhs) { - swap(*this, rhs); + using std::swap; + swap(this->name_, rhs.name_); + swap(this->min_scale_, rhs.min_scale_); + swap(this->max_scale_, rhs.max_scale_); + swap(this->syms_, rhs.syms_); + swap(this->filter_, rhs.filter_); + swap(this->else_filter_, rhs.else_filter_); + swap(this->also_filter_, rhs.also_filter_); return *this; } @@ -76,18 +83,6 @@ bool rule::operator==(rule const& rhs) const (also_filter_ == rhs.also_filter_); } -void swap(rule & lhs, rule & rhs) -{ - using std::swap; - swap(lhs.name_, rhs.name_); - swap(lhs.min_scale_, rhs.min_scale_); - swap(lhs.max_scale_, rhs.max_scale_); - swap(lhs.syms_, rhs.syms_); - swap(lhs.filter_, rhs.filter_); - swap(lhs.else_filter_, rhs.else_filter_); - swap(lhs.also_filter_, rhs.also_filter_); -} - void rule::set_max_scale(double scale) { max_scale_=scale; From 6828dd5b1eb9a7e5de5a61cdab11acdf88e22ee4 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Sun, 31 Aug 2014 07:45:26 +0000 Subject: [PATCH 38/59] get python bindings working --- build.bat | 8 +++++++- mapnik.gyp | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/build.bat b/build.bat index ddf012910..d42e45d13 100644 --- a/build.bat +++ b/build.bat @@ -282,7 +282,13 @@ xcopy /i /d /s /q .\build\Release\mapnik.dll ..\mapnik-sdk\libs\ /Y IF %ERRORLEVEL% NEQ 0 GOTO ERROR :: move python binding into local testable location -xcopy /i /d /s /q .\build\Release\_mapnik.so bindings\python\mapnik\ /Y +xcopy /i /d /s /q .\build\Release\_mapnik.pyd bindings\python\mapnik\ /Y +echo from os.path import normpath,join,dirname > bindings\python\mapnik\paths.py +echo mapniklibpath = '%CD%/../mapnik-sdk/libs/mapnik' >> bindings\python\mapnik\paths.py +echo mapniklibpath = normpath(join(dirname(__file__),mapniklibpath)) >> bindings\python\mapnik\paths.py +echo inputpluginspath = join(mapniklibpath,'input') >> bindings\python\mapnik\paths.py +echo fontscollectionpath = join(mapniklibpath,'fonts') >> bindings\python\mapnik\paths.py +echo __all__ = [mapniklibpath,inputpluginspath,fontscollectionpath] >> bindings\python\mapnik\paths.py :: plugins diff --git a/mapnik.gyp b/mapnik.gyp index 28dc0af52..95d7e4e27 100644 --- a/mapnik.gyp +++ b/mapnik.gyp @@ -152,7 +152,7 @@ { "target_name": "_mapnik", "type": "loadable_module", - "product_extension": "so", + "product_extension": "pyd", "sources": [ ' Date: Sun, 31 Aug 2014 08:08:14 +0000 Subject: [PATCH 39/59] reference fonts locally for now --- build.bat | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.bat b/build.bat index d42e45d13..65e6eab56 100644 --- a/build.bat +++ b/build.bat @@ -281,6 +281,9 @@ IF %ERRORLEVEL% NEQ 0 GOTO ERROR xcopy /i /d /s /q .\build\Release\mapnik.dll ..\mapnik-sdk\libs\ /Y IF %ERRORLEVEL% NEQ 0 GOTO ERROR +xcopy /i /d /s /q .\fonts\dejavu-fonts-ttf-2.33\ttf\*ttf ..\mapnik-sdk\libs\mapnik\fonts\ /Y +IF %ERRORLEVEL% NEQ 0 GOTO ERROR + :: move python binding into local testable location xcopy /i /d /s /q .\build\Release\_mapnik.pyd bindings\python\mapnik\ /Y echo from os.path import normpath,join,dirname > bindings\python\mapnik\paths.py From 79c6ab46a5d1d627dae495be8fd86df2f0ddbbf7 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Sun, 31 Aug 2014 08:08:52 +0000 Subject: [PATCH 40/59] start fixing visual tests to run on windows --- tests/visual_tests/compare.py | 3 ++- tests/visual_tests/test.py | 20 +++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/tests/visual_tests/compare.py b/tests/visual_tests/compare.py index c999f54aa..134254cd7 100644 --- a/tests/visual_tests/compare.py +++ b/tests/visual_tests/compare.py @@ -3,6 +3,7 @@ import os import sys import mapnik +import platform try: import json @@ -13,7 +14,7 @@ COMPUTE_THRESHOLD = 16 # testcase images are generated on OS X # so they should exactly match -if os.uname()[0] == 'Darwin': +if platform.uname()[0] == 'Darwin': COMPUTE_THRESHOLD = 2 # returns true if pixels are not identical diff --git a/tests/visual_tests/test.py b/tests/visual_tests/test.py index 7b33588bd..2a942d68b 100755 --- a/tests/visual_tests/test.py +++ b/tests/visual_tests/test.py @@ -7,6 +7,7 @@ import mapnik #mapnik.logger.set_severity(mapnik.severity_type.Debug) import shutil import os.path +import platform from compare import compare, compare_grids try: @@ -26,7 +27,8 @@ defaults = { cairo_threshold = 10 agg_threshold = 0 -if 'Linux' == os.uname()[0]: +UNAME = platform.uname()[0] +if 'Linux' == UNAME or 'Windows' == UNAME: # we assume if linux then you are running packaged cairo # which is older than the 1.12.14 version we used on OS X # to generate the expected images, so we'll rachet back the threshold @@ -292,9 +294,9 @@ class Reporting: def result_fail(self, actual, expected, diff): self.failed += 1 if self.quiet: - sys.stderr.write('\x1b[31m.\x1b[0m') + sys.stderr.write('x') else: - print '\x1b[31m✘\x1b[0m (\x1b[34m%u different pixels\x1b[0m)' % diff + print 'x[34m%u different pixels\x1b[0m)' % diff if self.overwrite_failures: self.errors.append((self.REPLACE, actual, expected, diff, None)) @@ -306,17 +308,17 @@ class Reporting: def result_pass(self, actual, expected, diff): self.passed += 1 if self.quiet: - sys.stderr.write('\x1b[32m.\x1b[0m') + sys.stderr.write('.') else: - print '\x1b[32m✓\x1b[0m' + print '.' def not_found(self, actual, expected): self.failed += 1 self.errors.append((self.NOT_FOUND, actual, expected, 0, None)) if self.quiet: - sys.stderr.write('\x1b[33m.\x1b[0m') + sys.stderr.write('x') else: - print '\x1b[33m?\x1b[0m (\x1b[34mReference file not found, creating\x1b[0m)' + print 'x (\x1b[34mReference file not found, creating\x1b[0m)' contents = open(actual, 'r').read() open(expected, 'wb').write(contents) @@ -324,9 +326,9 @@ class Reporting: self.failed += 1 self.errors.append((self.OTHER, None, expected, 0, message)) if self.quiet: - sys.stderr.write('\x1b[31m.\x1b[0m') + sys.stderr.write('x') else: - print '\x1b[31m✘\x1b[0m (\x1b[34m%s\x1b[0m)' % message + print 'x([%s)' % message def make_html_item(self,actual,expected,diff): item = ''' From be44b647faf8aa8cd4e6933495fbd7f40442bca3 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Sun, 31 Aug 2014 12:44:12 -0700 Subject: [PATCH 41/59] workaround msvs variant init bug --- include/mapnik/value.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/mapnik/value.hpp b/include/mapnik/value.hpp index 3df89f45c..84ccad828 100644 --- a/include/mapnik/value.hpp +++ b/include/mapnik/value.hpp @@ -814,7 +814,9 @@ public: template value ( T const& val) - : base_(typename detail::mapnik_value_type::type(val)) {} + : base_() { + base_ = static_cast::type>(val); + } value (value const& other) : base_(other.base_) {} From 351c0894fa606f4a782f57a2ddd6398b5fedbd24 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Sun, 31 Aug 2014 13:58:25 -0700 Subject: [PATCH 42/59] avoid inconsistent dll linkage warnings with python + switch back to python.org install --- mapnik.gyp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mapnik.gyp b/mapnik.gyp index 95d7e4e27..72146c5cc 100644 --- a/mapnik.gyp +++ b/mapnik.gyp @@ -156,12 +156,12 @@ "sources": [ ' Date: Sun, 31 Aug 2014 13:58:38 -0700 Subject: [PATCH 43/59] stash notes on getting python tests running --- build.bat | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/build.bat b/build.bat index 65e6eab56..807cfbe09 100644 --- a/build.bat +++ b/build.bat @@ -314,6 +314,19 @@ IF %ERRORLEVEL% NEQ 0 GOTO ERROR for %%t in (build\Release\*test.exe) do ( call %%t -d %CD% ) IF %ERRORLEVEL% NEQ 0 GOTO ERROR +:: wget https://bootstrap.pypa.io/get-pip.py --no-check-certificate +:: python get-pip.py +:: C:\Python27\Scripts\pip.exe install nose +::xcopy /i /d /s /q .\build\Release\_mapnik.pyd bindings\python\mapnik\ +::SET PYTHONPATH=%CD%\bindings\python +::SET GDAL_DATA=%CD%\..\mapnik-sdk\share\gdal +::SET PROJ_LIB=%CD%\..\mapnik-sdk\share\proj +::SET ICU_DATA=%CD%\..\mapnik-sdk\share\icu +:: https://github.com/mapnik/mapnik-packaging/raw/master/osx/icudt53l_only_collator_and_breakiterator.dat +::python tests\run_tests.py -q +::python tests\visual_tests\test.py -q + + GOTO DONE :ERROR From 7dc1aed9eee9632391bd02cfe328ee44f3fc25ec Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Sun, 31 Aug 2014 17:18:15 -0700 Subject: [PATCH 44/59] attempt to workaround other mapnik_value_type->variant bugs --- include/mapnik/params.hpp | 6 ++++-- include/mapnik/symbolizer.hpp | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/mapnik/params.hpp b/include/mapnik/params.hpp index 6699e631e..e1274c062 100644 --- a/include/mapnik/params.hpp +++ b/include/mapnik/params.hpp @@ -54,8 +54,10 @@ struct value_holder : value_holder_base template value_holder(T const& obj) - : value_holder_base(typename detail::mapnik_value_type::type(obj)) - {} + : value_holder_base() + { + *this = static_cast::type>(obj); + } // move template diff --git a/include/mapnik/symbolizer.hpp b/include/mapnik/symbolizer.hpp index 181881281..bb41ec38e 100644 --- a/include/mapnik/symbolizer.hpp +++ b/include/mapnik/symbolizer.hpp @@ -117,8 +117,10 @@ struct strict_value : value_base_type template strict_value(T const& obj) - : value_base_type(typename detail::mapnik_value_type::type(obj)) - {} + : value_base_type() + { + *this = static_cast::type>(obj); + } // move ctor template strict_value(T && obj) noexcept From 1ba744162b42904305171607c730726d2b235634 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Sun, 31 Aug 2014 17:51:02 -0700 Subject: [PATCH 45/59] Add nik2img.cpp --- mapnik.gyp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/mapnik.gyp b/mapnik.gyp index 72146c5cc..0b6e110ce 100644 --- a/mapnik.gyp +++ b/mapnik.gyp @@ -183,6 +183,28 @@ ] ] }, + { + "target_name": "nik2img", + "type": "executable", + "sources": [ ' Date: Sun, 31 Aug 2014 19:16:39 -0700 Subject: [PATCH 46/59] fixup python bootstrapping --- build.bat | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/build.bat b/build.bat index 807cfbe09..adb1673a4 100644 --- a/build.bat +++ b/build.bat @@ -314,19 +314,25 @@ IF %ERRORLEVEL% NEQ 0 GOTO ERROR for %%t in (build\Release\*test.exe) do ( call %%t -d %CD% ) IF %ERRORLEVEL% NEQ 0 GOTO ERROR -:: wget https://bootstrap.pypa.io/get-pip.py --no-check-certificate -:: python get-pip.py -:: C:\Python27\Scripts\pip.exe install nose -::xcopy /i /d /s /q .\build\Release\_mapnik.pyd bindings\python\mapnik\ -::SET PYTHONPATH=%CD%\bindings\python -::SET GDAL_DATA=%CD%\..\mapnik-sdk\share\gdal -::SET PROJ_LIB=%CD%\..\mapnik-sdk\share\proj -::SET ICU_DATA=%CD%\..\mapnik-sdk\share\icu -:: https://github.com/mapnik/mapnik-packaging/raw/master/osx/icudt53l_only_collator_and_breakiterator.dat +if NOT EXIST get-pip.py ( + wget https://bootstrap.pypa.io/get-pip.py --no-check-certificate + python get-pip.py + C:\Python27\Scripts\pip.exe install nose +) +xcopy /i /d /s /q .\build\Release\_mapnik.pyd bindings\python\mapnik\_mapnik.pyd +SET PYTHONPATH=%CD%\bindings\python +SET GDAL_DATA=%CD%\..\mapnik-sdk\share\gdal +SET PROJ_LIB=%CD%\..\mapnik-sdk\share\proj +SET ICU_DATA=%CD%\..\mapnik-sdk\share\icu + +if NOT EXIST ..\mapnik-sdk\share\icu\icudt53l.dat ( + wget --no-check-certificate https://github.com/mapnik/mapnik-packaging/raw/master/osx/icudt53l_only_collator_and_breakiterator.dat + rename icudt53l_only_collator_and_breakiterator.dat ..\mapnik-sdk\share\icu\icudt53l.dat +) + ::python tests\run_tests.py -q ::python tests\visual_tests\test.py -q - GOTO DONE :ERROR From cfe79a6fe3b7275f6ebdbdb708ebb43402375104 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Sun, 31 Aug 2014 20:09:16 -0700 Subject: [PATCH 47/59] make sure postgis test does not run on windows if no server is availabl --- tests/python_tests/pgraster_test.py | 5 ++++- tests/python_tests/postgis_test.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/python_tests/pgraster_test.py b/tests/python_tests/pgraster_test.py index b000a2d4d..915c4064b 100644 --- a/tests/python_tests/pgraster_test.py +++ b/tests/python_tests/pgraster_test.py @@ -31,7 +31,10 @@ def call(cmd,silent=False): stdin, stderr = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate() if not stderr: return stdin.strip() - elif not silent and 'error' in stderr.lower() or 'could not connect' in stderr.lower(): + elif not silent and 'error' in stderr.lower() \ + or 'could not connect' in stderr.lower() \ + or 'bad connection' in stderr.lower() \ + or 'not recognized as an internal' in stderr.lower(): raise RuntimeError(stderr.strip()) def psql_can_connect(): diff --git a/tests/python_tests/postgis_test.py b/tests/python_tests/postgis_test.py index 77f8d7b24..bc155c401 100644 --- a/tests/python_tests/postgis_test.py +++ b/tests/python_tests/postgis_test.py @@ -23,7 +23,10 @@ def call(cmd,silent=False): stdin, stderr = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate() if not stderr: return stdin.strip() - elif not silent and 'error' in stderr.lower() or 'could not connect' in stderr.lower(): + elif not silent and 'error' in stderr.lower() \ + or 'could not connect' in stderr.lower() \ + or 'bad connection' in stderr.lower() \ + or 'not recognized as an internal' in stderr.lower(): raise RuntimeError(stderr.strip()) def psql_can_connect(): From 72ca8d6faa224fb408b34a395764fd4187a986e6 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Sun, 31 Aug 2014 20:09:39 -0700 Subject: [PATCH 48/59] spruce up mapnik-config.bat --- mapnik-config.bat | 273 ++++++++++++++++++++++++---------------------- 1 file changed, 142 insertions(+), 131 deletions(-) diff --git a/mapnik-config.bat b/mapnik-config.bat index d43c7297f..9e71f8af9 100644 --- a/mapnik-config.bat +++ b/mapnik-config.bat @@ -19,169 +19,166 @@ set MAPNIK_INPUT_PLUGINS_DIRECTORY=%MAPNIK_PREFIX%\\libs\\mapnik\\input set MAPNIK_FONTS_DIRECTORY=%MAPNIK_PREFIX%\\libs\\mapnik\\fonts if /i "%1"=="" ( - goto help - goto exit_error + goto help_msg_err ) -if /i "%1"=="-v" ( - echo %MAPNIK_VERSION% - goto exit_ok -) +:Loop +IF "%1"=="" GOTO Continue -if /i "%1"=="--version" ( - echo %MAPNIK_VERSION% - goto exit_ok -) + if /i "%1"=="-v" ( + echo %MAPNIK_VERSION% + goto exit_ok + ) -if /i "%1"=="--version-number" ( - echo %MAPNIK_VERSION_NUMBER% - goto exit_ok -) + if /i "%1"=="--version" ( + echo %MAPNIK_VERSION% + goto exit_ok + ) -if /i "%1"=="--git-revision" ( - echo TODO - goto exit_ok -) + if /i "%1"=="--version-number" ( + echo %MAPNIK_VERSION_NUMBER% + goto exit_ok + ) -if /i "%1"=="--git-describe" ( - echo TODO - goto exit_ok -) + if /i "%1"=="--git-revision" ( + echo TODO + goto exit_ok + ) -if /i "%1"=="help" ( - goto help - goto exit_ok -) + if /i "%1"=="--git-describe" ( + echo TODO + goto exit_ok + ) -if /i "%1"=="--help" ( - goto help - goto exit_ok -) + if /i "%1"=="help" ( + goto help_msg + ) -if /i "%1"=="-help" ( - goto help - goto exit_ok -) + if /i "%1"=="--help" ( + goto help_msg + ) -if /i "%1"=="-h" ( - goto help - goto exit_ok -) + if /i "%1"=="-help" ( + goto help_msg + ) -if /i "%1"=="/help" ( - goto help - goto exit_ok -) + if /i "%1"=="-h" ( + goto help_msg + ) -if /i "%1"=="?" ( - goto help - goto exit_ok -) + if /i "%1"=="/help" ( + goto help_msg + ) -if /i "%1"=="-?" ( - goto help - goto exit_ok -) + if /i "%1"=="?" ( + goto help_msg + ) -if /i "%1"=="--?" ( - goto help - goto exit_ok -) + if /i "%1"=="-?" ( + goto help_msg + ) -if /i "%1"=="/?" ( - goto help - goto exit_ok -) + if /i "%1"=="--?" ( + goto help_msg + ) -set hit="" + if /i "%1"=="/?" ( + goto help_msg + ) -if /i "%1"=="--prefix" ( - echo %MAPNIK_PREFIX% - set hit="yes" -) + set hit="" -if /i "%1"=="--input-plugins" ( - echo %MAPNIK_INPUT_PLUGINS_DIRECTORY% - set hit="yes" -) + if /i "%1"=="--prefix" ( + echo %MAPNIK_PREFIX% + set hit=%1 + ) -if /i "%1"=="--fonts" ( - echo %MAPNIK_FONTS_DIRECTORY% - set hit="yes" -) + if /i "%1"=="--input-plugins" ( + echo %MAPNIK_INPUT_PLUGINS_DIRECTORY% + set hit=%1 + ) -if /i "%1"=="--lib-name" ( - echo mapnik - set hit="yes" -) + if /i "%1"=="--fonts" ( + echo %MAPNIK_FONTS_DIRECTORY% + set hit=%1 + ) -if /i "%1"=="--libs" ( - echo mapnik.lib - set hit="yes" -) + if /i "%1"=="--lib-name" ( + echo mapnik + set hit=%1 + ) -@rem TODO - figure out how to avoid hardcoding these library names -if /i "%1"=="--dep-libs" ( - echo libpng16.lib zlib.lib harfbuzz.lib libwebp_dll.lib libjpeg.lib icuuc.lib icuin.lib cairo.lib libboost_system-vc140-mt-1_56.lib libxml2_a.lib ws2_32.lib - set hit="yes" -) + if /i "%1"=="--libs" ( + echo mapnik.lib + set hit=%1 + ) -if /i "%1"=="--ldflags" ( - echo %MAPNIK_LIBS% - set hit="yes" -) + @rem TODO - figure out how to avoid hardcoding these library names + if /i "%1"=="--dep-libs" ( + echo libpng16.lib zlib.lib harfbuzz.lib libwebp_dll.lib libjpeg.lib icuuc.lib icuin.lib cairo.lib libboost_system-vc140-mt-1_56.lib libxml2_a.lib ws2_32.lib + set hit=%1 + ) -if /i "%1"=="--defines" ( - echo _WINDOWS BOOST_ALL_NO_LIB BOOST_LIB_TOOLSET="vc140" BOOST_COMPILER="14.0" BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES HAVE_JPEG HAVE_PNG HAVE_WEBP HAVE_TIFF MAPNIK_USE_PROJ4 BOOST_REGEX_HAS_ICU GRID_RENDERER SVG_RENDERER MAPNIK_THREADSAFE BIGINT HAVE_LIBXML2 HAVE_CAIRO LIBXML_STATIC - set hit="yes" -) + if /i "%1"=="--ldflags" ( + echo %MAPNIK_LIBS% + set hit=%1 + ) -@rem /MD is multithreaded dynamic linking - http://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx -@rem /EHsc is to support c++ exceptions - http://msdn.microsoft.com/en-us/library/1deeycx5(v=vs.80).aspx -@rem /GR is to support rtti (runtime type detection) - http://msdn.microsoft.com/en-us/library/we6hfdy0.aspx -if /i "%1"=="--cxxflags" ( - echo /MD /EHsc /GR - set hit="yes" -) + if /i "%1"=="--defines" ( + echo _WINDOWS BOOST_ALL_NO_LIB BOOST_LIB_TOOLSET="vc140" BOOST_COMPILER="14.0" BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES HAVE_JPEG HAVE_PNG HAVE_WEBP HAVE_TIFF MAPNIK_USE_PROJ4 BOOST_REGEX_HAS_ICU GRID_RENDERER SVG_RENDERER MAPNIK_THREADSAFE BIGINT HAVE_LIBXML2 HAVE_CAIRO LIBXML_STATIC + set hit=%1 + ) -if /i "%1"=="--includes" ( - echo %MAPNIK_INCLUDES% %MAPNIK_INCLUDES%\\mapnik\\agg - set hit="yes" -) + @rem /MD is multithreaded dynamic linking - http://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx + @rem /EHsc is to support c++ exceptions - http://msdn.microsoft.com/en-us/library/1deeycx5(v=vs.80).aspx + @rem /GR is to support rtti (runtime type detection) - http://msdn.microsoft.com/en-us/library/we6hfdy0.aspx + if /i "%1"=="--cxxflags" ( + echo /MD /EHsc /GR + set hit=%1 + ) -if /i "%1"=="--all-flags" ( - @rem nothing here yet - echo "" - set hit="yes" -) + if /i "%1"=="--includes" ( + echo %MAPNIK_INCLUDES% %MAPNIK_INCLUDES%\\mapnik\\agg + set hit=%1 + ) -if /i "%1"=="--cxx" ( - @rem nothing here yet - echo "" - set hit="yes" -) + if /i "%1"=="--all-flags" ( + @rem nothing here yet + echo "" + set hit=%1 + ) -if /i "%1"=="--cflags" ( - @rem nothing here yet - echo "" - set hit="yes" -) + if /i "%1"=="--cxx" ( + @rem nothing here yet + echo "" + set hit=%1 + ) -if /i "%1"=="--dep-includes" ( - @rem nothing here yet - echo %MAPNIK_INCLUDES%\\cairo %MAPNIK_INCLUDES%\\freetype2 %MAPNIK_INCLUDES%\\google %MAPNIK_INCLUDES%\\libxml2 - set hit="yes" -) + if /i "%1"=="--cflags" ( + @rem nothing here yet + echo "" + set hit=%1 + ) + + if /i "%1"=="--dep-includes" ( + @rem nothing here yet + echo %MAPNIK_INCLUDES%\\cairo %MAPNIK_INCLUDES%\\freetype2 %MAPNIK_INCLUDES%\\google %MAPNIK_INCLUDES%\\libxml2 + set hit=%1 + ) + + @rem if we got here print warning + if /i NOT %1==%hit% ( + echo unknown option %1 1>&2 + ) +SHIFT +GOTO Loop +:Continue -@rem if we got here print warning -if /i %hit%=="" ( - echo unknown option %1 1>&2 -) goto exit_ok -:help -echo Usage: mapnik-config +:help_msg +echo Usage: mapnik-config echo Examples: echo --libs : provide lib name for mapnik.dll echo --defines : provide compiler defines needed for this mapnik build @@ -192,12 +189,26 @@ echo --includes : provide header paths for mapnik echo --dep-includes : provide header paths for dependencies echo --input-plugins : provide path to input plugins directory echo --fonts : provide path to fonts directory +goto exit_ok +:help_msg_err +echo Usage: mapnik-config +echo Examples: +echo --libs : provide lib name for mapnik.dll +echo --defines : provide compiler defines needed for this mapnik build +echo --dep-libs : provide lib names of depedencies +echo --ldflags : provide lib paths to depedencies +echo --cxxflags : provide compiler flags +echo --includes : provide header paths for mapnik +echo --dep-includes : provide header paths for dependencies +echo --input-plugins : provide path to input plugins directory +echo --fonts : provide path to fonts directory +goto exit_error :exit_error -@rem exit /b 1 +exit /b 1 goto :EOF :exit_ok -@rem exit /b 0 +exit /b 0 goto :EOF \ No newline at end of file From dbdf9c8180d93d2507f4244beafb3bc522554a59 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Sun, 31 Aug 2014 20:14:15 -0700 Subject: [PATCH 49/59] don't test whitespace --- tests/python_tests/mapnik_config_test.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/python_tests/mapnik_config_test.py b/tests/python_tests/mapnik_config_test.py index 395cbdb61..d49a8ba45 100644 --- a/tests/python_tests/mapnik_config_test.py +++ b/tests/python_tests/mapnik_config_test.py @@ -10,21 +10,21 @@ import os, sys, glob, mapnik def test_mapnik_config_no_args(): process = Popen('mapnik-config', shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE) result = process.communicate() - eq_('Usage: mapnik-config ' in result[0],True) + eq_('Usage: mapnik-config' in result[0],True) eq_(result[1],'') eq_(process.returncode,1) def test_mapnik_config_help(): process = Popen('mapnik-config --help', shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE) result = process.communicate() - eq_('Usage: mapnik-config ' in result[0],True) + eq_('Usage: mapnik-config' in result[0],True) eq_(result[1],'') eq_(process.returncode,0) def test_mapnik_config_help_short(): process = Popen('mapnik-config -h', shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE) result = process.communicate() - eq_('Usage: mapnik-config ' in result[0],True) + eq_('Usage: mapnik-config' in result[0],True) eq_(result[1],'') eq_(process.returncode,0) From 4227862660c8d20990388e477908dd3ff6fac3e4 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Sun, 31 Aug 2014 20:24:41 -0700 Subject: [PATCH 50/59] fix broken path remove on windows --- tests/python_tests/save_map_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/python_tests/save_map_test.py b/tests/python_tests/save_map_test.py index e55049e2a..48fdf70e3 100644 --- a/tests/python_tests/save_map_test.py +++ b/tests/python_tests/save_map_test.py @@ -54,7 +54,7 @@ def compare_map(xml): def test_compare_map(): good_maps = glob.glob("../data/good_maps/*.xml") # remove one map that round trips CDATA differently, but this is okay - good_maps.remove('../data/good_maps/empty_parameter2.xml') + #good_maps.remove('../data/good_maps/empty_parameter2.xml') for m in good_maps: compare_map(m) From 58a8f19b162f33815667849f6d505c9ef279a551 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Sun, 31 Aug 2014 20:28:40 -0700 Subject: [PATCH 51/59] add csv test with utf8 data inlined --- tests/python_tests/csv_test.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/python_tests/csv_test.py b/tests/python_tests/csv_test.py index 95be27381..d871e7732 100644 --- a/tests/python_tests/csv_test.py +++ b/tests/python_tests/csv_test.py @@ -403,6 +403,17 @@ if 'csv' in mapnik.DatasourceCache.plugin_names(): feat = fs.next() eq_(feat['Name'],u"Winthrop, WA") + def test_creation_of_csv_from_in_memory_string_with_uft8(**kwargs): + csv_string = ''' + wkt,Name + "POINT (120.15 48.47)","Québec" + ''' # csv plugin will test lines <= 10 chars for being fully blank + ds = mapnik.Datasource(**{"type":"csv","inline":csv_string}) + eq_(ds.describe()['geometry_type'],mapnik.DataGeometryType.Point) + fs = ds.featureset() + feat = fs.next() + eq_(feat['Name'],u"Québec") + def validate_geojson_datasource(ds): eq_(len(ds.fields()),1) eq_(ds.fields(),['type']) From 98c881432a8a3c766112c3e39ab2ede3b863aec3 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 4 Sep 2014 09:21:14 -0700 Subject: [PATCH 52/59] Revert "attempt to workaround other mapnik_value_type->variant bugs" This reverts commit 7dc1aed9eee9632391bd02cfe328ee44f3fc25ec. --- include/mapnik/params.hpp | 6 ++---- include/mapnik/symbolizer.hpp | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/include/mapnik/params.hpp b/include/mapnik/params.hpp index e1274c062..6699e631e 100644 --- a/include/mapnik/params.hpp +++ b/include/mapnik/params.hpp @@ -54,10 +54,8 @@ struct value_holder : value_holder_base template value_holder(T const& obj) - : value_holder_base() - { - *this = static_cast::type>(obj); - } + : value_holder_base(typename detail::mapnik_value_type::type(obj)) + {} // move template diff --git a/include/mapnik/symbolizer.hpp b/include/mapnik/symbolizer.hpp index bb41ec38e..181881281 100644 --- a/include/mapnik/symbolizer.hpp +++ b/include/mapnik/symbolizer.hpp @@ -117,10 +117,8 @@ struct strict_value : value_base_type template strict_value(T const& obj) - : value_base_type() - { - *this = static_cast::type>(obj); - } + : value_base_type(typename detail::mapnik_value_type::type(obj)) + {} // move ctor template strict_value(T && obj) noexcept From c30f1715e64fe6613beb2fe83c2c8ce78f5332f7 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 4 Sep 2014 09:22:43 -0700 Subject: [PATCH 53/59] Revert "workaround msvs variant init bug" This reverts commit be44b647faf8aa8cd4e6933495fbd7f40442bca3. --- include/mapnik/value.hpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/mapnik/value.hpp b/include/mapnik/value.hpp index 84ccad828..3df89f45c 100644 --- a/include/mapnik/value.hpp +++ b/include/mapnik/value.hpp @@ -814,9 +814,7 @@ public: template value ( T const& val) - : base_() { - base_ = static_cast::type>(val); - } + : base_(typename detail::mapnik_value_type::type(val)) {} value (value const& other) : base_(other.base_) {} From 2cc7c5a4f72f15513fa4ef067a76e8c706e3a8bd Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 4 Sep 2014 09:48:04 -0700 Subject: [PATCH 54/59] attempt to get all save_map tests working cross platform --- tests/python_tests/save_map_test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/python_tests/save_map_test.py b/tests/python_tests/save_map_test.py index 48fdf70e3..2a711b361 100644 --- a/tests/python_tests/save_map_test.py +++ b/tests/python_tests/save_map_test.py @@ -54,7 +54,8 @@ def compare_map(xml): def test_compare_map(): good_maps = glob.glob("../data/good_maps/*.xml") # remove one map that round trips CDATA differently, but this is okay - #good_maps.remove('../data/good_maps/empty_parameter2.xml') + ignorable = os.path.join('..','data','good_maps','empty_parameter2.xml') + good_maps.remove(ignorable) for m in good_maps: compare_map(m) From eed46b87cf1e8181ba03bed690e94e7f795c77b9 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 4 Sep 2014 17:14:26 +0000 Subject: [PATCH 55/59] fix gdal,proj,icu share creation --- build.bat | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/build.bat b/build.bat index adb1673a4..d9c3294ad 100644 --- a/build.bat +++ b/build.bat @@ -316,18 +316,35 @@ IF %ERRORLEVEL% NEQ 0 GOTO ERROR if NOT EXIST get-pip.py ( wget https://bootstrap.pypa.io/get-pip.py --no-check-certificate + IF %ERRORLEVEL% NEQ 0 GOTO ERROR python get-pip.py + IF %ERRORLEVEL% NEQ 0 GOTO ERROR C:\Python27\Scripts\pip.exe install nose + IF %ERRORLEVEL% NEQ 0 GOTO ERROR ) xcopy /i /d /s /q .\build\Release\_mapnik.pyd bindings\python\mapnik\_mapnik.pyd +IF %ERRORLEVEL% NEQ 0 GOTO ERROR SET PYTHONPATH=%CD%\bindings\python +IF %ERRORLEVEL% NEQ 0 GOTO ERROR SET GDAL_DATA=%CD%\..\mapnik-sdk\share\gdal +if NOT EXIST %GDAL_DATA% ( + mkdir %GDAL_DATA% + IF %ERRORLEVEL% NEQ 0 GOTO ERROR +) SET PROJ_LIB=%CD%\..\mapnik-sdk\share\proj +if NOT EXIST %PROJ_LIB% ( + mkdir %PROJ_LIB% + IF %ERRORLEVEL% NEQ 0 GOTO ERROR +) SET ICU_DATA=%CD%\..\mapnik-sdk\share\icu +if NOT EXIST %ICU_DATA% ( + mkdir %ICU_DATA% + IF %ERRORLEVEL% NEQ 0 GOTO ERROR +) if NOT EXIST ..\mapnik-sdk\share\icu\icudt53l.dat ( wget --no-check-certificate https://github.com/mapnik/mapnik-packaging/raw/master/osx/icudt53l_only_collator_and_breakiterator.dat - rename icudt53l_only_collator_and_breakiterator.dat ..\mapnik-sdk\share\icu\icudt53l.dat + xcopy /i /f /s /q icudt53l_only_collator_and_breakiterator.dat ..\mapnik-sdk\share\icu\icudt53l.dat /Y ) ::python tests\run_tests.py -q From 038cc41cd41fa69ac3aff6f5edf2cc3fba2f23d4 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 4 Sep 2014 18:26:17 +0000 Subject: [PATCH 56/59] we are targeting 2014 so rollback 2013 CTP workarounds --- include/mapnik/group/group_rule.hpp | 2 +- src/load_map.cpp | 41 ----------------------------- 2 files changed, 1 insertion(+), 42 deletions(-) diff --git a/include/mapnik/group/group_rule.hpp b/include/mapnik/group/group_rule.hpp index b971c040c..0de2f2373 100644 --- a/include/mapnik/group/group_rule.hpp +++ b/include/mapnik/group/group_rule.hpp @@ -40,7 +40,7 @@ struct MAPNIK_DECL group_rule { using symbolizers = std::vector; - group_rule(const expression_ptr& filter = expression_ptr(new expr_node), + group_rule(const expression_ptr& filter =std::make_shared(true), const expression_ptr& repeat_key = expression_ptr()); group_rule &operator=(const group_rule &rhs); diff --git a/src/load_map.cpp b/src/load_map.cpp index 2732728dd..f4e6663b7 100644 --- a/src/load_map.cpp +++ b/src/load_map.cpp @@ -777,46 +777,6 @@ void map_parser::parse_symbolizers(rule & rule, xml_node const & node) rule.reserve(node.size()); for (auto const& sym_node : node) { -#if defined(_MSC_VER) && _MSC_VER <= 1800 - std::string const& name = sym_node.name(); - if (name == "PointSymbolizer") { - parse_point_symbolizer(rule, sym_node); - sym_node.set_processed(true); - } else if (name == "LinePatternSymbolizer") { - parse_line_pattern_symbolizer(rule, sym_node); - sym_node.set_processed(true); - } else if (name == "PolygonPatternSymbolizer") { - parse_polygon_pattern_symbolizer(rule, sym_node); - sym_node.set_processed(true); - } else if (name == "TextSymbolizer") { - parse_text_symbolizer(rule, sym_node); - sym_node.set_processed(true); - } else if (name == "ShieldSymbolizer") { - parse_shield_symbolizer(rule, sym_node); - sym_node.set_processed(true); - } else if (name == "LineSymbolizer") { - parse_line_symbolizer(rule, sym_node); - sym_node.set_processed(true); - } else if (name == "PolygonSymbolizer") { - parse_polygon_symbolizer(rule, sym_node); - sym_node.set_processed(true); - } else if (name == "BuildingSymbolizer") { - parse_building_symbolizer(rule, sym_node); - sym_node.set_processed(true); - } else if (name == "RasterSymbolizer") { - parse_raster_symbolizer(rule, sym_node); - sym_node.set_processed(true); - } else if (name == "MarkersSymbolizer") { - parse_markers_symbolizer(rule, sym_node); - sym_node.set_processed(true); - } else if (name == "GroupSymbolizer") { - parse_group_symbolizer(rule, sym_node); - sym_node.set_processed(true); - } else if (name == "DebugSymbolizer") { - parse_debug_symbolizer(rule, sym_node); - sym_node.set_processed(true); - } -#else switch (name2int(sym_node.name().c_str())) { case name2int("PointSymbolizer"): @@ -870,7 +830,6 @@ void map_parser::parse_symbolizers(rule & rule, xml_node const & node) default: break; } -#endif } } From d787e59718a0f77f0e55fcaca715defa03b96803 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 4 Sep 2014 16:37:29 -0700 Subject: [PATCH 57/59] remove gyp specific build files --- build.bat | 362 ----------------------------------- common.gypi | 124 ------------ mapnik.gyp | 531 ---------------------------------------------------- 3 files changed, 1017 deletions(-) delete mode 100644 build.bat delete mode 100644 common.gypi delete mode 100644 mapnik.gyp diff --git a/build.bat b/build.bat deleted file mode 100644 index d9c3294ad..000000000 --- a/build.bat +++ /dev/null @@ -1,362 +0,0 @@ -@echo off - -::git clone https://chromium.googlesource.com/external/gyp.git -::CALL "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86 -::SET PATH=C:\Python27;%PATH% - -::ddt ..\mapnik-sdk -::IF ERRORLEVEL NEQ 0 GOTO ERROR -::ddt build\Release -::IF ERRORLEVEL NEQ 0 GOTO ERROR - -if NOT EXIST gyp ( - CALL git clone https://chromium.googlesource.com/external/gyp.git gyp - IF %ERRORLEVEL% NEQ 0 GOTO ERROR -) - -:: run find command and bail on error -:: this ensures we have the unix find command on path -:: before trying to run gyp -find deps/clipper/src/ -name "*.cpp" -IF %ERRORLEVEL% NEQ 0 GOTO ERROR - -CALL gyp\gyp.bat mapnik.gyp --depth=. ^ - -Dincludes=%CD%/../mapnik-sdk/includes ^ - -Dlibs=%CD%/../mapnik-sdk/libs ^ - -f msvs -G msvs_version=2013 ^ - --generator-output=build ^ - --no-duplicate-basename-check -IF %ERRORLEVEL% NEQ 0 GOTO ERROR - -if NOT EXIST ..\mapnik-sdk ( - mkdir ..\mapnik-sdk - mkdir ..\mapnik-sdk\bin - mkdir ..\mapnik-sdk\includes - mkdir ..\mapnik-sdk\share - mkdir ..\mapnik-sdk\libs - mkdir ..\mapnik-sdk\libs\mapnik\input - mkdir ..\mapnik-sdk\libs\mapnik\fonts -) -IF %ERRORLEVEL% NEQ 0 GOTO ERROR - -SET DEPSDIR=.. - -:: includes -xcopy /i /d /s /q %DEPSDIR%\harfbuzz-build\harfbuzz\hb-version.h ..\mapnik-sdk\includes\harfbuzz\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\harfbuzz\src\hb.h ..\mapnik-sdk\includes\harfbuzz\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -::xcopy /i /d /s /q %DEPSDIR%\harfbuzz\src\hb-icu.h ..\mapnik-sdk\includes\harfbuzz\ /Y -::IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\harfbuzz\src\hb-shape-plan.h ..\mapnik-sdk\includes\harfbuzz\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\harfbuzz\src\hb-shape.h ..\mapnik-sdk\includes\harfbuzz\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\harfbuzz\src\hb-set.h ..\mapnik-sdk\includes\harfbuzz\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\harfbuzz\src\hb-ft.h ..\mapnik-sdk\includes\harfbuzz\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\harfbuzz\src\hb-buffer.h ..\mapnik-sdk\includes\harfbuzz\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\harfbuzz\src\hb-unicode.h ..\mapnik-sdk\includes\harfbuzz\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\harfbuzz\src\hb-common.h ..\mapnik-sdk\includes\harfbuzz\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\harfbuzz\src\hb-blob.h ..\mapnik-sdk\includes\harfbuzz\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\harfbuzz\src\hb-font.h ..\mapnik-sdk\includes\harfbuzz\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\harfbuzz\src\hb-face.h ..\mapnik-sdk\includes\harfbuzz\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\harfbuzz\src\hb-deprecated.h ..\mapnik-sdk\includes\harfbuzz\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\boost_1_56_0\boost ..\mapnik-sdk\includes\boost /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\icu\include\unicode ..\mapnik-sdk\includes\unicode /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\freetype\include ..\mapnik-sdk\includes\freetype2 /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\libxml2\include ..\mapnik-sdk\includes\libxml2 /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\zlib\zlib.h ..\mapnik-sdk\includes\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\zlib\zconf.h ..\mapnik-sdk\includes\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\libpng\png.h ..\mapnik-sdk\includes\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\libpng\pnglibconf.h ..\mapnik-sdk\includes\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\libpng\pngconf.h ..\mapnik-sdk\includes\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\jpeg\jpeglib.h ..\mapnik-sdk\includes\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\jpeg\jconfig.h ..\mapnik-sdk\includes\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\jpeg\jmorecfg.h ..\mapnik-sdk\includes\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\webp\src\webp ..\mapnik-sdk\includes\webp /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\proj\src\proj_api.h ..\mapnik-sdk\includes\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\libtiff\libtiff\tiff.h ..\mapnik-sdk\includes\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\libtiff\libtiff\tiffvers.h ..\mapnik-sdk\includes\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\libtiff\libtiff\tiffconf.h ..\mapnik-sdk\includes\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\libtiff\libtiff\tiffio.h ..\mapnik-sdk\includes\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\cairo\cairo-version.h ..\mapnik-sdk\includes\cairo\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\cairo\src\cairo-features.h ..\mapnik-sdk\includes\cairo\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\cairo\src\cairo.h ..\mapnik-sdk\includes\cairo\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\cairo\src\cairo-deprecated.h ..\mapnik-sdk\includes\cairo\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\cairo\src\cairo-svg.h ..\mapnik-sdk\includes\cairo\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\cairo\src\cairo-svg-surface-private.h ..\mapnik-sdk\includes\cairo\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\cairo\src\cairo-pdf.h ..\mapnik-sdk\includes\cairo\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\cairo\src\cairo-ft.h ..\mapnik-sdk\includes\cairo\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\cairo\src\cairo-ps.h ..\mapnik-sdk\includes\cairo\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\protobuf\vsprojects\include ..\mapnik-sdk\includes\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR - -:: libs -xcopy /i /d /s /q %DEPSDIR%\harfbuzz-build\harfbuzz.lib ..\mapnik-sdk\libs\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\freetype\freetype.lib ..\mapnik-sdk\libs\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\icu\lib\icuuc.lib ..\mapnik-sdk\libs\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\icu\lib\icuin.lib ..\mapnik-sdk\libs\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\icu\bin\icuuc53.dll ..\mapnik-sdk\libs\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\icu\bin\icudt53.dll ..\mapnik-sdk\libs\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\icu\bin\icuin53.dll ..\mapnik-sdk\libs\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\libxml2\win32\bin.msvc\libxml2_a.lib ..\mapnik-sdk\libs\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\libxml2\win32\bin.msvc\libxml2_a_dll.lib ..\mapnik-sdk\libs\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\libxml2\win32\bin.msvc\libxml2.dll ..\mapnik-sdk\libs\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\libxml2\win32\bin.msvc\libxml2.lib ..\mapnik-sdk\libs\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\libtiff\libtiff\libtiff.dll ..\mapnik-sdk\libs\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -::xcopy /i /d /s /q %DEPSDIR%\libtiff\libtiff\libtiff.lib ..\mapnik-sdk\libs\ /Y -::IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\libtiff\libtiff\libtiff_i.lib ..\mapnik-sdk\libs\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\zlib\zlib.lib ..\mapnik-sdk\libs\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\proj\src\proj.lib ..\mapnik-sdk\libs\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\webp\output\release-dynamic\x86\lib\libwebp_dll.lib ..\mapnik-sdk\libs\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\webp\output\release-dynamic\x86\bin\libwebp.dll ..\mapnik-sdk\libs\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\libpng\projects\vstudio\Release\libpng16.lib ..\mapnik-sdk\libs\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\libpng\projects\vstudio\Release\libpng16.dll ..\mapnik-sdk\libs\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\jpeg\libjpeg.lib ..\mapnik-sdk\libs\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\cairo\src\release\cairo-static.lib ..\mapnik-sdk\libs\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\cairo\src\release\cairo.lib ..\mapnik-sdk\libs\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\cairo\src\release\cairo.dll ..\mapnik-sdk\libs\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\boost_1_56_0\stage\lib\* ..\mapnik-sdk\libs\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\protobuf\vsprojects\Release\libprotobuf-lite.lib ..\mapnik-sdk\libs\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR - -:: data -xcopy /i /d /s /q %DEPSDIR%\proj\nad ..\mapnik-sdk\share\proj /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\gdal\data ..\mapnik-sdk\share\gdal -IF %ERRORLEVEL% NEQ 0 GOTO ERROR - -:: bin -xcopy /i /d /s /q %DEPSDIR%\protobuf\vsprojects\Release\protoc.exe ..\mapnik-sdk\bin /Y -xcopy /i /d /s /q mapnik-config.bat ..\mapnik-sdk\bin /Y - -:: headers for plugins -xcopy /i /d /s /q %DEPSDIR%\postgresql\src\interfaces\libpq\libpq-fe.h ..\mapnik-sdk\includes\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\postgresql\src\include\postgres_ext.h ..\mapnik-sdk\includes\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\postgresql\src\include\pg_config_ext.h ..\mapnik-sdk\includes\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\sqlite\sqlite3.h ..\mapnik-sdk\includes\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -::xcopy /i /d /s /q %DEPSDIR%\gdal\gcore\*h ..\mapnik-sdk\includes\gdal\ /Y -::IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\gdal\ogr\ogr_feature.h ..\mapnik-sdk\includes\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\gdal\ogr\ogr_spatialref.h ..\mapnik-sdk\includes\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\gdal\ogr\ogr_geometry.h ..\mapnik-sdk\includes\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\gdal\ogr\ogr_core.h ..\mapnik-sdk\includes\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\gdal\ogr\ogr_featurestyle.h ..\mapnik-sdk\includes\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\gdal\ogr\ogrsf_frmts\ogrsf_frmts.h ..\mapnik-sdk\includes\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\gdal\ogr\ogr_srs_api.h ..\mapnik-sdk\includes\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\gdal\gcore\gdal_priv.h ..\mapnik-sdk\includes\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\gdal\gcore\gdal_frmts.h ..\mapnik-sdk\includes\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\gdal\gcore\gdal.h ..\mapnik-sdk\includes\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\gdal\gcore\gdal_version.h ..\mapnik-sdk\includes\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\gdal\port\cpl_minixml.h ..\mapnik-sdk\includes\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\gdal\port\cpl_atomic_ops.h ..\mapnik-sdk\includes\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\gdal\port\cpl_string.h ..\mapnik-sdk\includes\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\gdal\port\cpl_conv.h ..\mapnik-sdk\includes\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\gdal\port\cpl_vsi.h ..\mapnik-sdk\includes\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\gdal\port\cpl_virtualmem.h ..\mapnik-sdk\includes\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\gdal\port\cpl_error.h ..\mapnik-sdk\includes\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\gdal\port\cpl_progress.h ..\mapnik-sdk\includes\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\gdal\port\cpl_port.h ..\mapnik-sdk\includes\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\gdal\port\cpl_config.h ..\mapnik-sdk\includes\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR - -:: libs for plugins -xcopy /i /d /s /q %DEPSDIR%\postgresql\src\interfaces\libpq\Release\libpq.lib ..\mapnik-sdk\libs\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\postgresql\src\interfaces\libpq\Release\libpq.dll ..\mapnik-sdk\libs\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\sqlite\sqlite3.lib ..\mapnik-sdk\libs\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\gdal\gdal_i.lib ..\mapnik-sdk\libs\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -:: NOTE: impossible to statically link gdal due to: -:: http://stackoverflow.com/questions/4596212/c-odbc-refuses-to-statically-link-to-libcmt-lib-under-vs2010 -::xcopy /i /d /s /q %DEPSDIR%\gdal\gdal.lib ..\mapnik-sdk\libs\ /Y -::IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\gdal\gdal111.dll ..\mapnik-sdk\libs\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\expat\win32\bin\Release\libexpat.lib ..\mapnik-sdk\libs\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q %DEPSDIR%\expat\win32\bin\Release\libexpat.dll ..\mapnik-sdk\libs\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR - -:: detect trouble with mimatched linking -dumpbin /directives ..\mapnik-sdk\libs\*lib | grep LIBCMT - -::msbuild /m:2 /t:mapnik /p:BuildInParellel=true .\build\mapnik.sln /p:Configuration=Release - -msbuild /m:%NUMBER_OF_PROCESSORS% /p:BuildInParellel=true .\build\mapnik.sln /p:Configuration=Release -:: /t:rebuild -:: /v:diag > build.log -IF %ERRORLEVEL% NEQ 0 GOTO ERROR - -:: install mapnik libs -xcopy /i /d /s /q .\build\Release\mapnik.lib ..\mapnik-sdk\libs\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q .\build\Release\mapnik.dll ..\mapnik-sdk\libs\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR - -xcopy /i /d /s /q .\fonts\dejavu-fonts-ttf-2.33\ttf\*ttf ..\mapnik-sdk\libs\mapnik\fonts\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR - -:: move python binding into local testable location -xcopy /i /d /s /q .\build\Release\_mapnik.pyd bindings\python\mapnik\ /Y -echo from os.path import normpath,join,dirname > bindings\python\mapnik\paths.py -echo mapniklibpath = '%CD%/../mapnik-sdk/libs/mapnik' >> bindings\python\mapnik\paths.py -echo mapniklibpath = normpath(join(dirname(__file__),mapniklibpath)) >> bindings\python\mapnik\paths.py -echo inputpluginspath = join(mapniklibpath,'input') >> bindings\python\mapnik\paths.py -echo fontscollectionpath = join(mapniklibpath,'fonts') >> bindings\python\mapnik\paths.py -echo __all__ = [mapniklibpath,inputpluginspath,fontscollectionpath] >> bindings\python\mapnik\paths.py - - -:: plugins -xcopy /i /d /s /q .\build\Release\*input ..\mapnik-sdk\libs\mapnik\input\ /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR - -:: install mapnik headers -xcopy /i /d /s /q .\deps\mapnik\sparsehash ..\mapnik-sdk\includes\mapnik\sparsehash /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q .\deps\agg\include ..\mapnik-sdk\includes\mapnik\agg /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q .\deps\clipper\include ..\mapnik-sdk\includes\mapnik\agg /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -xcopy /i /d /s /q .\include\mapnik ..\mapnik-sdk\includes\mapnik /Y -IF %ERRORLEVEL% NEQ 0 GOTO ERROR - -:: run tests -SET PATH=%CD%\..\mapnik-sdk\libs;%PATH% -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -for %%t in (build\Release\*test.exe) do ( call %%t -d %CD% ) -IF %ERRORLEVEL% NEQ 0 GOTO ERROR - -if NOT EXIST get-pip.py ( - wget https://bootstrap.pypa.io/get-pip.py --no-check-certificate - IF %ERRORLEVEL% NEQ 0 GOTO ERROR - python get-pip.py - IF %ERRORLEVEL% NEQ 0 GOTO ERROR - C:\Python27\Scripts\pip.exe install nose - IF %ERRORLEVEL% NEQ 0 GOTO ERROR -) -xcopy /i /d /s /q .\build\Release\_mapnik.pyd bindings\python\mapnik\_mapnik.pyd -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -SET PYTHONPATH=%CD%\bindings\python -IF %ERRORLEVEL% NEQ 0 GOTO ERROR -SET GDAL_DATA=%CD%\..\mapnik-sdk\share\gdal -if NOT EXIST %GDAL_DATA% ( - mkdir %GDAL_DATA% - IF %ERRORLEVEL% NEQ 0 GOTO ERROR -) -SET PROJ_LIB=%CD%\..\mapnik-sdk\share\proj -if NOT EXIST %PROJ_LIB% ( - mkdir %PROJ_LIB% - IF %ERRORLEVEL% NEQ 0 GOTO ERROR -) -SET ICU_DATA=%CD%\..\mapnik-sdk\share\icu -if NOT EXIST %ICU_DATA% ( - mkdir %ICU_DATA% - IF %ERRORLEVEL% NEQ 0 GOTO ERROR -) - -if NOT EXIST ..\mapnik-sdk\share\icu\icudt53l.dat ( - wget --no-check-certificate https://github.com/mapnik/mapnik-packaging/raw/master/osx/icudt53l_only_collator_and_breakiterator.dat - xcopy /i /f /s /q icudt53l_only_collator_and_breakiterator.dat ..\mapnik-sdk\share\icu\icudt53l.dat /Y -) - -::python tests\run_tests.py -q -::python tests\visual_tests\test.py -q - -GOTO DONE - -:ERROR -echo ----------ERROR MAPNIK -------------- -echo ERRORLEVEL %ERRORLEVEL% - -:DONE -echo DONE building Mapnik - -EXIT /b %ERRORLEVEL% diff --git a/common.gypi b/common.gypi deleted file mode 100644 index 2d9f9fe3e..000000000 --- a/common.gypi +++ /dev/null @@ -1,124 +0,0 @@ -{ - 'target_defaults': { - 'default_configuration': 'Release', - 'msbuild_toolset':'v140', - 'msvs_configuration_platform': 'Win32', - 'msvs_disabled_warnings': [ 4068,4244,4005,4506,4345,4804,4805,4661 ], - 'xcode_settings': { - 'CLANG_CXX_LIBRARY': 'libc++', - 'CLANG_CXX_LANGUAGE_STANDARD':'c++11', - 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0', - 'MACOSX_DEPLOYMENT_TARGET':'10.9', - 'WARNING_CFLAGS': [ - '-Wall', - '-Wextra', - '-pedantic', - '-Wno-parentheses', - '-Wno-char-subscripts', - '-Wno-unused-parameter', - '-Wno-c++11-narrowing', - '-Wno-c++11-long-long', - '-Wno-unsequenced', - '-Wno-sign-compare', - '-Wno-unused-function', - '-Wno-redeclared-class-member', - '-Wno-c99-extensions', - '-Wno-c++11-extra-semi', - '-Wno-variadic-macros', - '-Wno-c++11-extensions', - '-Wno-unused-const-variable' - ] - }, - 'msvs_settings': { - 'VCCLCompilerTool': { - 'ObjectFile': '$(IntDir)/%(RelativeDir)/', # support similiarly named files in different directories - 'ExceptionHandling': 1, # /EHsc - 'RuntimeTypeInfo': 'true', # /GR - 'RuntimeLibrary': '2' # 2:/MD - } - }, - 'defines': [ 'BOOST_SPIRIT_USE_PHOENIX_V3=1' ], - 'cflags_cc': ['-std=c++03'], - 'conditions': [ - ['OS=="win"', { - 'defines': ['_WINDOWS'] - }] - ], - 'configurations': { - 'Debug': { - 'defines!': [ - 'NDEBUG' - ], - 'cflags_cc!': [ - '-O3', - '-O2', - '-Os', - '-DNDEBUG' - ], - 'cflags': [ '-g', '-O0' ], - 'defines': [ 'DEBUG' ], - 'xcode_settings': { - 'GCC_OPTIMIZATION_LEVEL': '0', - 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'YES', - 'DEAD_CODE_STRIPPING': 'NO', - 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'NO' - }, - 'msvs_settings': { - 'VCCLCompilerTool': { - 'RuntimeLibrary': '3', # /MDd - 'Optimization': 0, # /Od, no optimization - 'MinimalRebuild': 'false', - 'OmitFramePointers': 'false', - 'BasicRuntimeChecks': 3 # /RTC1 - }, - 'VCLinkerTool': { - 'AdditionalOptions': [ - #'/NODEFAULTLIB:msvcrt.lib' - ] - } - } - }, - 'Release': { - 'cflags': [ '-O3' ], - 'defines': [ 'NDEBUG' ], - 'xcode_settings': { - 'GCC_OPTIMIZATION_LEVEL': '3', - 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO', - 'DEAD_CODE_STRIPPING': 'YES', - 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES' - }, - 'msvs_settings': { - 'VCCLCompilerTool': { - 'RuntimeLibrary': '2', #0:/MT, 2:/MD, - 'Optimization': 3, # /Ox, full optimization - 'FavorSizeOrSpeed': 1, # /Ot, favour speed over size - 'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible - #'WholeProgramOptimization': 'true', # /GL, whole program optimization, needed for LTCG - 'OmitFramePointers': 'true', - #'EnableFunctionLevelLinking': 'true', - 'EnableIntrinsicFunctions': 'true', - 'AdditionalOptions': [ - '/MP', # compile across multiple CPUs - ], - 'DebugInformationFormat': '0' - }, - 'VCLibrarianTool': { - 'AdditionalOptions': [ - '/LTCG' # link time code generation - ], - }, - 'VCLinkerTool': { - #'LinkTimeCodeGeneration': 1, # link-time code generation - #'OptimizeReferences': 2, # /OPT:REF - #'EnableCOMDATFolding': 2, # /OPT:ICF - 'LinkIncremental': 2, # force incremental linking - 'GenerateDebugInformation': 'false', - 'AdditionalOptions': [ - #'/NODEFAULTLIB:libcmt.lib' - ], - } - } - } - } - } -} diff --git a/mapnik.gyp b/mapnik.gyp deleted file mode 100644 index 0b6e110ce..000000000 --- a/mapnik.gyp +++ /dev/null @@ -1,531 +0,0 @@ -{ - 'includes': [ - './common.gypi' - ], - 'variables': { - 'includes%':'', - 'libs%':'', - 'common_defines': [ - 'BIGINT', - 'BOOST_REGEX_HAS_ICU', - 'HAVE_JPEG', - 'MAPNIK_USE_PROJ4', - 'HAVE_PNG', - 'HAVE_TIFF', - 'HAVE_WEBP', - 'MAPNIK_THREADSAFE', - 'HAVE_CAIRO', - 'GRID_RENDERER', - 'SVG_RENDERER' - ], - 'common_includes': [ - './include', # mapnik - './deps/', # mapnik/sparsehash - './deps/agg/include/', # agg - './deps/clipper/include/', # clipper - './', # boost shim - '<@(includes)/', - '<@(includes)/freetype2', - '<@(includes)/libxml2', - '<@(includes)/cairo' - ], - "conditions": [ - ["OS=='win'", { - 'common_defines': [ - 'LIBXML_STATIC', # static libxml: libxml2_a.lib - 'BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES', - 'BOOST_LIB_TOOLSET="vc140"', - 'BOOST_COMPILER="14.0"' - ], - 'common_libraries': [] - }, { - 'common_defines': ['SHAPE_MEMORY_MAPPED_FILE','U_CHARSET_IS_UTF8=1'], - 'common_libraries': [ - '-Wl,-search_paths_first', - '-stdlib=libstdc++', - '-L<@(libs)' - ] - }] - ] - }, - 'targets': [ - { - 'target_name': 'mapnik', - 'product_name': 'mapnik', - 'type': 'shared_library', - 'sources': [ - ' Date: Thu, 4 Sep 2014 16:40:28 -0700 Subject: [PATCH 58/59] Revert "start fixing visual tests to run on windows" This reverts commit 79c6ab46a5d1d627dae495be8fd86df2f0ddbbf7. --- tests/visual_tests/compare.py | 3 +-- tests/visual_tests/test.py | 20 +++++++++----------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/tests/visual_tests/compare.py b/tests/visual_tests/compare.py index 134254cd7..c999f54aa 100644 --- a/tests/visual_tests/compare.py +++ b/tests/visual_tests/compare.py @@ -3,7 +3,6 @@ import os import sys import mapnik -import platform try: import json @@ -14,7 +13,7 @@ COMPUTE_THRESHOLD = 16 # testcase images are generated on OS X # so they should exactly match -if platform.uname()[0] == 'Darwin': +if os.uname()[0] == 'Darwin': COMPUTE_THRESHOLD = 2 # returns true if pixels are not identical diff --git a/tests/visual_tests/test.py b/tests/visual_tests/test.py index 2a942d68b..7b33588bd 100755 --- a/tests/visual_tests/test.py +++ b/tests/visual_tests/test.py @@ -7,7 +7,6 @@ import mapnik #mapnik.logger.set_severity(mapnik.severity_type.Debug) import shutil import os.path -import platform from compare import compare, compare_grids try: @@ -27,8 +26,7 @@ defaults = { cairo_threshold = 10 agg_threshold = 0 -UNAME = platform.uname()[0] -if 'Linux' == UNAME or 'Windows' == UNAME: +if 'Linux' == os.uname()[0]: # we assume if linux then you are running packaged cairo # which is older than the 1.12.14 version we used on OS X # to generate the expected images, so we'll rachet back the threshold @@ -294,9 +292,9 @@ class Reporting: def result_fail(self, actual, expected, diff): self.failed += 1 if self.quiet: - sys.stderr.write('x') + sys.stderr.write('\x1b[31m.\x1b[0m') else: - print 'x[34m%u different pixels\x1b[0m)' % diff + print '\x1b[31m✘\x1b[0m (\x1b[34m%u different pixels\x1b[0m)' % diff if self.overwrite_failures: self.errors.append((self.REPLACE, actual, expected, diff, None)) @@ -308,17 +306,17 @@ class Reporting: def result_pass(self, actual, expected, diff): self.passed += 1 if self.quiet: - sys.stderr.write('.') + sys.stderr.write('\x1b[32m.\x1b[0m') else: - print '.' + print '\x1b[32m✓\x1b[0m' def not_found(self, actual, expected): self.failed += 1 self.errors.append((self.NOT_FOUND, actual, expected, 0, None)) if self.quiet: - sys.stderr.write('x') + sys.stderr.write('\x1b[33m.\x1b[0m') else: - print 'x (\x1b[34mReference file not found, creating\x1b[0m)' + print '\x1b[33m?\x1b[0m (\x1b[34mReference file not found, creating\x1b[0m)' contents = open(actual, 'r').read() open(expected, 'wb').write(contents) @@ -326,9 +324,9 @@ class Reporting: self.failed += 1 self.errors.append((self.OTHER, None, expected, 0, message)) if self.quiet: - sys.stderr.write('x') + sys.stderr.write('\x1b[31m.\x1b[0m') else: - print 'x([%s)' % message + print '\x1b[31m✘\x1b[0m (\x1b[34m%s\x1b[0m)' % message def make_html_item(self,actual,expected,diff): item = ''' From 3c1ad84f958abfc77d3c4d6007c51ee2ca3c7dc9 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 4 Sep 2014 16:40:37 -0700 Subject: [PATCH 59/59] remove mapnik-config.bat --- include/mapnik/group/group_rule.hpp | 2 +- mapnik-config.bat | 214 ---------------------------- 2 files changed, 1 insertion(+), 215 deletions(-) delete mode 100644 mapnik-config.bat diff --git a/include/mapnik/group/group_rule.hpp b/include/mapnik/group/group_rule.hpp index 0de2f2373..267093b78 100644 --- a/include/mapnik/group/group_rule.hpp +++ b/include/mapnik/group/group_rule.hpp @@ -40,7 +40,7 @@ struct MAPNIK_DECL group_rule { using symbolizers = std::vector; - group_rule(const expression_ptr& filter =std::make_shared(true), + group_rule(const expression_ptr& filter = std::make_shared(true), const expression_ptr& repeat_key = expression_ptr()); group_rule &operator=(const group_rule &rhs); diff --git a/mapnik-config.bat b/mapnik-config.bat deleted file mode 100644 index 9e71f8af9..000000000 --- a/mapnik-config.bat +++ /dev/null @@ -1,214 +0,0 @@ -@echo off - -set MAPNIK_VERSION=2.3.0 -set MAPNIK_VERSION_NUMBER=200300 -::SET CUR_PATH=%CD% -::cd %CD%/../ -set MAPNIK_PREFIX=%~dp0 -:: strip trailing \ -set MAPNIK_PREFIX=%MAPNIK_PREFIX:~0,-1% -:: get dirname -for %%F in (%MAPNIK_PREFIX%) do set MAPNIK_PREFIX=%%~dpF -:: strip trailing \ -set MAPNIK_PREFIX=%MAPNIK_PREFIX:~0,-1% -:: now make double \\ for gyp -set MAPNIK_PREFIX=%MAPNIK_PREFIX:\=\\% -set MAPNIK_LIBS=%MAPNIK_PREFIX%\\libs -set MAPNIK_INCLUDES=%MAPNIK_PREFIX%\\includes -set MAPNIK_INPUT_PLUGINS_DIRECTORY=%MAPNIK_PREFIX%\\libs\\mapnik\\input -set MAPNIK_FONTS_DIRECTORY=%MAPNIK_PREFIX%\\libs\\mapnik\\fonts - -if /i "%1"=="" ( - goto help_msg_err -) - -:Loop -IF "%1"=="" GOTO Continue - - if /i "%1"=="-v" ( - echo %MAPNIK_VERSION% - goto exit_ok - ) - - if /i "%1"=="--version" ( - echo %MAPNIK_VERSION% - goto exit_ok - ) - - if /i "%1"=="--version-number" ( - echo %MAPNIK_VERSION_NUMBER% - goto exit_ok - ) - - if /i "%1"=="--git-revision" ( - echo TODO - goto exit_ok - ) - - if /i "%1"=="--git-describe" ( - echo TODO - goto exit_ok - ) - - if /i "%1"=="help" ( - goto help_msg - ) - - if /i "%1"=="--help" ( - goto help_msg - ) - - if /i "%1"=="-help" ( - goto help_msg - ) - - if /i "%1"=="-h" ( - goto help_msg - ) - - if /i "%1"=="/help" ( - goto help_msg - ) - - if /i "%1"=="?" ( - goto help_msg - ) - - if /i "%1"=="-?" ( - goto help_msg - ) - - if /i "%1"=="--?" ( - goto help_msg - ) - - if /i "%1"=="/?" ( - goto help_msg - ) - - set hit="" - - if /i "%1"=="--prefix" ( - echo %MAPNIK_PREFIX% - set hit=%1 - ) - - if /i "%1"=="--input-plugins" ( - echo %MAPNIK_INPUT_PLUGINS_DIRECTORY% - set hit=%1 - ) - - if /i "%1"=="--fonts" ( - echo %MAPNIK_FONTS_DIRECTORY% - set hit=%1 - ) - - if /i "%1"=="--lib-name" ( - echo mapnik - set hit=%1 - ) - - if /i "%1"=="--libs" ( - echo mapnik.lib - set hit=%1 - ) - - @rem TODO - figure out how to avoid hardcoding these library names - if /i "%1"=="--dep-libs" ( - echo libpng16.lib zlib.lib harfbuzz.lib libwebp_dll.lib libjpeg.lib icuuc.lib icuin.lib cairo.lib libboost_system-vc140-mt-1_56.lib libxml2_a.lib ws2_32.lib - set hit=%1 - ) - - if /i "%1"=="--ldflags" ( - echo %MAPNIK_LIBS% - set hit=%1 - ) - - if /i "%1"=="--defines" ( - echo _WINDOWS BOOST_ALL_NO_LIB BOOST_LIB_TOOLSET="vc140" BOOST_COMPILER="14.0" BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES HAVE_JPEG HAVE_PNG HAVE_WEBP HAVE_TIFF MAPNIK_USE_PROJ4 BOOST_REGEX_HAS_ICU GRID_RENDERER SVG_RENDERER MAPNIK_THREADSAFE BIGINT HAVE_LIBXML2 HAVE_CAIRO LIBXML_STATIC - set hit=%1 - ) - - @rem /MD is multithreaded dynamic linking - http://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx - @rem /EHsc is to support c++ exceptions - http://msdn.microsoft.com/en-us/library/1deeycx5(v=vs.80).aspx - @rem /GR is to support rtti (runtime type detection) - http://msdn.microsoft.com/en-us/library/we6hfdy0.aspx - if /i "%1"=="--cxxflags" ( - echo /MD /EHsc /GR - set hit=%1 - ) - - if /i "%1"=="--includes" ( - echo %MAPNIK_INCLUDES% %MAPNIK_INCLUDES%\\mapnik\\agg - set hit=%1 - ) - - if /i "%1"=="--all-flags" ( - @rem nothing here yet - echo "" - set hit=%1 - ) - - if /i "%1"=="--cxx" ( - @rem nothing here yet - echo "" - set hit=%1 - ) - - if /i "%1"=="--cflags" ( - @rem nothing here yet - echo "" - set hit=%1 - ) - - if /i "%1"=="--dep-includes" ( - @rem nothing here yet - echo %MAPNIK_INCLUDES%\\cairo %MAPNIK_INCLUDES%\\freetype2 %MAPNIK_INCLUDES%\\google %MAPNIK_INCLUDES%\\libxml2 - set hit=%1 - ) - - @rem if we got here print warning - if /i NOT %1==%hit% ( - echo unknown option %1 1>&2 - ) -SHIFT -GOTO Loop -:Continue - - -goto exit_ok - -:help_msg -echo Usage: mapnik-config -echo Examples: -echo --libs : provide lib name for mapnik.dll -echo --defines : provide compiler defines needed for this mapnik build -echo --dep-libs : provide lib names of depedencies -echo --ldflags : provide lib paths to depedencies -echo --cxxflags : provide compiler flags -echo --includes : provide header paths for mapnik -echo --dep-includes : provide header paths for dependencies -echo --input-plugins : provide path to input plugins directory -echo --fonts : provide path to fonts directory -goto exit_ok - -:help_msg_err -echo Usage: mapnik-config -echo Examples: -echo --libs : provide lib name for mapnik.dll -echo --defines : provide compiler defines needed for this mapnik build -echo --dep-libs : provide lib names of depedencies -echo --ldflags : provide lib paths to depedencies -echo --cxxflags : provide compiler flags -echo --includes : provide header paths for mapnik -echo --dep-includes : provide header paths for dependencies -echo --input-plugins : provide path to input plugins directory -echo --fonts : provide path to fonts directory -goto exit_error - -:exit_error -exit /b 1 -goto :EOF - -:exit_ok -exit /b 0 -goto :EOF \ No newline at end of file