node-mapnik icon indicating copy to clipboard operation
node-mapnik copied to clipboard

Documentation for building from mapnik source

Open knutole opened this issue 9 years ago • 2 comments
trafficstars

Would it be possible to document more thoroughly how to build node-mapnik so that it uses a specific mapnik build?

I can't seem to grasp what npm install mapnik --build-from-source actually does. Does it use binaries or the mapnik build on host?

What is the correct way to do this?

knutole avatar Mar 11 '16 13:03 knutole

@knutole

There is a lot of documentation that needs to be done around source builds for node-mapnik. Honestly its rather complicated in some ways because there are a lot of dependencies that need to be pulled in and it is something we even struggle with at times internally (as lots of us doing it in different ways).

However, this is not an excuse and we should have better documentation on how to build node-mapnik from source. I have no idea when we will get to this, but it is very much needed. If you want to help in any way I know that @mapsam would be the best person to coordinate with! He is our documentation expert/wizard.

flippmoke avatar Mar 14 '16 16:03 flippmoke

I can't seem to grasp what npm install mapnik --build-from-source actually does. Does it use binaries or the mapnik build on host?

  • npm install pulls binaries, if they are available (of both node-mapnik and libmapnik, which is bundled)
  • npm install --build-from-source triggers a source compile of node-mapnik against an external Mapnik. That external Mapnik must be available via a mapnik-config program on your PATH as per https://github.com/mapnik/node-mapnik#source-build.

Note: if you pass the mapnik keyword to npm install like npm install mapnik then that assumes you are trying to install the currently published version of node-mapnik from https://www.npmjs.com/package/mapnik. If you already have a github clone of node-mapnik and you are in the directory of that clone then you can omit the mapnik keyword and just type npm install or npm install --build-from-source

springmeyer avatar Mar 14 '16 16:03 springmeyer