From ec27bb35e329cdc10dd8c87fd9ccc1735e6bed08 Mon Sep 17 00:00:00 2001 From: Paul Dettorer Hervot Date: Sat, 13 May 2023 20:15:18 +0200 Subject: [PATCH 1/3] python310Packages.python-mapnik: disable the OGR test The OGR test fails since a gdal update at af10ec1c5b7af7106a5b5ea2b633275d549d7e8c. Upstream tests are still considered unreliable according to https://github.com/mapnik/python-mapnik/issues/255. --- pkgs/development/python-modules/python-mapnik/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/python-modules/python-mapnik/default.nix b/pkgs/development/python-modules/python-mapnik/default.nix index 18df3e4d5655..b682c719c2e4 100644 --- a/pkgs/development/python-modules/python-mapnik/default.nix +++ b/pkgs/development/python-modules/python-mapnik/default.nix @@ -106,6 +106,7 @@ buildPythonPackage rec { "test_compare_map" "test_dataraster_coloring" "test_dataraster_query_point" + "test_geometry_type" "test_good_files" "test_layer_init" "test_load_save_map" From 843f13924b0f891153602abf9d58d85a7d9c9d6f Mon Sep 17 00:00:00 2001 From: Paul Dettorer Hervot Date: Sat, 13 May 2023 22:07:07 +0200 Subject: [PATCH 2/3] python311Packages.python-mapnik: use boost182 instead of the default The import checks didn't pass because of a boost binding problem solved by https://github.com/boostorg/python/pull/385. --- pkgs/development/python-modules/python-mapnik/default.nix | 4 ++-- pkgs/top-level/python-packages.nix | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/python-mapnik/default.nix b/pkgs/development/python-modules/python-mapnik/default.nix index b682c719c2e4..cc545b391aa4 100644 --- a/pkgs/development/python-modules/python-mapnik/default.nix +++ b/pkgs/development/python-modules/python-mapnik/default.nix @@ -8,7 +8,7 @@ , pillow , pycairo , pkg-config -, boost +, boost182 , cairo , harfbuzz , icu @@ -60,7 +60,7 @@ buildPythonPackage rec { buildInputs = [ mapnik - boost + boost182 cairo harfbuzz icu diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 09bbff4034be..b404baf500a1 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -9753,7 +9753,7 @@ self: super: with self; { python-mapnik = callPackage ../development/python-modules/python-mapnik rec { inherit (pkgs) pkg-config cairo icu libjpeg libpng libtiff libwebp proj zlib; - boost = pkgs.boost.override { + boost182 = pkgs.boost182.override { enablePython = true; inherit python; }; From cfe4464d7e8cf2f67fd6c8d3c3b534de75d676c1 Mon Sep 17 00:00:00 2001 From: Paul Dettorer Hervot Date: Sun, 14 May 2023 14:56:56 +0200 Subject: [PATCH 3/3] python3Packages.python-mapnik: fix tests on darwin - replace the hardcoded references to /tmp with $TMPDIR - disable a PDF-related cairo test --- pkgs/development/python-modules/python-mapnik/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/development/python-modules/python-mapnik/default.nix b/pkgs/development/python-modules/python-mapnik/default.nix index cc545b391aa4..a6e42d2369b6 100644 --- a/pkgs/development/python-modules/python-mapnik/default.nix +++ b/pkgs/development/python-modules/python-mapnik/default.nix @@ -23,6 +23,7 @@ , sqlite , nose , pytestCheckHook +, stdenv }: buildPythonPackage rec { @@ -98,6 +99,9 @@ buildPythonPackage rec { preCheck = '' # import from $out rm -r mapnik + '' + lib.optionalString stdenv.isDarwin '' + # Replace the hardcoded /tmp references with $TMPDIR + sed -i "s,/tmp,$TMPDIR,g" test/python_tests/*.py ''; # https://github.com/mapnik/python-mapnik/issues/255 @@ -129,6 +133,8 @@ buildPythonPackage rec { "test_visual_zoom_all_rendering1" "test_visual_zoom_all_rendering2" "test_wgs84_inverse_forward" + ] ++ lib.optional stdenv.isDarwin [ + "test_passing_pycairo_context_pdf" ]; pythonImportsCheck = [ "mapnik" ];