Skip to content

Commit

Permalink
Merge pull request #946 from mapnik/n-api
Browse files Browse the repository at this point in the history
N-API port
  • Loading branch information
artemp authored Aug 7, 2020
2 parents 4ee3c71 + 297c97d commit 07a48ec
Show file tree
Hide file tree
Showing 119 changed files with 28,294 additions and 29,622 deletions.
56 changes: 22 additions & 34 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
language: node_js

sudo: false

# build options and AWS keys for publishing binaries
# note: you'll need to generate your own keys for publishing a separate project
env:
global:
- secure: "bvbvxQe4GXZoU1zxm6KylaUSuQuhUZKe1V4+iYM0Sde6hj6RtAUccCWT7mNacCe2I6uGVHHjVfd7wLovT5y7lyT5pzY3UtypxFwuvGxDHotH4hhTg4m8/7APdB4bf5YgBf5IC6pMUPpUloh6TsTIwYzEaJdp/52b31Qfx80FooqOGOrEqntiyvidWsdUmlrxWnpxCVndkZgwvD15Uc08DWyD8Hklor6cKW6d/3zVIFmy81uAvTQp5W5xXC47S/BYYIwz3GU0zx+CMWM1oFObSbkVMG3LXDurqyvzWf9+09ZtBlC2JW0AOt9atk7vnD115Ia1KaEWalMhb3AGwJx4M4hqonooWOx20NL5P0sqEUe94GBUwvvb295vFTbw9guSGYXL3cOeWTlh2Ol466vJUwBvfr4OQ6Qu401nb1sIIv4SoIT9xXSHbopoderRVQurrcl/wesR19hgzrQC9ytJ6QCS1xnnzKogflfMQDDayrCMwpiZ5gvMGheGNbAh661wL03YXiviMwG307+iwFk8zyw05g4nW5/v3S+OYq3QatUgk+ZDpX2JS2zX4D6Aj2QLzKtCrx9pNpngl8pN+drmac1nklUeQLANxyv8hQjJvs1a4utj7ed9CY7QEWkvfrUl7rZqXvzacKmGEWoTkZKru19pa0enLTThKQV6AOei3e4="

install:
# set up the environment by installing mason and clang++
- ./scripts/setup.sh --config local.env
Expand Down Expand Up @@ -39,29 +31,29 @@ script:
# run your tests and build binaries
matrix:
include:
# linux publishable node v10
- os: linux
env: BUILDTYPE=release
node_js: 10
# linux publishable node v12
# linux publishable Release
- os: linux
env: BUILDTYPE=release
node_js: 12
# osx publishable node v10
# osx publishable Release
- os: osx
osx_image: xcode8.2
osx_image: xcode11
env: BUILDTYPE=release
node_js: 10
# osx publishable node v12
node_js: 12
# linux publishable Debug
- os: linux
env: BUILDTYPE=debug
node_js: 12
# osx publishable
- os: osx
osx_image: xcode8.2
env: BUILDTYPE=release
osx_image: xcode11
env: BUILDTYPE=debug
node_js: 12
# Sanitizer build node v10/Debug
# Sanitizer build
- os: linux
env: BUILDTYPE=debug TOOLSET=-asan
node_js: 10
# Overrides `install` to set up custom asan flags
node_js: 12
# Overrides `before_script` to disable publishing and to set up custom asan flags
install:
- ./scripts/setup.sh --config local.env
# put mason and clang++ on PATH
Expand All @@ -72,7 +64,7 @@ matrix:
- export LDFLAGS="${MASON_SANITIZE_LDFLAGS}"
- make distclean
- make ${BUILDTYPE}
# Overrides `script` to disable asan LD_PRELOAD before publishing
# Overrides `before_script` to disable asan LD_PRELOAD before publishing
before_script:
- export LD_PRELOAD=${MASON_LLVM_RT_PRELOAD}
# TODO: re-enable detect_leaks=0 once we can build and test against an asan sanitized libc++
Expand All @@ -85,7 +77,7 @@ matrix:
# g++ build (default builds all use clang++)
- os: linux
env: BUILDTYPE=debug CXX="g++-6" CC="gcc-6"
node_js: 10
node_js: 12
addons:
apt:
sources:
Expand All @@ -97,7 +89,7 @@ matrix:
install:
- make distclean
- make ${BUILDTYPE}
# Overrides `script` to disable publishing
# Overrides `before_script` to disable publishing
before_script:
# manually initialize mason (avoid sourcing local.env since we don't want to use clang++ here)
- ./scripts/setup.sh --config local.env
Expand All @@ -107,15 +99,15 @@ matrix:
# test building with out SSE_MATH enabled
- os: linux
env: BUILDTYPE=release SSE_MATH=false
node_js: 10
# Overrides `script` to disable publishing
node_js: 12
# Overrides `before_script` to disable publishing
before_script:
- npm test
# Coverage build
- os: linux
env: BUILDTYPE=debug CXXFLAGS="--coverage" LDFLAGS="--coverage"
node_js: 10
# Overrides `script` to publish coverage data to codecov
node_js: 12
# Overrides `before_script` to disable publishing and to publish coverage data to codecov
before_script:
- source scripts/postgis/setup_and_run.sh
- npm test
Expand All @@ -124,8 +116,4 @@ matrix:
- which llvm-cov
- curl -S -f https://codecov.io/bash -o codecov
- chmod +x codecov
- ./codecov -x "llvm-cov gcov" -Z

notifications:
slack:
secure: wLpScQaDoEsVe0Bu28b62FGZBfmX3s/NK8DWcuSxEFx80k8RKPNgnMg8htamG0zRSf5htF+X6jy2P0IeUvbeupIaJwqtXvHaJYtlMTmemG/xuXLTpLp6k6giT2mWm/lp+ykuaF/PvUcZWUhSf1zhS6vwIekrMYIcDYvNXjO8DNw=
- ./codecov -x "llvm-cov gcov" -Z
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## 4.5.1
- Fixed 'scale_denominator' default value in `VectorTile::render(..)`(#952)
- Fixed wrong arguments order in AsyncComposite + added test (#953)

## 4.5.0
- Ported to N-API.
- Now supporting node v14 using a "universal binary" (same binary will be used for all major node versions)
- Update mapnik to 26d3084ea
- Ported tests from mocha to tape
- Upgraded to boost 1.73.0
- Binaries now compiled with clang++ 10.x

## 4.4.0

- Update mapnik to 3be9ce8fa
Expand Down
45 changes: 39 additions & 6 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,64 @@
"src/node_mapnik.cpp",
"src/blend.cpp",
"src/mapnik_map.cpp",
"src/mapnik_map_load.cpp",
"src/mapnik_map_from_string.cpp",
"src/mapnik_map_render.cpp",
"src/mapnik_map_query_point.cpp",
"src/mapnik_color.cpp",
"src/mapnik_geometry.cpp",
"src/mapnik_feature.cpp",
"src/mapnik_image.cpp",
"src/mapnik_image_encode.cpp",
"src/mapnik_image_open.cpp",
"src/mapnik_image_fill.cpp",
"src/mapnik_image_save.cpp",
"src/mapnik_image_from_bytes.cpp",
"src/mapnik_image_from_svg.cpp",
"src/mapnik_image_solid.cpp",
"src/mapnik_image_multiply.cpp",
"src/mapnik_image_clear.cpp",
"src/mapnik_image_copy.cpp",
"src/mapnik_image_resize.cpp",
"src/mapnik_image_compositing.cpp",
"src/mapnik_image_filter.cpp",
"src/mapnik_image_view.cpp",
"src/mapnik_grid.cpp",
"src/mapnik_grid_view.cpp",
"src/mapnik_memory_datasource.cpp",
"src/mapnik_palette.cpp",
"src/mapnik_projection.cpp",
"src/mapnik_layer.cpp",
"src/mapnik_datasource.cpp",
"src/mapnik_featureset.cpp",
"src/mapnik_expression.cpp",
"src/mapnik_cairo_surface.cpp",
"src/mapnik_vector_tile.cpp"
],
"msvs_disabled_warnings": [
4267
"src/mapnik_vector_tile.cpp",
"src/mapnik_vector_tile_data.cpp",
"src/mapnik_vector_tile_query.cpp",
"src/mapnik_vector_tile_json.cpp",
"src/mapnik_vector_tile_info.cpp",
"src/mapnik_vector_tile_simple_valid.cpp",
"src/mapnik_vector_tile_render.cpp",
"src/mapnik_vector_tile_clear.cpp",
"src/mapnik_vector_tile_image.cpp",
"src/mapnik_vector_tile_composite.cpp",
"node_modules/mapnik-vector-tile/src/vector_tile_compression.cpp",
"node_modules/mapnik-vector-tile/src/vector_tile_datasource_pbf.cpp",
"node_modules/mapnik-vector-tile/src/vector_tile_featureset_pbf.cpp",
"node_modules/mapnik-vector-tile/src/vector_tile_geometry_decoder.cpp",
"node_modules/mapnik-vector-tile/src/vector_tile_geometry_encoder_pbf.cpp",
"node_modules/mapnik-vector-tile/src/vector_tile_layer.cpp",
"node_modules/mapnik-vector-tile/src/vector_tile_processor.cpp",
"node_modules/mapnik-vector-tile/src/vector_tile_raster_clipper.cpp",
"node_modules/mapnik-vector-tile/src/vector_tile_tile.cpp"
],
'include_dirs': [
'./mason_packages/.link/include/',
'./mason_packages/.link/include/freetype2',
'./mason_packages/.link/include/cairo',
'./mason_packages/.link/include/mapnik',
'./src',
"<!(node -e \"require('nan')\")",
"<!@(node -p \"require('node-addon-api').include.slice(1,-1)\")",
# TODO: move these to mason packages once we have a minimal windows client for mason (@springmeyer)
# https://github.com/mapbox/mason/issues/396
"./deps/geometry/include/",
Expand All @@ -48,6 +80,7 @@
],
'defines': [
'MAPNIK_GIT_REVISION="<!@(mapnik-config --git-describe)"',
'MAPNIK_VECTOR_TILE_LIBRARY=1',
],
'conditions': [
['ENABLE_GLIBC_WORKAROUND != "false"', {
Expand Down
17 changes: 8 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
"url": "http://github.com/mapnik/node-mapnik",
"homepage": "http://mapnik.org",
"author": "Dane Springmeyer <dane@mapbox.com> (mapnik.org)",
"version": "4.4.0",
"mapnik_version": "3be9ce8fa",
"version": "4.5.1",
"mapnik_version": "26d3084ea",
"main": "./lib/mapnik.js",
"binary": {
"module_name": "mapnik",
"module_path": "./lib/binding/",
"host": "https://mapbox-node-binary.s3.amazonaws.com",
"remote_path": "./{module_name}/v{version}/",
"package_name": "{node_abi}-{platform}-{arch}-{configuration}{toolset}.tar.gz"
"remote_path": "./{name}/v{version}/{configuration}/{toolset}/",
"package_name": "{platform}-{arch}.tar.gz"
},
"bugs": {
"email": "dane@mapbox.com",
Expand All @@ -37,7 +37,7 @@
"license": "BSD-3-Clause",
"dependencies": {
"mapnik-vector-tile": "3.0.1",
"nan": "~2.14.0",
"node-addon-api": "~3.0.0",
"node-pre-gyp": "~0.13.0"
},
"bin": {
Expand All @@ -47,17 +47,16 @@
"mapnik-shapeindex.js": "./bin/mapnik-shapeindex.js"
},
"scripts": {
"prepublishOnly": "npm ls",
"test": "jshint bin lib/index.js lib/mapnik.js && mocha -R spec --timeout 50000",
"test": "tape test/*.test.js",
"install": "node-pre-gyp install --fallback-to-build",
"docs": "documentation build src/*.cpp src/mapnik_plugins.hpp --polyglot -o documentation -f html --github --name Mapnik"
},
"devDependencies": {
"@mapbox/sphericalmercator": "~1.0.2",
"aws-sdk": "2.0.12",
"bytes": "~2.1.0",
"jshint": "^2.5.10",
"mocha": "^7.0.1"
"nyc": "^14.1.1",
"tape": "^4.5.1"
},
"jshintConfig": {
"node": true,
Expand Down
10 changes: 5 additions & 5 deletions scripts/install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ if [ ! -f ./mason_packages/.link/bin/mapnik-config ]; then
install cairo 1.14.8
install webp 0.6.0
install libgdal 2.1.3
install boost 1.66.0
install boost_libsystem 1.66.0
install boost_libfilesystem 1.66.0
install boost_libregex_icu57 1.66.0
install boost 1.73.0
install boost_libsystem 1.73.0
install boost_libfilesystem 1.73.0
install boost_libregex_icu57 1.73.0
install freetype 2.7.1
install harfbuzz 1.4.2-ft

# mapnik
# NOTE: sync this version with the `mapnik_version` in package.json (which is used for windows builds)
# In the future we could pull from that version automatically if mason were to support knowing the right dep
# versions to install automatically. Until then there is not much point since the deps are still hardcoded here.
install mapnik 3be9ce8fa
install mapnik 26d3084ea
fi
4 changes: 2 additions & 2 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
set -eu
set -o pipefail

export MASON_RELEASE="${MASON_RELEASE:-14b9f47d}"
export MASON_LLVM_RELEASE="${MASON_LLVM_RELEASE:-5.0.1}"
export MASON_RELEASE="${MASON_RELEASE:-70dd16d}"
export MASON_LLVM_RELEASE="${MASON_LLVM_RELEASE:-10.0.0}"

PLATFORM=$(uname | tr A-Z a-z)
if [[ ${PLATFORM} == 'darwin' ]]; then
Expand Down
Loading

0 comments on commit 07a48ec

Please sign in to comment.