From dfa2fbc087bdc942ab8a7693e0c0589759ac18b6 Mon Sep 17 00:00:00 2001 From: David Hummel <6109326+hummeltech@users.noreply.github.com> Date: Tue, 26 Dec 2023 12:48:47 -0700 Subject: [PATCH 1/5] mapnik: unstable-2022-10-18 -> unstable-2023-11-28 Removed no-longer-needed patch: * `include.patch`: Fixed [here](https://github.com/mapnik/mapnik/commit/64a031a19bd8f77eb6f3cc7ee64839e9e7770332) Added patch to account for `FONTS_INSTALL_DIR`/`PLUGINS_INSTALL_DIR` containing full paths, causing this issue: ``` Broken paths found in a .pc file! /nix/store/lriysmfydb9p6g6s02q6ri24nzwmi494-mapnik-unstable-2023-11-28/lib/pkgconfig/libmapnik.pc The following lines have issues (specifically '//' in paths). 5:fonts_dir=${prefix}//nix/store/lriysmfydb9p6g6s02q6ri24nzwmi494-mapnik-unstable-2023-11-28/lib/mapnik/fonts 6:plugins_dir=${prefix}//nix/store/lriysmfydb9p6g6s02q6ri24nzwmi494-mapnik-unstable-2023-11-28/lib/mapnik/input ``` Enabled `Checks`, which requires a patch to allow one test to fail: * `datasource-ogr-test-should-fail.patch` --- .../libraries/mapnik/cmake-harfbuzz.patch | 6 +++--- .../mapnik/datasource-ogr-test-should-fail.patch | 13 +++++++++++++ pkgs/development/libraries/mapnik/default.nix | 16 +++++++++++----- .../mapnik/export-pkg-config-full-paths.patch | 15 +++++++++++++++ pkgs/development/libraries/mapnik/include.patch | 11 ----------- 5 files changed, 42 insertions(+), 19 deletions(-) create mode 100644 pkgs/development/libraries/mapnik/datasource-ogr-test-should-fail.patch create mode 100644 pkgs/development/libraries/mapnik/export-pkg-config-full-paths.patch delete mode 100644 pkgs/development/libraries/mapnik/include.patch diff --git a/pkgs/development/libraries/mapnik/cmake-harfbuzz.patch b/pkgs/development/libraries/mapnik/cmake-harfbuzz.patch index 1d5ca6903d0b1..aa08f351aa69d 100644 --- a/pkgs/development/libraries/mapnik/cmake-harfbuzz.patch +++ b/pkgs/development/libraries/mapnik/cmake-harfbuzz.patch @@ -1,8 +1,8 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index d87a7052d..837867551 100644 +index ffb86d4ac..1775b986f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -153,19 +153,8 @@ endif() +@@ -177,19 +177,8 @@ endif() mapnik_find_package(Freetype REQUIRED) @@ -16,7 +16,7 @@ index d87a7052d..837867551 100644 - # 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...") -- pkg_check_modules(harfbuzz REQUIRED IMPORTED_TARGET harfbuzz>=${HARFBUZZ_MIN_VERSION}) +- mapnik_pkg_check_modules(harfbuzz REQUIRED IMPORTED_TARGET harfbuzz>=${HARFBUZZ_MIN_VERSION}) - list(APPEND MAPNIK_OPTIONAL_LIBS PkgConfig::harfbuzz) -endif() +pkg_check_modules(harfbuzz REQUIRED IMPORTED_TARGET harfbuzz) diff --git a/pkgs/development/libraries/mapnik/datasource-ogr-test-should-fail.patch b/pkgs/development/libraries/mapnik/datasource-ogr-test-should-fail.patch new file mode 100644 index 0000000000000..1df64216d20b3 --- /dev/null +++ b/pkgs/development/libraries/mapnik/datasource-ogr-test-should-fail.patch @@ -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 + #include + +-TEST_CASE("ogr") ++TEST_CASE("ogr", "[!shouldfail]") + { + const bool have_ogr_plugin = mapnik::datasource_cache::instance().plugin_registered("ogr"); + if (have_ogr_plugin) diff --git a/pkgs/development/libraries/mapnik/default.nix b/pkgs/development/libraries/mapnik/default.nix index 8d0f5565947b8..e220dd408a22d 100644 --- a/pkgs/development/libraries/mapnik/default.nix +++ b/pkgs/development/libraries/mapnik/default.nix @@ -26,13 +26,13 @@ stdenv.mkDerivation rec { pname = "mapnik"; - version = "unstable-2022-10-18"; + version = "unstable-2023-11-28"; src = fetchFromGitHub { owner = "mapnik"; repo = "mapnik"; - rev = "05661e54392bcbb3367747f97a3ef6e468c105ba"; - hash = "sha256-96AneLPH1gbh/u880Pdc9OdFq2MniSdaTJoKYqId7sw="; + rev = "2e1b32512b1f8b52331994f2a809d8a383c0c984"; + hash = "sha256-qGdUfu6gFWum/Id/W3ICeGZroMQ3Tz9PQf1tt+gaaXM="; fetchSubmodules = true; }; @@ -57,7 +57,11 @@ stdenv.mkDerivation rec { src = ./catch2-src.patch; catch2_src = catch2.src; }) - ./include.patch + # 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 ]; nativeBuildInputs = [ cmake pkg-config ]; @@ -83,9 +87,11 @@ stdenv.mkDerivation rec { cmakeFlags = [ # Would require qt otherwise. - "-DBUILD_DEMO_VIEWER=OFF" + "-DBUILD_DEMO_VIEWER:BOOL=OFF" ]; + doCheck = true; + # 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. diff --git a/pkgs/development/libraries/mapnik/export-pkg-config-full-paths.patch b/pkgs/development/libraries/mapnik/export-pkg-config-full-paths.patch new file mode 100644 index 0000000000000..ec80423689d3b --- /dev/null +++ b/pkgs/development/libraries/mapnik/export-pkg-config-full-paths.patch @@ -0,0 +1,15 @@ +diff --git a/cmake/MapnikExportPkgConfig.cmake b/cmake/MapnikExportPkgConfig.cmake +index e459f80ef..ec18a71a2 100644 +--- a/cmake/MapnikExportPkgConfig.cmake ++++ b/cmake/MapnikExportPkgConfig.cmake +@@ -65,8 +65,8 @@ prefix=@CMAKE_INSTALL_PREFIX@ + exec_prefix=${prefix} + includedir=${prefix}/include + libdir=${exec_prefix}/lib +-fonts_dir=${prefix}/@FONTS_INSTALL_DIR@ +-plugins_dir=${prefix}/@PLUGINS_INSTALL_DIR@ ++fonts_dir=@FONTS_INSTALL_DIR@ ++plugins_dir=@PLUGINS_INSTALL_DIR@ + + Name: @_lib_name@ + Description: @_description@ diff --git a/pkgs/development/libraries/mapnik/include.patch b/pkgs/development/libraries/mapnik/include.patch deleted file mode 100644 index e13f4a43cbcb5..0000000000000 --- a/pkgs/development/libraries/mapnik/include.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff --git a/benchmark/src/test_png_encoding2.cpp b/benchmark/src/test_png_encoding2.cpp -index 19897d180..5791b139c 100644 ---- a/benchmark/src/test_png_encoding2.cpp -+++ b/benchmark/src/test_png_encoding2.cpp -@@ -1,5 +1,6 @@ - #include "bench_framework.hpp" - #include "compare_images.hpp" -+#include - - class test : public benchmark::test_case - { From c63948b8f24e4a25e723c53d443b3d6d4e8a6b0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Fri, 29 Dec 2023 01:43:06 -0800 Subject: [PATCH 2/5] python311Packages.python-mapnik: use consistent version of boost --- 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 d887e0c3ae836..6e3717109ef30 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 -, boost182 +, boost , cairo , harfbuzz , icu @@ -62,7 +62,7 @@ buildPythonPackage rec { buildInputs = [ mapnik - boost182 + boost cairo harfbuzz icu diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 3f42299fb5368..89ad3bf6cd31c 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -11733,7 +11733,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; - boost182 = pkgs.boost182.override { + boost = pkgs.boost182.override { enablePython = true; inherit python; }; From a3323fa2c5292bb164f79c7932f8d2e7b225ceb4 Mon Sep 17 00:00:00 2001 From: David Hummel <6109326+hummeltech@users.noreply.github.com> Date: Sun, 31 Dec 2023 22:40:11 -0700 Subject: [PATCH 3/5] python311Packages.python-mapnik: unstable-2020-09-08 -> unstable-2023-02-23 --- .../python-modules/python-mapnik/default.nix | 41 ++++--------------- .../find-pycairo-with-pkg-config.patch | 18 -------- 2 files changed, 8 insertions(+), 51 deletions(-) delete mode 100644 pkgs/development/python-modules/python-mapnik/find-pycairo-with-pkg-config.patch diff --git a/pkgs/development/python-modules/python-mapnik/default.nix b/pkgs/development/python-modules/python-mapnik/default.nix index 6e3717109ef30..044199f6c2a66 100644 --- a/pkgs/development/python-modules/python-mapnik/default.nix +++ b/pkgs/development/python-modules/python-mapnik/default.nix @@ -28,25 +28,21 @@ buildPythonPackage rec { pname = "python-mapnik"; - version = "unstable-2020-09-08"; + version = "unstable-2023-02-23"; format = "setuptools"; src = fetchFromGitHub { owner = "mapnik"; repo = "python-mapnik"; - rev = "a2c2a86eec954b42d7f00093da03807d0834b1b4"; - hash = "sha256-GwDdrutJOHtW7pIWiUAiu1xucmRvp7YFYB3YSCrDsrY="; + # Use proj6 branch in order to support Proj >= 6 (excluding commits after 2023-02-23) + # https://github.com/mapnik/python-mapnik/compare/master...proj6 + rev = "687b2c72a24c59d701d62e4458c380f8c54f0549"; + hash = "sha256-q3Snd3K/JndckwAVwSKU+kFK5E1uph78ty7mwVo/7Ik="; # Only needed for test data fetchSubmodules = true; }; patches = [ - # https://github.com/mapnik/python-mapnik/issues/239 - (fetchpatch { - url = "https://github.com/koordinates/python-mapnik/commit/318b1edac16f48a7f21902c192c1dd86f6210a44.patch"; - hash = "sha256-cfU8ZqPPGCqoHEyGvJ8Xy/bGpbN2vSDct6A3N5+I8xM="; - }) - ./find-pycairo-with-pkg-config.patch # python-mapnik seems to depend on having the mapnik src directory # structure available at build time. We just hardcode the paths. (substituteAll { @@ -107,36 +103,15 @@ buildPythonPackage rec { # https://github.com/mapnik/python-mapnik/issues/255 disabledTests = [ - "test_adding_datasource_to_layer" - "test_compare_map" - "test_dataraster_coloring" - "test_dataraster_query_point" "test_geometry_type" - "test_good_files" - "test_layer_init" - "test_load_save_map" - "test_loading_fontset_from_map" + "test_marker_ellipse_render1" + "test_marker_ellipse_render2" "test_normalizing_definition" + "test_passing_pycairo_context_pdf" "test_pdf_printing" - "test_proj_antimeridian_bbox" - "test_proj_transform_between_init_and_literal" - "test_pycairo_pdf_surface1" - "test_pycairo_svg_surface1" - "test_query_tolerance" - "test_raster_warping" - "test_raster_warping_does_not_overclip_source" - "test_render_points" - "test_render_with_scale_factor" - "test_style_level_comp_op" - "test_style_level_image_filter" - "test_that_coordinates_do_not_overflow_and_polygon_is_rendered_csv" - "test_that_coordinates_do_not_overflow_and_polygon_is_rendered_memory" - "test_transparency_levels" - "test_visual_zoom_all_rendering1" "test_visual_zoom_all_rendering2" "test_wgs84_inverse_forward" ] ++ lib.optionals stdenv.isDarwin [ - "test_passing_pycairo_context_pdf" "test_passing_pycairo_context_svg" ]; diff --git a/pkgs/development/python-modules/python-mapnik/find-pycairo-with-pkg-config.patch b/pkgs/development/python-modules/python-mapnik/find-pycairo-with-pkg-config.patch deleted file mode 100644 index 1f35af36ee82c..0000000000000 --- a/pkgs/development/python-modules/python-mapnik/find-pycairo-with-pkg-config.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/setup.py b/setup.py -index 82a31d733..1c876a553 100755 ---- a/setup.py -+++ b/setup.py -@@ -228,10 +228,9 @@ extra_comp_args = list(filter(lambda arg: arg != "-fvisibility=hidden", extra_co - if os.environ.get("PYCAIRO", "false") == "true": - try: - extra_comp_args.append('-DHAVE_PYCAIRO') -- print("-I%s/include/pycairo".format(sys.exec_prefix)) -- extra_comp_args.append("-I{0}/include/pycairo".format(sys.exec_prefix)) -- #extra_comp_args.extend(check_output(["pkg-config", '--cflags', 'pycairo']).strip().split(' ')) -- #linkflags.extend(check_output(["pkg-config", '--libs', 'pycairo']).strip().split(' ')) -+ pycairo_name = 'py3cairo' if PYTHON3 else 'pycairo' -+ extra_comp_args.extend(check_output(["pkg-config", '--cflags', pycairo_name]).strip().split(' ')) -+ linkflags.extend(check_output(["pkg-config", '--libs', pycairo_name]).strip().split(' ')) - except: - raise Exception("Failed to find compiler options for pycairo") - From ebe162ff1ab4a663dde1f670184bbcbf9af59b87 Mon Sep 17 00:00:00 2001 From: David Hummel <6109326+hummeltech@users.noreply.github.com> Date: Mon, 1 Jan 2024 21:33:09 -0700 Subject: [PATCH 4/5] maintainers: add hummeltech --- maintainers/maintainer-list.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 58bb5cbd2ad22..b413caba41b72 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -7608,6 +7608,12 @@ githubId = 51334444; name = "Akshat Agarwal"; }; + hummeltech = { + email = "hummeltech2024@gmail.com"; + github = "hummeltech"; + githubId = 6109326; + name = "David Hummel"; + }; huyngo = { email = "huyngo@disroot.org"; github = "Huy-Ngo"; From cda679ef0cd4873e2f9c1e985087573a4dad987d Mon Sep 17 00:00:00 2001 From: David Hummel <6109326+hummeltech@users.noreply.github.com> Date: Mon, 1 Jan 2024 21:34:37 -0700 Subject: [PATCH 5/5] mapnik: add hummeltech as maintainer --- pkgs/development/libraries/mapnik/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/mapnik/default.nix b/pkgs/development/libraries/mapnik/default.nix index e220dd408a22d..14ecb984da59b 100644 --- a/pkgs/development/libraries/mapnik/default.nix +++ b/pkgs/development/libraries/mapnik/default.nix @@ -109,7 +109,7 @@ stdenv.mkDerivation rec { meta = with lib; { description = "An open source toolkit for developing mapping applications"; homepage = "https://mapnik.org"; - maintainers = with maintainers; [ hrdinka ]; + maintainers = with maintainers; [ hrdinka hummeltech ]; license = licenses.lgpl21Plus; platforms = platforms.all; };