mapnik / node-mapnik

Bindings to mapnik for node.js
http://mapnik.org/documentation/node-mapnik
BSD 3-Clause "New" or "Revised" License
532 stars 165 forks source link

Using `cmake-js` instead of `node-gyp` #985

Open artemp opened 2 years ago

artemp commented 2 years ago

https://github.com/cmake-js/cmake-js

/cc @mathisloge

mathisloge commented 2 years ago

I can use this. Wasn't sure if I needed to be compatible with node-pre-gyp. But if we change completly to cmake-js, it makes things easier for #976

artemp commented 2 years ago

@mathisloge - I have a branch using cmake-js, it's WIP but it can build mapnik.node against latest mapnik (mapnikConfig.cmake) and most tests are passing. Compatibility with node-pre-gyp is important to maintain somehow.. needs some thinking. Let me push my changes into an experimental branch just a sec ..

artemp commented 2 years ago

https://github.com/mapnik/node-mapnik/tree/cmake-js

cmake-js -m clean
cmake-js -m configure 
cmake-js -m compile # or cd build -> make -j4

@mathisloge - It needs https://github.com/mapbox/mapnik-vector-tile/tree/proj6 and some manual copying/editing e.g

cp -i ./build/Release/mapnik.node ./lib/binding/
 ...

but it works. I'd appreciate your thoughts.

mathisloge commented 2 years ago

I had #976 working with node-pre-gyp but moved away from cmake-js. I could add it back and leave it compatible with node-pre-gyp. So e.g. npm install would just work fine. I'm taking a closer look tomorrow evening.

But I need to finish the mapnik static PR before that, so the distribution will work fine :)

artemp commented 2 years ago

Can we add more info about dependencies used to build mapnik-core to mapnikConfig.cmake?

mathisloge commented 2 years ago

yeah, I can do that. But will do it with https://github.com/mapnik/mapnik/pull/4291