Skip to content

Commit

Permalink
Update PKGBUILD to build forthcoming 4.x release
Browse files Browse the repository at this point in the history
** Changes: **
* Add 3 packages dependencies:
  * Use mapbox-variant rather than submodule
  * Use protozero rather than submodule
  * Use ttf-dejavu rather than bundled fonts
** Patches: **
* mapnik-cmake-harfbuzz.patch based on [this](https://github.com/NixOS/nixpkgs/blob/4cd04c8dbf79b608cfd2274621dd154052dc23ae/pkgs/development/libraries/mapnik/cmake-harfbuzz.patch)
* mapnik-datasource-ogr-test.patch based on [this](mapnik/mapnik#4329)
  • Loading branch information
David Hummel committed Aug 4, 2023
1 parent 9142c91 commit bd2070d
Show file tree
Hide file tree
Showing 6 changed files with 152 additions and 84 deletions.
58 changes: 30 additions & 28 deletions .SRCINFO
Original file line number Diff line number Diff line change
@@ -1,45 +1,47 @@
pkgbase = mapnik-git
pkgdesc = Free Toolkit for developing mapping applications. Above all Mapnik is about rendering beautiful maps (git version)
pkgver = 3.0.22.1073.g94dd75666
pkgver = 4.0.0.g123232ffd
pkgrel = 1
url = http://mapnik.org/
install = mapnik.install
arch = i686
arch = x86_64
license = LGPL
makedepends = scons
license = LGPL2.1
makedepends = boost
makedepends = cmake
makedepends = git
depends = boost-libs
depends = cairo
depends = freetype2
depends = gcc-libs
depends = gdal
depends = glibc
depends = harfbuzz
depends = icu
depends = libjpeg-turbo
depends = libpng
depends = libjpeg
depends = libtiff
depends = freetype2
depends = libwebp
depends = libxml2
depends = python2
depends = proj
depends = cairo
depends = cairomm
depends = python-cairo
depends = mapbox-variant
depends = postgresql-libs
depends = postgis
depends = gdal
depends = curl
depends = libltdl
depends = libwebp
optdepends = libxslt: Web Map Service
optdepends = python2-lxml: Web Map Service
optdepends = python2-pillow: Web Map Service
optdepends = python-nose: Web Map Service
optdepends = apache: Web Map Service
optdepends = mod_fastcgi: Web Map Service - or:
optdepends = mod_fcgid: Web Map Service - or:
optdepends = mod_wsgi2: Web Map Service
provides = mapnik=3.0.22
depends = proj
depends = protozero
depends = python
depends = sqlite
depends = ttf-dejavu
provides = mapnik
conflicts = mapnik
options = staticlibs
source = git://github.com/mapnik/mapnik.git
md5sums = SKIP
source = git+https://github.com/mapnik/mapnik.git
source = mapnik-cmake-harfbuzz.patch
source = mapnik-datasource-ogr-test.patch
source = git+https://github.com/mapnik/test-data.git
source = git+https://github.com/mapbox/geometry.hpp.git
source = git+https://github.com/mapbox/polylabel.git
sha256sums = SKIP
sha256sums = 90f541c0845e3c7005564fa113771ce01cf2bcfd57662b7fa8849aabf4151638
sha256sums = 3fcf178e646df526e9a5c278f56ad16e4f75d2f27108e7b33419649a46b92f52
sha256sums = SKIP
sha256sums = SKIP
sha256sums = SKIP

pkgname = mapnik-git
10 changes: 7 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
mapnik
pkg
*.pkg.tar.xz
/geometry.hpp
/mapnik
/polylabel
/test-data
/pkg
/src
*.zst
118 changes: 76 additions & 42 deletions PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,62 +1,96 @@
# $Id$
# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Contributor: Balló György <ballogyor+arch at gmail dot com>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: David Dent <thewinch@gmail.com>
# Contributor: orbisvicis <orbisvicis@gmail.com>
# Contributor: Fritz Engelbrecht <fritz.engl+arch@gmail.com>
# Maintainer: Fritz Engelbrecht <fritz.engl+arch@gmail.com>
# Maintainer: David Hummel <david dot hummel at gmail point com>

pkgname=mapnik-git
_pkgname=mapnik
pkgver=3.0.22.1073.g94dd75666
pkgver=4.0.0.g123232ffd
pkgrel=1
pkgdesc="Free Toolkit for developing mapping applications. Above all Mapnik is about rendering beautiful maps (git version)"
pkgdesc='Free Toolkit for developing mapping applications. Above all Mapnik is about rendering beautiful maps (git version)'
arch=('i686' 'x86_64')
url="http://mapnik.org/"
license=('LGPL')
depends=('boost-libs' 'icu' 'libpng' 'libjpeg' 'libtiff' 'freetype2'
'libxml2' 'python2' 'proj' 'cairo' 'cairomm' 'python-cairo'
'postgresql-libs' 'postgis' 'gdal' 'curl' 'libltdl' 'libwebp')
optdepends=('libxslt: Web Map Service'
'python2-lxml: Web Map Service'
'python2-pillow: Web Map Service'
'python-nose: Web Map Service'
'apache: Web Map Service'
'mod_fastcgi: Web Map Service - or:'
'mod_fcgid: Web Map Service - or:'
'mod_wsgi2: Web Map Service')
makedepends=('scons' 'boost' 'git')
url='http://mapnik.org/'
license=('LGPL2.1')
depends=('boost-libs'
'cairo'
'freetype2'
'gcc-libs'
'gdal'
'glibc'
'harfbuzz'
'icu'
'libjpeg-turbo'
'libpng'
'libtiff'
'libwebp'
'libxml2'
'mapbox-variant'
'postgresql-libs'
'proj'
'protozero'
'python'
'sqlite'
'ttf-dejavu')
makedepends=('boost' 'cmake' 'git')
conflicts=('mapnik')
provides=('mapnik=3.0.22')
options=(staticlibs)
install="mapnik.install"
source=("git+https://github.com/mapnik/mapnik.git")
md5sums=('SKIP')
provides=('mapnik')
source=('git+https://github.com/mapnik/mapnik.git'
'mapnik-cmake-harfbuzz.patch'
'mapnik-datasource-ogr-test.patch'
'git+https://github.com/mapnik/test-data.git'
'git+https://github.com/mapbox/geometry.hpp.git'
'git+https://github.com/mapbox/polylabel.git')
sha256sums=('SKIP'
'90f541c0845e3c7005564fa113771ce01cf2bcfd57662b7fa8849aabf4151638'
'3fcf178e646df526e9a5c278f56ad16e4f75d2f27108e7b33419649a46b92f52'
'SKIP'
'SKIP'
'SKIP')

pkgver() {
cd "$srcdir/$_pkgname"

echo "3.0.22$(git describe --long | cut -c8- | sed 's/-/./g')"
cd mapnik || exit
printf "4.0.0.%s" "$(git describe --all --long | cut -d- -f3)"
}

prepare() {
cd "$srcdir/$_pkgname"

git submodule update --init deps/mapbox
cd mapnik || exit
patch -Np1 < ../mapnik-cmake-harfbuzz.patch
patch -Np1 < ../mapnik-datasource-ogr-test.patch
git submodule init \
test/data \
deps/mapbox/geometry \
deps/mapbox/polylabel
git config submodule.test/data.url "$srcdir"/test-data
git config submodule.deps/mapbox/geometry.url "$srcdir"/geometry.hpp
git config submodule.deps/mapbox/polylabel.url "$srcdir"/polylabel
git -c protocol.file.allow=always submodule update \
test/data \
deps/mapbox/geometry \
deps/mapbox/polylabel
}

build() {
cd "$srcdir/$_pkgname"

./configure \
PREFIX="/usr" \
INPUT_PLUGINS=all \
DESTDIR="$pkgdir" \
FREETYPE_INCLUDES=/usr/include/freetype2 \
FREETYPE_LIBS=/usr/lib \
CUSTOM_DEFINES="-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H=1"
cmake -B mapnik_build -S mapnik \
-DBUILD_DEMO_VIEWER:BOOL=OFF \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DCMAKE_INSTALL_PREFIX:PATH=/usr \
-DFONTS_INSTALL_DIR:PATH=share/fonts/TTF \
-DUSE_EXTERNAL_MAPBOX_PROTOZERO:BOOL=ON \
-DUSE_EXTERNAL_MAPBOX_VARIANT:BOOL=ON
cmake --build mapnik_build
}

check() {
ctest --output-on-failure --test-dir mapnik_build
}

package(){
cd "$srcdir/$_pkgname"
JOBS=$(nproc) make DESTDIR="$pkgdir" install
DESTDIR="$pkgdir" cmake --install mapnik_build --strip

# License
install -Dm644 "$srcdir"/mapnik/COPYING "$pkgdir"/usr/share/licenses/"$pkgname"/LICENSE

# Remove bundled fonts in favor of those from 'ttf-dejavu'
rm -rf "$pkgdir"/usr/share/fonts
}
26 changes: 26 additions & 0 deletions mapnik-cmake-harfbuzz.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ffb86d4ac..1775b986f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -177,19 +177,8 @@ endif()

mapnik_find_package(Freetype REQUIRED)

-# try to find harfbuzz with the native configuration and fallback to our "own" FindHarfBuzz
-mapnik_find_package(harfbuzz CONFIG QUIET)
-if(harfbuzz_FOUND)
- message(STATUS "Found harfbuzz native cmake")
- list(APPEND MAPNIK_OPTIONAL_LIBS harfbuzz::harfbuzz)
-else()
- # Use pkg-config when harfbuzz is not found.
- # It might be possible that in future version harfbuzz could only be found via pkg-config.
- # harfbuzz related discussion: https://github.com/harfbuzz/harfbuzz/issues/2653
- message(STATUS "harfbuzz not found via cmake. Searching via pkg-config...")
- mapnik_pkg_check_modules(harfbuzz REQUIRED IMPORTED_TARGET harfbuzz>=${HARFBUZZ_MIN_VERSION})
- list(APPEND MAPNIK_OPTIONAL_LIBS PkgConfig::harfbuzz)
-endif()
+mapnik_pkg_check_modules(harfbuzz REQUIRED IMPORTED_TARGET harfbuzz>=${HARFBUZZ_MIN_VERSION})
+list(APPEND MAPNIK_OPTIONAL_LIBS PkgConfig::harfbuzz)

if(USE_EXTERNAL_MAPBOX_GEOMETRY)
# this is used to provide a way to specify include dirs with CACHE VARIABLES
13 changes: 13 additions & 0 deletions mapnik-datasource-ogr-test.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/test/unit/datasource/ogr.cpp b/test/unit/datasource/ogr.cpp
index 8441ecc55..8dabc67b0 100644
--- a/test/unit/datasource/ogr.cpp
+++ b/test/unit/datasource/ogr.cpp
@@ -30,7 +30,7 @@
#include <mapnik/image_util.hpp>
#include <mapnik/datasource_cache.hpp>

-TEST_CASE("ogr")
+TEST_CASE("ogr", "[!shouldfail]")
{
const bool have_ogr_plugin = mapnik::datasource_cache::instance().plugin_registered("ogr");
if (have_ogr_plugin)
11 changes: 0 additions & 11 deletions mapnik.install

This file was deleted.

0 comments on commit bd2070d

Please sign in to comment.