mirror of
https://github.com/openstreetmap/mod_tile.git
synced 2025-08-01 07:43:30 +00:00
Add support for building for Mapnik 4 (#305)
This commit is contained in:
@ -19,7 +19,7 @@ runs:
|
||||
|
||||
- name: Cache "Download `Mapnik`" & "Build & Install `Mapnik`"
|
||||
id: cache-mapnik
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: /usr/local/src/mapnik-${{ inputs.version }}
|
||||
key: ${{ matrix.image }}-mapnik-${{ inputs.version }}
|
||||
|
2
.github/actions/yum/install/action.yml
vendored
2
.github/actions/yum/install/action.yml
vendored
@ -14,7 +14,7 @@ runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Cache `DNF` / `YUM`
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
/var/cache/dnf
|
||||
|
141
.github/workflows/build-and-test-mapnik-4.yml
vendored
Normal file
141
.github/workflows/build-and-test-mapnik-4.yml
vendored
Normal file
@ -0,0 +1,141 @@
|
||||
---
|
||||
name: Build & Test (Mapnik >= 4)
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- develop
|
||||
|
||||
jobs:
|
||||
build-and-test-mapnik-4:
|
||||
name: ${{ matrix.image }}
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
image:
|
||||
- 'debian:11'
|
||||
on_default_branch:
|
||||
- ${{ contains(github.ref, 'master') }}
|
||||
include:
|
||||
- image: 'ubuntu:22.04'
|
||||
exclude:
|
||||
- on_default_branch: false
|
||||
fail-fast: false
|
||||
container:
|
||||
image: ${{ matrix.image }}
|
||||
steps:
|
||||
- name: Checkout `mod_tile`
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install Dependencies (Debian)
|
||||
uses: ./.github/actions/apt-get/install
|
||||
with:
|
||||
packages: >-
|
||||
${{ env.debian-build-dependencies }}
|
||||
${{ env.debian-mapnik-build-dependencies }}
|
||||
${{ env.debian-test-dependencies }}
|
||||
if: ${{ startsWith(matrix.image, 'debian:') }}
|
||||
|
||||
- name: Install Dependencies (Ubuntu)
|
||||
uses: ./.github/actions/apt-get/install
|
||||
with:
|
||||
packages: >-
|
||||
${{ env.ubuntu-build-dependencies }}
|
||||
${{ env.ubuntu-mapnik-build-dependencies }}
|
||||
${{ env.ubuntu-test-dependencies }}
|
||||
if: ${{ startsWith(matrix.image, 'ubuntu:') }}
|
||||
|
||||
- name: Checkout `mapnik`
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
path: mapnik
|
||||
repository: mapnik/mapnik
|
||||
submodules: recursive
|
||||
|
||||
- name: Build `mapnik`
|
||||
run: |
|
||||
export CMAKE_BUILD_PARALLEL_LEVEL=${BUILD_PARALLEL_LEVEL:-$(nproc)}
|
||||
cmake -S mapnik -B mapnik-build \
|
||||
-DBUILD_DEMO_VIEWER:BOOL=OFF \
|
||||
-DBUILD_TESTING:BOOL=OFF \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX:PATH=/usr
|
||||
cmake --build mapnik-build
|
||||
|
||||
- name: Install `mapnik`
|
||||
run: cmake --install mapnik-build
|
||||
|
||||
- name: Build `mod_tile`
|
||||
uses: ./.github/actions/build
|
||||
|
||||
- name: Install `mod_tile`
|
||||
uses: ./.github/actions/install
|
||||
|
||||
- name: Configure Apache HTTP Server
|
||||
uses: ./.github/actions/apache/configure
|
||||
|
||||
- name: Test `mod_tile`
|
||||
uses: ./.github/actions/test
|
||||
timeout-minutes: 5
|
||||
|
||||
env:
|
||||
debian-build-dependencies: >-
|
||||
apache2-dev
|
||||
libcairo2-dev
|
||||
libcurl4-gnutls-dev
|
||||
libglib2.0-dev
|
||||
libiniparser-dev
|
||||
libmemcached-dev
|
||||
librados-dev
|
||||
debian-test-dependencies: >-
|
||||
apache2
|
||||
libjs-leaflet
|
||||
debian-mapnik-build-dependencies: >-
|
||||
cmake
|
||||
git
|
||||
libboost-filesystem-dev
|
||||
libboost-program-options-dev
|
||||
libboost-regex-dev
|
||||
libfreetype6-dev
|
||||
libgdal-dev
|
||||
libharfbuzz-dev
|
||||
libicu-dev
|
||||
libjpeg-dev
|
||||
libpq-dev
|
||||
libproj-dev
|
||||
libsqlite3-dev
|
||||
libtiff-dev
|
||||
libwebp-dev
|
||||
libxml2-dev
|
||||
postgresql-server-dev-all
|
||||
ubuntu-build-dependencies: >-
|
||||
apache2-dev
|
||||
libcairo2-dev
|
||||
libcurl4-gnutls-dev
|
||||
libglib2.0-dev
|
||||
libiniparser-dev
|
||||
libmemcached-dev
|
||||
librados-dev
|
||||
ubuntu-test-dependencies: >-
|
||||
apache2
|
||||
libjs-leaflet
|
||||
ubuntu-mapnik-build-dependencies: >-
|
||||
cmake
|
||||
git
|
||||
libboost-filesystem-dev
|
||||
libboost-program-options-dev
|
||||
libboost-regex-dev
|
||||
libfreetype6-dev
|
||||
libgdal-dev
|
||||
libharfbuzz-dev
|
||||
libicu-dev
|
||||
libjpeg-dev
|
||||
libpq-dev
|
||||
libproj-dev
|
||||
libsqlite3-dev
|
||||
libtiff-dev
|
||||
libwebp-dev
|
||||
libxml2-dev
|
||||
postgresql-server-dev-all
|
2
.github/workflows/build-and-test.yml
vendored
2
.github/workflows/build-and-test.yml
vendored
@ -32,7 +32,7 @@ jobs:
|
||||
image: ${{ matrix.image }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install Dependencies (CentOS)
|
||||
uses: ./.github/actions/yum/install
|
||||
|
@ -51,7 +51,11 @@ AC_SEARCH_LIBS(inet_ntoa, nsl)
|
||||
AC_SEARCH_LIBS(gethostbyname, resolv nsl)
|
||||
AC_SEARCH_LIBS(pow,m)
|
||||
AC_SEARCH_LIBS(clock_gettime,[rt posix4])
|
||||
AX_LIB_MAPNIK
|
||||
PKG_CHECK_MODULES([MAPNIK], [libmapnik >= 4], [
|
||||
AC_DEFINE([HAVE_MAPNIK], [1])
|
||||
AC_SUBST([MAPNIK_LDFLAGS], [${MAPNIK_LIBS}])
|
||||
], [AX_LIB_MAPNIK]
|
||||
)
|
||||
AX_ENABLE_LIBMEMCACHED
|
||||
LIBCURL_CHECK_CONFIG
|
||||
AC_CHECK_LIB(rados, rados_version, [
|
||||
|
@ -67,9 +67,13 @@
|
||||
#define box2d Envelope
|
||||
#define zoom_to_box zoomToBox
|
||||
#else
|
||||
#if MAPNIK_VERSION >= 400000
|
||||
#include <mapnik/geometry/box2d.hpp>
|
||||
#else
|
||||
#include <mapnik/box2d.hpp>
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
using namespace mapnik;
|
||||
|
@ -54,8 +54,12 @@
|
||||
#define box2d Envelope
|
||||
#define zoom_to_box zoomToBox
|
||||
#else
|
||||
#if MAPNIK_VERSION >= 400000
|
||||
#include <mapnik/geometry/box2d.hpp>
|
||||
#else
|
||||
#include <mapnik/box2d.hpp>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#define NO_QUEUE_REQUESTS 9
|
||||
|
Reference in New Issue
Block a user