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

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

Open artemp opened this issue 3 years ago • 6 comments

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

/cc @mathisloge

artemp avatar Aug 22 '22 08:08 artemp

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

mathisloge avatar Aug 22 '22 09:08 mathisloge

@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 avatar Aug 22 '22 09:08 artemp

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.

artemp avatar Aug 22 '22 09:08 artemp

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

mathisloge avatar Aug 22 '22 12:08 mathisloge

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

artemp avatar Aug 22 '22 12:08 artemp

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

mathisloge avatar Aug 23 '22 17:08 mathisloge