Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[New Port Request] <Mapnik> #7526

Closed
am2222 opened this issue Aug 2, 2019 · 30 comments · Fixed by #18849
Closed

[New Port Request] <Mapnik> #7526

am2222 opened this issue Aug 2, 2019 · 30 comments · Fixed by #18849
Labels
category:new-port The issue is requesting a new library to be added; consider making a PR! info:good-first-issue This issue would be a good issue to get one's feet wet in solving. info:new-port-resolved This port has been added to vcpkg.

Comments

@am2222
Copy link
Contributor

am2222 commented Aug 2, 2019

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
mapnik/mapnik#4062

@am2222 am2222 added the category:new-port The issue is requesting a new library to be added; consider making a PR! label Aug 2, 2019
@MVoz
Copy link
Contributor

MVoz commented Aug 3, 2019

Mapnik is incompatible with Boost 1.70

mapnik/mapnik#4041

@am2222
Copy link
Contributor Author

am2222 commented Oct 21, 2019

@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

@MVoz
Copy link
Contributor

MVoz commented Nov 4, 2019

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'

@MVoz
Copy link
Contributor

MVoz commented Nov 4, 2019

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()

@am2222
Copy link
Contributor Author

am2222 commented Nov 4, 2019

@voskrese I believe they could build it on windows.
mapnik/mapnik#4062

@MVoz
Copy link
Contributor

MVoz commented Nov 4, 2019

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

@am2222
Copy link
Contributor Author

am2222 commented Nov 5, 2019

@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
boostorg/spirit@10d027f

@MVoz
Copy link
Contributor

MVoz commented Nov 5, 2019

With the new version spirit and tried

@NancyLi1013 NancyLi1013 added the info:good-first-issue This issue would be a good issue to get one's feet wet in solving. label Dec 9, 2019
@NancyLi1013 NancyLi1013 removed their assignment Dec 9, 2019
@am2222
Copy link
Contributor Author

am2222 commented Dec 17, 2019

I guess they have fixed the the issue with the latest version of boos (1.72) based on the latest comment on here mapnik/mapnik#4095 with mapnik/mapnik#4103

@am2222
Copy link
Contributor Author

am2222 commented Dec 30, 2019

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.

@NancyLi1013
Copy link
Contributor

Hi @am2222
Thanks for posting this request.
Boost has 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.

@am2222
Copy link
Contributor Author

am2222 commented May 26, 2020

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.

@NancyLi1013
Copy link
Contributor

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’t reopen this issue until a PR is opened, unfortunately; consider making a pull request.

@am2222
Copy link
Contributor Author

am2222 commented May 26, 2020

@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

@NancyLi1013
Copy link
Contributor

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.

@am2222
Copy link
Contributor Author

am2222 commented May 28, 2020

@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.

@NancyLi1013
Copy link
Contributor

NancyLi1013 commented Jun 1, 2020

There is no way to check dependencies in portfile.cmake. But you can check this in CONTROL via 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 NancyLi1013 reopened this Jun 1, 2020
@am2222
Copy link
Contributor Author

am2222 commented Jun 2, 2020

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

@NancyLi1013
Copy link
Contributor

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?

@am2222
Copy link
Contributor Author

am2222 commented Jun 2, 2020

@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.

@am2222
Copy link
Contributor Author

am2222 commented Jun 4, 2020

possible reason for breaking on linux
#11780

@jremillard
Copy link

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.

@am2222
Copy link
Contributor Author

am2222 commented Jun 9, 2020

@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?

@am2222
Copy link
Contributor Author

am2222 commented Jun 9, 2020

@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?
#11863

@am2222
Copy link
Contributor Author

am2222 commented Jun 9, 2020

@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


@jremillard
Copy link

@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
Copy link

@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
Copy link
Contributor Author

am2222 commented Jun 10, 2020

@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
Copy link
Contributor Author

am2222 commented Jun 10, 2020

@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?

@NancyLi1013
Copy link
Contributor

NancyLi1013 commented Sep 17, 2021

Hi all,

mapnik has been added to vcpkg now, please try to update to the latest vcpkg to use this port. Thanks for your hard work in adding this port. @am2222, @mathisloge

@NancyLi1013 NancyLi1013 added the info:new-port-resolved This port has been added to vcpkg. label Sep 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:new-port The issue is requesting a new library to be added; consider making a PR! info:good-first-issue This issue would be a good issue to get one's feet wet in solving. info:new-port-resolved This port has been added to vcpkg.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants