Vcpkg: [New Port Request] <Mapnik>

Created on 2 Aug 2019  路  29Comments  路  Source: microsoft/vcpkg

Library name: Mapnik

Library description:
Mapnik is an open source toolkit for developing mapping applications
Source repository URL:
https://github.com/mapnik/mapnik
Project homepage (if different from the source repository):
http://mapnik.org/
Anything else that is useful to know when adding (such as optional features the library may have that should be included):
In this repository there a few forks which works on windows
https://github.com/mapnik/mapnik/issues/4062

new-port good-first-issue

All 29 comments

Mapnik is incompatible with Boost 1.70

https://github.com/mapnik/mapnik/issues/4041

@Voskrese Hi, I think the bug with boost 1.71 is fixed I have not tried yet to see if I can build it on windows using vcpkg or not
https://github.com/mapnik/mapnik/tree/boost_1_71

not work windows

mapnik\src\mapnik\include\mapnik/feature.hpp(108): error C2664: 'mapnik::geometry::geometry<double>::geometry(const mapnik::geometry::geometry<double> &)': cannot convert argument 1 from 'mapnik::geometry::geometry_empty' to 'mapbox::util::no_init'
E:\tools\vcpkg\buildtrees\mapnik\src\mapnik\include\mapnik/feature.hpp(108): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
E:\tools\vcpkg\buildtrees\mapnik\src\mapnik\include\mapnik/geometry.hpp(64): note: see declaration of 'mapnik::geometry::geometry<double>::geometry'

example port

vcpkg_find_acquire_program(PYTHON2)
get_filename_component(PYTHON2_DIR "${PYTHON2}" DIRECTORY)
set(ENV{PATH} "$ENV{PATH};${PYTHON2_DIR}")

set(BOOST_ROOT ${CURRENT_INSTALLED_DIR})

vcpkg_configure_cmake(
    SOURCE_PATH ${SOURCE_PATH}
    PREFER_NINJA # Disable this option if project cannot be built with Ninja
#    NO_CHARSET_FLAG # automatic templates
    OPTIONS 
      -DWITH_CAIRO=OFF
      -DWITH_DEMO=OFF
      -DWITH_GRID=OFF
      -DWITH_INPUTS=OFF
      -DWITH_INPUT_CSV=OFF
      -DWITH_INPUT_GDAL=OFF
      -DWITH_INPUT_GEOBUF=OFF
      -DWITH_INPUT_GEOJSON=OFF
      -DWITH_INPUT_OGR=OFF
      -DWITH_INPUT_PGRASTER=OFF
      -DWITH_INPUT_POSTGIS=OFF
      -DWITH_INPUT_RASTER=OFF
      -DWITH_INPUT_SHAPE=OFF
      -DWITH_INPUT_SQLITE=OFF
      -DWITH_INPUT_TOPOJSON=OFF
      -DWITH_PROJ4=OFF
      -DWITH_UTILS=OFF
      -DWITH_VIEWER=OFF
#      -DMAPNIK_STATIC_LIB=OFF
      -DBOOST_PREFIX=${CURRENT_INSTALLED_DIR}/include
      -DFREE_TYPE_INCLUDE=${CURRENT_INSTALLED_DIR}/include/freetype2
)

vcpkg_install_cmake()

@Voskrese I believe they could build it on windows.
https://github.com/mapnik/mapnik/issues/4062

@am2222 I'm talking about this version - mapnik/mapnik/tree/boost_1_71
, the same error almost

@Voskrese Awo yes I got that, I think there is an issue with boost sprit yet, I guess It needs to be updated to the latest version
https://github.com/boostorg/spirit/commit/10d027fd5cfd573471e80e2e3c2d0cb0616a6d65

With the new version spirit and tried

I guess they have fixed the the issue with the latest version of boos (1.72) based on the latest comment on here https://github.com/mapnik/mapnik/issues/4095 with https://github.com/mapnik/mapnik/pull/4103

update:
I tried to build this version of mapnik and it seems it works with the vcpkg
https://github.com/am2222/mapnik-windows
however the boost library must be updated to 1.72 because of a problem in spirit, Now the question is how I can try to port it on vcpkg, I need some hints about doing it.

Hi @am2222
Thanks for posting this request.
Boosthas been updated to 1.73 in vcpkg now.

If you wish to add this port in the future, you can reopen this issue, but we're closing it for now.

Hi @NancyLi1013,
Thanks, should the port be the same as what is on mapnik's repo? I have a version which works on windows (https://github.com/am2222/mapnik-windows) but it is not the latest version of mapnik.

Does this version https://github.com/am2222/mapnik-windows only support on windows platform?
It might be better to use the original repo source.

So you might have a try to build the latest version on mapnik's repo.

We can鈥檛 reopen this issue until a PR is opened, unfortunately; consider making a pull request.

@NancyLi1013
I have tried to build it for windows, so the package must work on both windows and linux right?I will give it a try to see how that works on linux

Thanks for your update.
Actually, I'm not sure about this. But you can have a try to see the support for Linux.

Once a pull request is opened, I will reopen this issue.

Look forward to the good news.

@NancyLi1013 thanks for your help. I am working on porting it and faced an issue. is there any way to check for dependencies in the profile.cmake before start installing? or even installing those dependencies automatically? like ICU.

There is no way to check dependencies in portfile.cmake. But you can check this in CONTROLvia Build-depends field. If we add this, the dependencies will be installed automatically.

Since you have made a pull request for this issue. I reopen this now.

@NancyLi1013 Thanks, I tried to follows vcpkg standards but it could not pass the tests fully. maybe it is because of protozero dependency.

You can try it again after protozero is added.

In addition, I noticed that you used https://github.com/am2222/mapnik-windows instead of the original repo. Is this duo to there are some problems on https://github.com/mapnik/mapnik?

@NancyLi1013 Yes sue,
The reason that I used that version is because of the mapnik's original build system which is not using cmake. I tried to keep it up to data with the original repository.

possible reason for breaking on linux
https://github.com/microsoft/vcpkg/issues/11780

I have mapnik ported to vcpkg here https://github.com/jremillard/vcpkg, it is against the official v3.0.23 release, but uses the cmake files from the mapnik-windows branch. The dependent packages are patched as needed.

@jremillard thanks for the port. I think we are working parallel. I noticed that you are adding two ports. to fix this you have to PR per each port. but as a side question. why do you need libosmium?

@jremillard I used your fork and added a PR for libosmium then we can marge our versions of mapnik to one version and make a PR. the current version that I currently have has most of features and copies most of the tools. however, I see that you are patching icu as well. is it to build on linux?
https://github.com/microsoft/vcpkg/pull/11863

@NancyLi1013 Is there any way to see the reason of failure on CI? For both mapnik and libosmium I can build them on my local machine for x64-windows but it fails on CI.

E:\Personal\SideWorks\vcpkg>vcpkg install libosmium:x64-windows
Computing installation plan...
The following packages will be built and installed:
    libosmium[core]:x64-windows
  * utfcpp[core]:x64-windows
Additional packages (*) will be modified to complete this operation.
Starting package 1/2: utfcpp:x64-windows
Building package utfcpp[core]:x64-windows...
-- Using cached E:/Personal/SideWorks/vcpkg/downloads/nemtrif-utfcpp-v3.1.1.tar.gz
-- Using source at E:/Personal/SideWorks/vcpkg/buildtrees/utfcpp/src/v3.1.1-1966381c88
-- Installing: E:/Personal/SideWorks/vcpkg/packages/utfcpp_x64-windows/share/utfcpp/copyright
-- Performing post-build validation
-- Performing post-build validation done
Building package utfcpp[core]:x64-windows... done
Installing package utfcpp[core]:x64-windows...
Installing package utfcpp[core]:x64-windows... done
Elapsed time for package utfcpp:x64-windows: 2.677 s
Starting package 2/2: libosmium:x64-windows
Building package libosmium[core]:x64-windows...
-- Using cached E:/Personal/SideWorks/vcpkg/downloads/osmcode-libosmium-v2.15.5.tar.gz
-- Using source at E:/Personal/SideWorks/vcpkg/buildtrees/libosmium/src/v2.15.5-fe171f9bc2
-- Configuring x64-windows
-- Building x64-windows-dbg
-- Building x64-windows-rel
-- Installing: E:/Personal/SideWorks/vcpkg/packages/libosmium_x64-windows/share/libosmium/copyright
-- Performing post-build validation
-- Performing post-build validation done
Building package libosmium[core]:x64-windows... done
Installing package libosmium[core]:x64-windows...
Installing package libosmium[core]:x64-windows... done
Elapsed time for package libosmium:x64-windows: 23.69 s

Total elapsed time: 26.39 s


@am2222 The protozero is needed for libosmium. You might have protozero laying around, which is making it work by accident? I don't see protozero in your local build output. My repo has protozero already packaged up.

libosmium isn't needed by mapnik. I ported it in because I needed for my application.

@am2222 The harfbuzz patch was needed when you compile with UCI which is needed for mapnik. harfbuzz compiles ok, without the ICU option. https://github.com/jremillard/vcpkg/commit/cd0b94c9fe1e016a6da0d0191725ad6204cb1b8b

@am2222 The protozero is needed for libosmium. You might have protozero laying around, which is making it work by accident? I don't see protozero in your local build output. My repo has protozero already packaged up.

libosmium isn't needed by mapnik. I ported it in because I needed for my application.

@jremillard thanks. I have added protozero to vcpkg before and it seems it is accepted in the latest version of vcpkg. But it still does not build it. probably there is something wrong with the CI? maybe it is not using the latest vcpkg which has protozero?

@am2222 The harfbuzz patch was needed when you compile with UCI which is needed for mapnik. harfbuzz compiles ok, without the ICU option. jremillard@cd0b94c

So I will add that patch as well. Thanks for the patches. It really helped me with getting rid of regular update on mapnik-windows branch. is there any automatic way to make those patch files from git repos?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

spindensity picture spindensity  路  3Comments

pakdel picture pakdel  路  3Comments

jasjuang picture jasjuang  路  3Comments

tzbo picture tzbo  路  3Comments

pkeir picture pkeir  路  3Comments