about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/mapnik
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-06-22 15:01:47 +0000
committerAlyssa Ross <hi@alyssa.is>2021-06-22 16:57:59 +0000
commit633cab0ecb07627706c6b523e219490f019eaab5 (patch)
tree4fb472bdfe2723037dad53dc1b8a87c939015f5e /nixpkgs/pkgs/development/libraries/mapnik
parentffb691c199e7e0cbc4e45e5310779c9e3f7c2a73 (diff)
parent432fc2d9a67f92e05438dff5fdc2b39d33f77997 (diff)
downloadnixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar
nixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar.gz
nixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar.bz2
nixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar.lz
nixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar.xz
nixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar.zst
nixlib-633cab0ecb07627706c6b523e219490f019eaab5.zip
Merge commit '432fc2d9a67f92e05438dff5fdc2b39d33f77997'
# Conflicts:
#	nixpkgs/pkgs/applications/editors/emacs/elisp-packages/elpa-generated.nix
#	nixpkgs/pkgs/applications/networking/mailreaders/thunderbird/default.nix
#	nixpkgs/pkgs/applications/window-managers/sway/default.nix
#	nixpkgs/pkgs/build-support/rust/default.nix
#	nixpkgs/pkgs/development/go-modules/generic/default.nix
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/mapnik')
-rw-r--r--nixpkgs/pkgs/development/libraries/mapnik/default.nix37
1 files changed, 32 insertions, 5 deletions
diff --git a/nixpkgs/pkgs/development/libraries/mapnik/default.nix b/nixpkgs/pkgs/development/libraries/mapnik/default.nix
index d4f11c1d126a..45d5e0a40eb0 100644
--- a/nixpkgs/pkgs/development/libraries/mapnik/default.nix
+++ b/nixpkgs/pkgs/development/libraries/mapnik/default.nix
@@ -23,18 +23,42 @@ stdenv.mkDerivation rec {
 
   buildInputs =
     [ boost cairo freetype gdal harfbuzz icu libjpeg libpng libtiff
-      libwebp libxml2 proj python sqlite zlib
+      libwebp proj python sqlite zlib
 
       # optional inputs
       postgresql
     ];
 
+  propagatedBuildInputs = [ libxml2 ];
+
   prefixKey = "PREFIX=";
 
   preConfigure = ''
     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 = [
     "BOOST_INCLUDES=${boost.dev}/include"
     "BOOST_LIBS=${boost.out}/lib"
@@ -51,16 +75,19 @@ stdenv.mkDerivation rec {
     "JPEG_LIBS=${libjpeg.out}/lib"
     "PNG_INCLUDES=${libpng.dev}/include"
     "PNG_LIBS=${libpng.out}/lib"
-    "PROJ_INCLUDES=${proj}/include"
-    "PROJ_LIBS=${proj}/lib"
+    "PROJ_INCLUDES=${proj.dev}/include"
+    "PROJ_LIBS=${proj.out}/lib"
     "SQLITE_INCLUDES=${sqlite.dev}/include"
     "SQLITE_LIBS=${sqlite.out}/lib"
     "TIFF_INCLUDES=${libtiff.dev}/include"
     "TIFF_LIBS=${libtiff.out}/lib"
     "WEBP_INCLUDES=${libwebp}/include"
     "WEBP_LIBS=${libwebp}/lib"
-    "XML2_INCLUDES=${libxml2.dev}/include"
-    "XML2_LIBS=${libxml2.out}/lib"
+    "XMLPARSER=libxml2"
+  ];
+
+  buildFlags = [
+    "JOBS=$(NIX_BUILD_CORES)"
   ];
 
   meta = with lib; {