Merge pull request #122610 from tollb/fix/mapnik-3.1.0-missing-proj-and-libxml2-support-20210511b

mapnik: fix missing proj and libxml2 support
This commit is contained in:
Christoph Hrdinka 2021-05-12 09:43:34 +02:00 committed by GitHub
commit 65d339dc38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,18 +23,42 @@ stdenv.mkDerivation rec {
buildInputs = buildInputs =
[ boost cairo freetype gdal harfbuzz icu libjpeg libpng libtiff [ boost cairo freetype gdal harfbuzz icu libjpeg libpng libtiff
libwebp libxml2 proj python sqlite zlib libwebp proj python sqlite zlib
# optional inputs # optional inputs
postgresql postgresql
]; ];
propagatedBuildInputs = [ libxml2 ];
prefixKey = "PREFIX="; prefixKey = "PREFIX=";
preConfigure = '' preConfigure = ''
patchShebangs ./configure patchShebangs ./configure
''; '';
# NOTE: 2021-05-06:
# Add -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H=1 for backwards compatibility
# with major versions 6 and 7 of proj which are otherwise not compatible
# with mapnik 3.1.0. Note that:
#
# 1. Starting with proj version 8, this workaround will no longer be
# supported by the upstream proj project.
#
# 2. Without the workaround, mapnik configures itself without proj support.
#
# 3. The master branch of mapnik (after 3.1.0) appears to add native support
# for the proj 6 api, so this workaround is not likely to be needed in
# subsequent mapnik releases. At that point, this block comment and the
# NIX_CFLAGS_COMPILE expression can be removed.
NIX_CFLAGS_COMPILE =
if version != "3.1.0" && lib.versionAtLeast version "3.1.0"
then throw "The mapnik compatibility workaround for proj 6 may no longer be required. Remove workaround after checking."
else if lib.versionAtLeast (lib.getVersion proj) "8"
then throw ("mapnik currently requires a version of proj less than 8, but proj version is: " + (lib.getVersion proj))
else "-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H=1";
configureFlags = [ configureFlags = [
"BOOST_INCLUDES=${boost.dev}/include" "BOOST_INCLUDES=${boost.dev}/include"
"BOOST_LIBS=${boost.out}/lib" "BOOST_LIBS=${boost.out}/lib"
@ -51,16 +75,19 @@ stdenv.mkDerivation rec {
"JPEG_LIBS=${libjpeg.out}/lib" "JPEG_LIBS=${libjpeg.out}/lib"
"PNG_INCLUDES=${libpng.dev}/include" "PNG_INCLUDES=${libpng.dev}/include"
"PNG_LIBS=${libpng.out}/lib" "PNG_LIBS=${libpng.out}/lib"
"PROJ_INCLUDES=${proj}/include" "PROJ_INCLUDES=${proj.dev}/include"
"PROJ_LIBS=${proj}/lib" "PROJ_LIBS=${proj.out}/lib"
"SQLITE_INCLUDES=${sqlite.dev}/include" "SQLITE_INCLUDES=${sqlite.dev}/include"
"SQLITE_LIBS=${sqlite.out}/lib" "SQLITE_LIBS=${sqlite.out}/lib"
"TIFF_INCLUDES=${libtiff.dev}/include" "TIFF_INCLUDES=${libtiff.dev}/include"
"TIFF_LIBS=${libtiff.out}/lib" "TIFF_LIBS=${libtiff.out}/lib"
"WEBP_INCLUDES=${libwebp}/include" "WEBP_INCLUDES=${libwebp}/include"
"WEBP_LIBS=${libwebp}/lib" "WEBP_LIBS=${libwebp}/lib"
"XML2_INCLUDES=${libxml2.dev}/include" "XMLPARSER=libxml2"
"XML2_LIBS=${libxml2.out}/lib" ];
buildFlags = [
"JOBS=$(NIX_BUILD_CORES)"
]; ];
meta = with lib; { meta = with lib; {