2022-11-21 17:40:18 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, buildPackages
|
|
|
|
, cmake
|
|
|
|
, pkg-config
|
|
|
|
, substituteAll
|
|
|
|
, boost
|
|
|
|
, cairo
|
|
|
|
, freetype
|
|
|
|
, gdal
|
|
|
|
, harfbuzz
|
|
|
|
, icu
|
|
|
|
, libjpeg
|
|
|
|
, libpng
|
|
|
|
, libtiff
|
|
|
|
, libwebp
|
|
|
|
, libxml2
|
|
|
|
, proj
|
|
|
|
, python3
|
|
|
|
, sqlite
|
|
|
|
, zlib
|
|
|
|
, catch2
|
|
|
|
, postgresql
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "mapnik";
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "unstable-2023-11-28";
|
2022-11-21 17:40:18 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mapnik";
|
|
|
|
repo = "mapnik";
|
2024-01-13 08:15:51 +00:00
|
|
|
rev = "2e1b32512b1f8b52331994f2a809d8a383c0c984";
|
|
|
|
hash = "sha256-qGdUfu6gFWum/Id/W3ICeGZroMQ3Tz9PQf1tt+gaaXM=";
|
2022-11-21 17:40:18 +00:00
|
|
|
fetchSubmodules = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace configure \
|
2022-11-21 17:40:18 +00:00
|
|
|
--replace '$PYTHON scons/scons.py' ${buildPackages.scons}/bin/scons
|
2022-06-26 10:26:21 +00:00
|
|
|
rm -r scons
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# a distinct dev output makes python-mapnik fail
|
|
|
|
outputs = [ "out" ];
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
patches = [
|
|
|
|
# The lib/cmake/harfbuzz/harfbuzz-config.cmake file in harfbuzz.dev is faulty,
|
|
|
|
# as it provides the wrong libdir. The workaround is to just rely on
|
|
|
|
# pkg-config to locate harfbuzz shared object files.
|
|
|
|
# Upstream HarfBuzz wants to drop CMake support anyway.
|
|
|
|
# See discussion: https://github.com/mapnik/mapnik/issues/4265
|
|
|
|
./cmake-harfbuzz.patch
|
|
|
|
# prevent CMake from trying to get libraries on the Internet
|
|
|
|
(substituteAll {
|
|
|
|
src = ./catch2-src.patch;
|
|
|
|
catch2_src = catch2.src;
|
|
|
|
})
|
2024-01-13 08:15:51 +00:00
|
|
|
# Disable broken test
|
|
|
|
# See discussion: https://github.com/mapnik/mapnik/issues/4329#issuecomment-1248778398
|
|
|
|
./datasource-ogr-test-should-fail.patch
|
|
|
|
# Account for full paths when generating libmapnik.pc
|
|
|
|
./export-pkg-config-full-paths.patch
|
2022-11-21 17:40:18 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
buildInputs = [
|
|
|
|
boost
|
|
|
|
cairo
|
|
|
|
freetype
|
|
|
|
gdal
|
|
|
|
harfbuzz
|
|
|
|
icu
|
|
|
|
libjpeg
|
|
|
|
libpng
|
|
|
|
libtiff
|
|
|
|
libwebp
|
|
|
|
proj
|
|
|
|
python3
|
|
|
|
sqlite
|
|
|
|
zlib
|
|
|
|
libxml2
|
2021-08-05 21:33:18 +00:00
|
|
|
postgresql
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
# Would require qt otherwise.
|
2024-01-13 08:15:51 +00:00
|
|
|
"-DBUILD_DEMO_VIEWER:BOOL=OFF"
|
2022-11-21 17:40:18 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
# mapnik-config is currently not build with CMake. So we use the SCons for
|
|
|
|
# this one. We can't add SCons to nativeBuildInputs though, as stdenv would
|
|
|
|
# then try to build everything with scons.
|
|
|
|
preBuild = ''
|
|
|
|
cd ..
|
|
|
|
${buildPackages.scons}/bin/scons utils/mapnik-config
|
|
|
|
cd build
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
preInstall = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp ../utils/mapnik-config/mapnik-config $out/bin/mapnik-config
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "An open source toolkit for developing mapping applications";
|
|
|
|
homepage = "https://mapnik.org";
|
2024-01-13 08:15:51 +00:00
|
|
|
maintainers = with maintainers; [ hrdinka hummeltech ];
|
2022-11-21 17:40:18 +00:00
|
|
|
license = licenses.lgpl21Plus;
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|