-
Notifications
You must be signed in to change notification settings - Fork 165
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
Enable all platforms again #976
Draft
mathisloge
wants to merge
99
commits into
mapnik:master
Choose a base branch
from
mathisloge:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
99 commits
Select commit
Hold shift + click to select a range
7e93421
proj6 - WIP
artemp f308203
Merge branch 'master' into proj6
artemp 0f0dcbc
Update test data to use proj6 format
artemp 12b2adc
add vcpkg
mathisloge 3d685ee
getting started
mathisloge 0e7bcc1
enable compilation
mathisloge cce4830
first successful build
mathisloge 4041d9d
remove deps replaced by vcpkg
mathisloge 4c3124e
remove lock
mathisloge 9a84454
remove wrong var
mathisloge 31bd956
update deps
mathisloge 1855a94
add some deployment
mathisloge 27ae60b
generate mapnik_settings.js
mathisloge 6ba2b19
correct settings paths
mathisloge 9bf9199
fix prebuild
mathisloge 88b0a2a
add publish binary
mathisloge 13feaa8
add some debug output
mathisloge 869fdf6
add proj copy
mathisloge 76c9062
copy dlls on windows
mathisloge 0875547
copy dlls from executables
mathisloge cae1ae2
remove not needed script
mathisloge ca07cf6
update vcpkg
mathisloge 1a2ecdf
fix cmake
mathisloge c055b4e
some fixes
mathisloge f2d7231
only use vcpkg on windows
mathisloge c510aed
update vcpkg
mathisloge fda4399
update cmake-js
mathisloge 75c16f2
update vcpkg to microsoft repo
mathisloge 548175e
update modules
mathisloge b3d9b3d
comment out proj
mathisloge c1df593
use correct define for MAPNIK_USE_PROJ
mathisloge 999290a
update some deps
mathisloge 9648c83
update
mathisloge c8be847
add preinstall step to clone submodules
mathisloge 759cd30
remove install step
mathisloge b5e8c6a
Merge branch 'master' into proj6
artemp 3ea68bc
update vcpkg
mathisloge f304f81
Merge branch 'proj6' of https://github.com/mapnik/node-mapnik
mathisloge ce68212
update vcpkg
mathisloge f72328e
use generator expr. to generate the settings file
mathisloge af857e9
better copy deps
mathisloge 9fcf8ac
update vcpkg
mathisloge d78d0e4
prevent UB
mathisloge f21d963
node module is a module not a shared
mathisloge 044f019
add threads
mathisloge dcc0517
add dlls to search path
mathisloge 4717d5c
update vcpkg
mathisloge 91c9edc
update vcpkg to latest master
mathisloge 678ed28
DEBUG: use docker
mathisloge 62d6473
Merge branch 'master' of https://github.com/mapnik/node-mapnik
mathisloge 970e2fc
docker: delete build dir
mathisloge eb26634
update vcpkg
mathisloge 26ec085
better docker image
mathisloge 068944b
better docker file
mathisloge 545a2b8
remove `cmake-js`
mathisloge 7f5b2e3
strip whitespaces
mathisloge 392b624
build with node-pre-gyp
mathisloge a43e670
update package.json
mathisloge bca8a1b
linux support
mathisloge 35be137
wip
mathisloge c6d6648
use cmake version of mapnik-vector-tile
mathisloge 2b2146f
update remote mapnik_vector_tile
mathisloge 49b02c6
fix
mathisloge d5e99bc
remove make as gen
mathisloge 6700106
update vcpkg
mathisloge 3597553
add targets to package.json
mathisloge a8d064f
extract post build generation file into an actual file
mathisloge 4b0f0a4
formatting
mathisloge 868443c
remove console.log
mathisloge 21f28c2
add npm publish and test workflow
mathisloge c20e503
set name for workflow
mathisloge 51230f4
version bump
mathisloge 753bf7d
use latest vcpkg
mathisloge 0fe5e8f
dont run the tests for now
mathisloge f60f23f
use old baseline
mathisloge 391319a
use older vcpkg
mathisloge d495a7d
newer vcpkg
mathisloge 025274c
remove vcpkg
mathisloge 47cb33b
use newer node-pre-gyp-github
mathisloge 829f168
remove baseline
mathisloge ca23f42
collect logs
mathisloge 029a626
remove duplicate input-geojson in manifest
mathisloge e29ac46
readd vcpkg for development
mathisloge 815cbd9
Revert "readd vcpkg for development"
mathisloge f360272
test vcpkg gdal fix
mathisloge ff62aeb
run only windows for debugging
mathisloge 4cec3f3
windows has not enough disk space. disable
mathisloge 9762ed5
bump version
mathisloge 6b8b28b
bump version
mathisloge a937665
fix publish script
mathisloge c444664
fix publish
mathisloge ba62427
remove publish
mathisloge d1100be
unix improvements
mathisloge f5fa7a2
windows fixes
mathisloge e6a8021
wrong toolchain
mathisloge 8e0300b
use vcpkg
mathisloge 9366943
remove rpath
mathisloge 641f560
ubuntu install sys deps
mathisloge 2e63b33
install make
mathisloge File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.vscode | ||
.git | ||
build | ||
build-tmp* | ||
node_modules | ||
package-lock.json | ||
vcpkg | ||
lib/binding |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: Node.js Package | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
env: | ||
VCPKG_SHA: 5ef52b5b75887fb150711f5effb221dd98b99e6f, | ||
NUGET_REGISTRY: https://nuget.pkg.github.com/mathisloge/index.json | ||
NUGET_USERNAME: mathisloge | ||
VCPKG_BINARY_SOURCES: "clear;nuget,GitHub,readwrite" | ||
VCPKG_NUGET_REPOSITORY: https://github.com/mathisloge/vcpkg-nuget.git | ||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
include: | ||
#- os: windows-latest | ||
# architecture: x64 | ||
# node_version: 16 | ||
|
||
- os: ubuntu-latest | ||
mono: mono | ||
architecture: x64 | ||
node_version: 16 | ||
|
||
#- os: macos-latest | ||
# mono: mono | ||
# architecture: x64 | ||
# node_version: 16 | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- uses: ilammy/msvc-dev-cmd@v1 | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- name: checkout vcpkg | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: "dg0yt/vcpkg" | ||
ref: gdal-paths | ||
path: vcpkg | ||
|
||
- name: "Setup vcpkg" | ||
shell: bash | ||
run: ./vcpkg/bootstrap-vcpkg.sh | ||
|
||
- name: "Setup NuGet Credentials" | ||
shell: "bash" | ||
run: > | ||
${{ matrix.mono }} `./vcpkg/vcpkg fetch nuget | tail -n 1` | ||
sources add | ||
-source "${{ env.NUGET_REGISTRY }}" | ||
-storepasswordincleartext | ||
-name "GitHub" | ||
-username "${{ env.NUGET_USERNAME }}" | ||
-password "${{ secrets.NUGET_REGISTRY_PAT }}" | ||
|
||
- name: "Setup NuGet apikey" | ||
shell: "bash" | ||
run: > | ||
${{ matrix.mono }} `./vcpkg/vcpkg fetch nuget | tail -n 1` | ||
setapikey "${{ secrets.NUGET_REGISTRY_PAT }}" -Source "${{ env.NUGET_REGISTRY }}" | ||
|
||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node_version }} | ||
architecture: ${{ matrix.architecture }} | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- run: npm install | ||
|
||
- name: upload release assets | ||
run: npm run postpublish | ||
env: | ||
NODE_PRE_GYP_GITHUB_TOKEN: ${{secrets.NUGET_REGISTRY_PAT}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: Node.js Test | ||
|
||
on: | ||
push: | ||
|
||
env: | ||
VCPKG_SHA: 5ef52b5b75887fb150711f5effb221dd98b99e6f | ||
NUGET_REGISTRY: https://nuget.pkg.github.com/mathisloge/index.json | ||
NUGET_USERNAME: mathisloge | ||
VCPKG_BINARY_SOURCES: "clear;nuget,GitHub,readwrite" | ||
VCPKG_NUGET_REPOSITORY: https://github.com/mathisloge/vcpkg-nuget.git | ||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
include: | ||
#- os: windows-latest | ||
# architecture: x64 | ||
# node_version: 16 | ||
|
||
- os: ubuntu-latest | ||
mono: mono | ||
architecture: x64 | ||
node_version: 16 | ||
|
||
#- os: macos-latest | ||
# mono: mono | ||
# architecture: x64 | ||
# node_version: 16 | ||
|
||
steps: | ||
- name: Install required system packages | ||
shell: "bash" | ||
run: | | ||
sudo apt-get install -y gperf libxxf86vm-dev ninja-build make | ||
- uses: ilammy/msvc-dev-cmd@v1 | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- name: checkout vcpkg | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: "mathisloge/vcpkg" | ||
ref: test/mapnik-static | ||
path: vcpkg | ||
|
||
- name: "Setup vcpkg" | ||
shell: bash | ||
run: ./vcpkg/bootstrap-vcpkg.sh | ||
|
||
- name: "Setup NuGet Credentials" | ||
shell: "bash" | ||
run: > | ||
${{ matrix.mono }} `./vcpkg/vcpkg fetch nuget | tail -n 1` | ||
sources add | ||
-source "${{ env.NUGET_REGISTRY }}" | ||
-storepasswordincleartext | ||
-name "GitHub" | ||
-username "${{ env.NUGET_USERNAME }}" | ||
-password "${{ secrets.NUGET_REGISTRY_PAT }}" | ||
|
||
- name: "Setup NuGet apikey" | ||
shell: "bash" | ||
run: > | ||
${{ matrix.mono }} `./vcpkg/vcpkg fetch nuget | tail -n 1` | ||
setapikey "${{ secrets.NUGET_REGISTRY_PAT }}" -Source "${{ env.NUGET_REGISTRY }}" | ||
|
||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node_version }} | ||
architecture: ${{ matrix.architecture }} | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- run: npm install --build-from-source | ||
#- run: npm test | ||
|
||
- uses: actions/upload-artifact@v2 | ||
if: failure() | ||
with: | ||
name: vcpkg-logs | ||
path: vcpkg/buildtrees/**/*.log | ||
retention-days: 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
[submodule "deps/wagyu"] | ||
path = deps/wagyu | ||
url = https://github.com/mapbox/wagyu.git | ||
[submodule "deps/geometry"] | ||
path = deps/geometry | ||
url = https://github.com/mapbox/geometry.hpp.git | ||
[submodule "deps/protozero"] | ||
path = deps/protozero | ||
url = https://github.com/mapbox/protozero.git | ||
[submodule "deps/wagyu"] | ||
path = deps/wagyu | ||
url = https://github.com/mapbox/wagyu.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"files.associations": { | ||
"iosfwd": "cpp" | ||
}, | ||
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools", | ||
"cmake.configureOnEdit": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
cmake_minimum_required(VERSION 3.15) | ||
set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_LIST_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake") | ||
project(node-mapnik) | ||
|
||
set(MAPBOX_WAGYU_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/deps/wagyu/include" CACHE INTERNAL "wagyu include dir") | ||
set(BUILD_TESTING OFF) | ||
set(MAPNIK_VECTOR_TILE_ENABLE_INSTALL OFF) | ||
set(CMAKE_CXX_STANDARD 14) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
|
||
find_package(Threads REQUIRED) | ||
find_package(PkgConfig) | ||
pkg_check_modules(Cairo REQUIRED IMPORTED_TARGET cairo) | ||
pkg_check_modules(PROJ REQUIRED IMPORTED_TARGET proj) | ||
find_package(Protobuf REQUIRED) | ||
find_package(mapnik CONFIG REQUIRED COMPONENTS shapeindex mapnik-index) | ||
|
||
include(FetchContent) | ||
FetchContent_Declare( | ||
napi_modules | ||
GIT_REPOSITORY https://github.com/mathisloge/cmake-napi.git | ||
GIT_TAG cdc5203c12f7e44ccb260b315256590d54b574af | ||
) | ||
FetchContent_Declare( | ||
mapnik_vector_tile | ||
GIT_REPOSITORY https://github.com/mathisloge/mapnik-vector-tile.git | ||
GIT_TAG 4ad96069d5241a592d326ee0eca1ce89cf33372f | ||
GIT_SUBMODULES "src" # https://gitlab.kitware.com/cmake/cmake/-/issues/20579 | ||
) | ||
FetchContent_MakeAvailable(mapnik_vector_tile napi_modules) | ||
FetchContent_GetProperties(napi_modules SOURCE_DIR napi_src) | ||
list(APPEND CMAKE_MODULE_PATH "${napi_src}/modules") | ||
include(napi-gyp) | ||
|
||
|
||
execute_process(COMMAND node -p "require('node-addon-api').include" | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} | ||
OUTPUT_VARIABLE NODE_ADDON_API_DIR | ||
) | ||
string(REPLACE "\n" "" NODE_ADDON_API_DIR ${NODE_ADDON_API_DIR}) | ||
string(REPLACE "\"" "" NODE_ADDON_API_DIR ${NODE_ADDON_API_DIR}) | ||
|
||
add_subdirectory(deps) | ||
mapnik_find_plugin_dir(MAPNIK_PLUGINS_DIR) | ||
message(STATUS "Using plugins from ${MAPNIK_PLUGINS_DIR}") | ||
|
||
add_library(node-mapnik MODULE | ||
src/mapnik_logger.cpp | ||
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_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 | ||
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 | ||
) | ||
set_target_properties(node-mapnik PROPERTIES PREFIX "" OUTPUT_NAME "mapnik" SUFFIX ".node") | ||
target_include_directories(node-mapnik PRIVATE | ||
${NODE_ADDON_API_DIR} | ||
) | ||
|
||
target_compile_definitions(node-mapnik PRIVATE | ||
_USE_MATH_DEFINES | ||
MAPNIK_GIT_REVISION=1 | ||
) | ||
|
||
if(MSVC) | ||
target_compile_definitions(node-mapnik PRIVATE /wd4068) | ||
endif() | ||
|
||
target_link_libraries(node-mapnik | ||
mapnik::core | ||
mapnik::json | ||
mapnik::wkt | ||
mapnik::mapnik | ||
mapbox-geometry | ||
mapbox-wagyu | ||
mapbox-protozero | ||
node::napi | ||
mapnik::mapnik-vector-tile | ||
) | ||
|
||
# post build | ||
file(GENERATE | ||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>_copy.cmake" | ||
INPUT "${CMAKE_CURRENT_SOURCE_DIR}/cmake/post_build.cmake" | ||
) | ||
|
||
# installation | ||
macro(install_variable var) | ||
install(CODE "set(${var} \"${${var}}\")") | ||
endmacro() | ||
|
||
install(TARGETS node-mapnik | ||
RUNTIME_DEPENDENCY_SET node-mapnik-deps | ||
RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" | ||
ARCHIVE DESTINATION "${CMAKE_INSTALL_PREFIX}" | ||
LIBRARY DESTINATION "${CMAKE_INSTALL_PREFIX}" | ||
) | ||
install_variable(MAPNIK_FONTS_DIR) | ||
install_variable(MAPNIK_PLUGINS_DIR) | ||
install_variable(VCPKG_INSTALLED_DIR) | ||
install_variable(VCPKG_TARGET_TRIPLET) | ||
install(CODE "set(SOURCE_DIR \"${CMAKE_CURRENT_SOURCE_DIR}\")") | ||
install(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>_copy.cmake) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM ghcr.io/mathisloge/mapnik:docker | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt update && apt install -y nodejs npm git libprotobuf-dev protobuf-compiler && mkdir /nodemapnik | ||
|
||
WORKDIR /nodemapnik | ||
COPY . . | ||
RUN npm install && rm -rf build* | ||
RUN npm run test |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a Dockerfile for this base image?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it's build from this branch mapnik/mapnik#4267