From 1fd239539f1b48485f7dbad854676d752a332d3a Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Sat, 7 Jun 2025 17:25:55 +0000 Subject: [PATCH 1/4] mapnik: 4.0.7 -> 4.1.0 --- pkgs/development/libraries/mapnik/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/mapnik/default.nix b/pkgs/development/libraries/mapnik/default.nix index 3eeec023540e..358903ba9761 100644 --- a/pkgs/development/libraries/mapnik/default.nix +++ b/pkgs/development/libraries/mapnik/default.nix @@ -29,13 +29,13 @@ stdenv.mkDerivation rec { pname = "mapnik"; - version = "4.0.7"; + version = "4.1.0"; src = fetchFromGitHub { owner = "mapnik"; repo = "mapnik"; rev = "v${version}"; - hash = "sha256-gJktRWcJiSGxxjvWFt+Kl9d7g+TOSPk2PfGP0LIVxt4="; + hash = "sha256-EhRMG0xPOGwcRAMQD2B4z7nVlXQf4HFFfL3oUaUfXBY="; fetchSubmodules = true; }; From 5532e97e51da15f4f440907c7080735f417dad0f Mon Sep 17 00:00:00 2001 From: Nikolay Korotkiy Date: Sat, 7 Jun 2025 23:28:16 +0400 Subject: [PATCH 2/4] mapnik: modernize --- pkgs/development/libraries/mapnik/default.nix | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/pkgs/development/libraries/mapnik/default.nix b/pkgs/development/libraries/mapnik/default.nix index 358903ba9761..f6e1270402f3 100644 --- a/pkgs/development/libraries/mapnik/default.nix +++ b/pkgs/development/libraries/mapnik/default.nix @@ -27,14 +27,14 @@ sparsehash, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "mapnik"; version = "4.1.0"; src = fetchFromGitHub { owner = "mapnik"; repo = "mapnik"; - rev = "v${version}"; + tag = "v${finalAttrs.version}"; hash = "sha256-EhRMG0xPOGwcRAMQD2B4z7nVlXQf4HFFfL3oUaUfXBY="; fetchSubmodules = true; }; @@ -47,6 +47,8 @@ stdenv.mkDerivation rec { rm -r scons # Remove bundled 'sparsehash' directory in favor of 'sparsehash' package rm -r deps/mapnik/sparsehash + # Remove bundled 'protozero' directory in favor of 'protozero' package + rm -r deps/mapbox/protozero ''; # a distinct dev output makes python-mapnik fail @@ -118,19 +120,19 @@ stdenv.mkDerivation rec { ''; preInstall = '' - mkdir -p $out/bin - cp ../utils/mapnik-config/mapnik-config $out/bin/mapnik-config + install -Dm755 ../utils/mapnik-config/mapnik-config -t $out/bin ''; - meta = with lib; { + meta = { description = "Open source toolkit for developing mapping applications"; homepage = "https://mapnik.org"; - maintainers = with maintainers; [ + changelog = "https://github.com/mapnik/mapnik/blob/${finalAttrs.src.tag}/CHANGELOG.md"; + maintainers = with lib.maintainers; [ hrdinka hummeltech ]; - teams = [ teams.geospatial ]; - license = licenses.lgpl21Plus; - platforms = platforms.all; + teams = [ lib.teams.geospatial ]; + license = lib.licenses.lgpl21Plus; + platforms = lib.platforms.all; }; -} +}) From 04ee58b6174f62c6e7e32edee41450af98333e5b Mon Sep 17 00:00:00 2001 From: Nikolay Korotkiy Date: Sat, 7 Jun 2025 23:44:07 +0400 Subject: [PATCH 3/4] mapnik: migrate to by-name --- .../libraries => by-name/ma}/mapnik/cmake-harfbuzz.patch | 0 .../ma}/mapnik/export-pkg-config-full-paths.patch | 0 .../mapnik/default.nix => by-name/ma/mapnik/package.nix} | 2 +- .../ma}/mapnik/use-sparsehash-package.patch | 0 pkgs/top-level/all-packages.nix | 6 ------ 5 files changed, 1 insertion(+), 7 deletions(-) rename pkgs/{development/libraries => by-name/ma}/mapnik/cmake-harfbuzz.patch (100%) rename pkgs/{development/libraries => by-name/ma}/mapnik/export-pkg-config-full-paths.patch (100%) rename pkgs/{development/libraries/mapnik/default.nix => by-name/ma/mapnik/package.nix} (98%) rename pkgs/{development/libraries => by-name/ma}/mapnik/use-sparsehash-package.patch (100%) diff --git a/pkgs/development/libraries/mapnik/cmake-harfbuzz.patch b/pkgs/by-name/ma/mapnik/cmake-harfbuzz.patch similarity index 100% rename from pkgs/development/libraries/mapnik/cmake-harfbuzz.patch rename to pkgs/by-name/ma/mapnik/cmake-harfbuzz.patch diff --git a/pkgs/development/libraries/mapnik/export-pkg-config-full-paths.patch b/pkgs/by-name/ma/mapnik/export-pkg-config-full-paths.patch similarity index 100% rename from pkgs/development/libraries/mapnik/export-pkg-config-full-paths.patch rename to pkgs/by-name/ma/mapnik/export-pkg-config-full-paths.patch diff --git a/pkgs/development/libraries/mapnik/default.nix b/pkgs/by-name/ma/mapnik/package.nix similarity index 98% rename from pkgs/development/libraries/mapnik/default.nix rename to pkgs/by-name/ma/mapnik/package.nix index f6e1270402f3..79a043b36e98 100644 --- a/pkgs/development/libraries/mapnik/default.nix +++ b/pkgs/by-name/ma/mapnik/package.nix @@ -77,7 +77,7 @@ stdenv.mkDerivation (finalAttrs: { cairo freetype gdal - harfbuzz + (harfbuzz.override { withIcu = true; }) icu libjpeg libpng diff --git a/pkgs/development/libraries/mapnik/use-sparsehash-package.patch b/pkgs/by-name/ma/mapnik/use-sparsehash-package.patch similarity index 100% rename from pkgs/development/libraries/mapnik/use-sparsehash-package.patch rename to pkgs/by-name/ma/mapnik/use-sparsehash-package.patch diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b20f87db9d05..36cac85f493f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9001,12 +9001,6 @@ with pkgs; asciidoc = asciidoc-full; }; - mapnik = callPackage ../development/libraries/mapnik { - harfbuzz = harfbuzz.override { - withIcu = true; - }; - }; - matterhorn = # TODO: Erroneous references to GHC on aarch64-darwin: https://github.com/NixOS/nixpkgs/issues/318013 ( From 38839a0aba3250c63e8a392ca9c34c23494da9a4 Mon Sep 17 00:00:00 2001 From: Nikolay Korotkiy Date: Sat, 7 Jun 2025 23:50:27 +0400 Subject: [PATCH 4/4] mapnik: drop cmake-harfbuzz.patch --- pkgs/by-name/ma/mapnik/cmake-harfbuzz.patch | 26 --------------------- pkgs/by-name/ma/mapnik/package.nix | 8 ++----- 2 files changed, 2 insertions(+), 32 deletions(-) delete mode 100644 pkgs/by-name/ma/mapnik/cmake-harfbuzz.patch diff --git a/pkgs/by-name/ma/mapnik/cmake-harfbuzz.patch b/pkgs/by-name/ma/mapnik/cmake-harfbuzz.patch deleted file mode 100644 index aa08f351aa69..000000000000 --- a/pkgs/by-name/ma/mapnik/cmake-harfbuzz.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index ffb86d4ac..1775b986f 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -177,19 +177,8 @@ endif() - - mapnik_find_package(Freetype REQUIRED) - --# try to find harfbuzz with the native configuration and fallback to our "own" FindHarfBuzz --mapnik_find_package(harfbuzz CONFIG QUIET) --if(harfbuzz_FOUND) -- message(STATUS "Found harfbuzz native cmake") -- list(APPEND MAPNIK_OPTIONAL_LIBS harfbuzz::harfbuzz) --else() -- # Use pkg-config when harfbuzz is not found. -- # 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...") -- 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) -+list(APPEND MAPNIK_OPTIONAL_LIBS PkgConfig::harfbuzz) - - if(USE_EXTERNAL_MAPBOX_GEOMETRY) - # this is used to provide a way to specify include dirs with CACHE VARIABLES diff --git a/pkgs/by-name/ma/mapnik/package.nix b/pkgs/by-name/ma/mapnik/package.nix index 79a043b36e98..9410c72ebad3 100644 --- a/pkgs/by-name/ma/mapnik/package.nix +++ b/pkgs/by-name/ma/mapnik/package.nix @@ -55,12 +55,6 @@ stdenv.mkDerivation (finalAttrs: { outputs = [ "out" ]; 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 # Account for full paths when generating libmapnik.pc ./export-pkg-config-full-paths.patch # Use 'sparsehash' package. @@ -99,6 +93,8 @@ stdenv.mkDerivation (finalAttrs: { (lib.cmakeBool "BUILD_DEMO_CPP" false) ## Would require QT otherwise. (lib.cmakeBool "BUILD_DEMO_VIEWER" false) + # disable the find_package call and force pkg-config, see https://github.com/mapnik/mapnik/pull/4270 + (lib.cmakeBool "CMAKE_DISABLE_FIND_PACKAGE_harfbuzz" true) # Use 'protozero' package. (lib.cmakeBool "USE_EXTERNAL_MAPBOX_PROTOZERO" true) # macOS builds fail when using memory mapped file cache.