From f8b2809cc50ceb5eb3bfe52d53d82671d07f3c45 Mon Sep 17 00:00:00 2001 From: Augustin Trancart Date: Sun, 28 Sep 2025 16:13:09 +0200 Subject: [PATCH 1/2] mapnik: 4.1.1 -> 4.1.2 --- pkgs/by-name/ma/mapnik/package.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/ma/mapnik/package.nix b/pkgs/by-name/ma/mapnik/package.nix index 974fa8c03a9a..1c96078be752 100644 --- a/pkgs/by-name/ma/mapnik/package.nix +++ b/pkgs/by-name/ma/mapnik/package.nix @@ -12,6 +12,7 @@ gdal, harfbuzz, icu, + libavif, libjpeg, libpng, libtiff, @@ -25,17 +26,18 @@ libpq, protozero, sparsehash, + openssl, }: stdenv.mkDerivation (finalAttrs: { pname = "mapnik"; - version = "4.1.1"; + version = "4.1.3"; src = fetchFromGitHub { owner = "mapnik"; repo = "mapnik"; tag = "v${finalAttrs.version}"; - hash = "sha256-+PCN3bjLGqfK4MF6fWApnSua4Pn/mKo2m9CY8/c5xC4="; + hash = "sha256-jbtVJHTAeKGpb6PtcK9Tt4qA6dsECwLSQG9JGsHJjvY="; fetchSubmodules = true; }; @@ -73,6 +75,7 @@ stdenv.mkDerivation (finalAttrs: { gdal (harfbuzz.override { withIcu = true; }) icu + libavif libjpeg libpng libtiff @@ -85,6 +88,7 @@ stdenv.mkDerivation (finalAttrs: { libpq protozero sparsehash + openssl ]; cmakeFlags = [ From bbfca0cdb7e4cf0f6b9a0e69fa030fc36ed86728 Mon Sep 17 00:00:00 2001 From: Augustin Trancart Date: Sun, 5 Oct 2025 16:20:45 +0200 Subject: [PATCH 2/2] python3Packages.python-mapnik: update, but also mark as broken --- .../python-modules/python-mapnik/default.nix | 12 +- .../python-mapnik/find-libmapnik.patch | 35 ++-- .../python-mapnik_std_optional.patch | 176 ------------------ 3 files changed, 24 insertions(+), 199 deletions(-) delete mode 100644 pkgs/development/python-modules/python-mapnik/python-mapnik_std_optional.patch diff --git a/pkgs/development/python-modules/python-mapnik/default.nix b/pkgs/development/python-modules/python-mapnik/default.nix index 5fd085781c54..5a37c6cc8d32 100644 --- a/pkgs/development/python-modules/python-mapnik/default.nix +++ b/pkgs/development/python-modules/python-mapnik/default.nix @@ -24,18 +24,19 @@ sqlite, pytestCheckHook, sparsehash, + pybind11, }: buildPythonPackage rec { pname = "python-mapnik"; - version = "3.0.16-unstable-2024-02-22"; + version = "4.1.3.unstable-2025-09-25"; pyproject = true; src = fetchFromGitHub { owner = "mapnik"; repo = "python-mapnik"; - rev = "5ab32f0209909cc98c26e1d86ce0c8ef29a9bf3d"; - hash = "sha256-OqijA1WcyBcyWO8gntqp+xNIaV1Jqa0n1eMDip2OCvY="; + rev = "4b51d57911dc6a1a9f35c62c681fbdeb56fc69d4"; + hash = "sha256-oXxfLvmptW1v19vaUj11nGEcTHOrneBIea2+GB6uK48="; # Only needed for test data fetchSubmodules = true; }; @@ -46,9 +47,6 @@ buildPythonPackage rec { (replaceVars ./find-libmapnik.patch { libmapnik = "${mapnik}/lib"; }) - # Use `std::optional` rather than `boost::optional` - # https://github.com/mapnik/python-mapnik/commit/e9f88a95a03dc081826a69da67bbec3e4cccd5eb - ./python-mapnik_std_optional.patch ]; stdenv = python.stdenv; @@ -58,6 +56,7 @@ buildPythonPackage rec { nativeBuildInputs = [ mapnik # for mapnik_config pkg-config + pybind11 ]; dependencies = [ @@ -131,5 +130,6 @@ buildPythonPackage rec { homepage = "https://mapnik.org"; license = lib.licenses.lgpl21Plus; teams = [ lib.teams.geospatial ]; + broken = true; }; } diff --git a/pkgs/development/python-modules/python-mapnik/find-libmapnik.patch b/pkgs/development/python-modules/python-mapnik/find-libmapnik.patch index cec557a2940a..c5a7477290f4 100644 --- a/pkgs/development/python-modules/python-mapnik/find-libmapnik.patch +++ b/pkgs/development/python-modules/python-mapnik/find-libmapnik.patch @@ -1,11 +1,12 @@ -diff --git a/build.py b/build.py -index 0f94826b6..3cceb4546 100644 ---- a/build.py -+++ b/build.py -@@ -110,8 +110,8 @@ py_env.AppendUnique(LIBS='mapnik-wkt') +diff --git i/build.py w/build.py +index 0f94826b6..5e91793f2 100644 +--- i/build.py ++++ w/build.py +@@ -109,9 +109,8 @@ py_env.AppendUnique(LIBS='mapnik-wkt') + _mapnik = py_env.LoadableModule('mapnik/_mapnik', sources, LDMODULEPREFIX='', LDMODULESUFFIX='.so') - Depends(_mapnik, env.subst('../../src/%s' % env['MAPNIK_LIB_NAME'])) +-Depends(_mapnik, env.subst('../../src/%s' % env['MAPNIK_LIB_NAME'])) -Depends(_mapnik, env.subst('../../src/json/libmapnik-json${LIBSUFFIX}')) -Depends(_mapnik, env.subst('../../src/wkt/libmapnik-wkt${LIBSUFFIX}')) +Depends(_mapnik, env.subst('@libmapnik@/libmapnikjson${LIBSUFFIX}')) @@ -13,18 +14,18 @@ index 0f94826b6..3cceb4546 100644 if 'uninstall' not in COMMAND_LINE_TARGETS: pymapniklib = env.Install(target_path,_mapnik) -diff --git a/setup.py b/setup.py -index 9985da5a2..5a03a1ec8 100755 ---- a/setup.py -+++ b/setup.py -@@ -118,8 +118,8 @@ linkflags.extend(check_output([mapnik_config, '--libs']).split(' ')) +diff --git i/setup.py w/setup.py +index 24ca0ec5e..bc2b1e0e0 100755 +--- i/setup.py ++++ w/setup.py +@@ -19,8 +19,8 @@ linkflags.extend(check_output([mapnik_config, '--libs']).split(' ')) linkflags.extend(check_output([mapnik_config, '--ldflags']).split(' ')) linkflags.extend(check_output([mapnik_config, '--dep-libs']).split(' ')) linkflags.extend([ --'-lmapnik-wkt', --'-lmapnik-json', -+'-lmapnikwkt', -+'-lmapnikjson', - ] + ['-l%s' % i for i in get_boost_library_names()]) +- '-lmapnik-wkt', +- '-lmapnik-json', ++ '-lmapnikwkt', ++ '-lmapnikjson', + ]) - # Dynamically make the mapnik/paths.py file + # Remove symlinks diff --git a/pkgs/development/python-modules/python-mapnik/python-mapnik_std_optional.patch b/pkgs/development/python-modules/python-mapnik/python-mapnik_std_optional.patch deleted file mode 100644 index c285e77ca57b..000000000000 --- a/pkgs/development/python-modules/python-mapnik/python-mapnik_std_optional.patch +++ /dev/null @@ -1,176 +0,0 @@ -diff --git a/src/mapnik_image.cpp b/src/mapnik_image.cpp -index 9add692c9..488427b56 100644 ---- a/src/mapnik_image.cpp -+++ b/src/mapnik_image.cpp -@@ -230,7 +230,7 @@ unsigned get_type(mapnik::image_any & im) - - std::shared_ptr open_from_file(std::string const& filename) - { -- boost::optional type = type_from_filename(filename); -+ auto type = type_from_filename(filename); - if (type) - { - std::unique_ptr reader(get_image_reader(filename,*type)); -diff --git a/src/mapnik_layer.cpp b/src/mapnik_layer.cpp -index 4fc7ea579..fbd277a81 100644 ---- a/src/mapnik_layer.cpp -+++ b/src/mapnik_layer.cpp -@@ -95,7 +95,7 @@ struct layer_pickle_suite : boost::python::pickle_suite - - std::vector & (mapnik::layer::*_styles_)() = &mapnik::layer::styles; - --void set_maximum_extent(mapnik::layer & l, boost::optional > const& box) -+void set_maximum_extent(mapnik::layer & l, std::optional > const& box) - { - if (box) - { -@@ -107,7 +107,7 @@ void set_maximum_extent(mapnik::layer & l, boost::optional - } - } - --void set_buffer_size(mapnik::layer & l, boost::optional const& buffer_size) -+void set_buffer_size(mapnik::layer & l, std::optional const& buffer_size) - { - if (buffer_size) - { -@@ -121,7 +121,7 @@ void set_buffer_size(mapnik::layer & l, boost::optional const& buffer_size) - - PyObject * get_buffer_size(mapnik::layer & l) - { -- boost::optional buffer_size = l.buffer_size(); -+ std::optional buffer_size = l.buffer_size(); - if (buffer_size) - { - #if PY_VERSION_HEX >= 0x03000000 -diff --git a/src/mapnik_map.cpp b/src/mapnik_map.cpp -index 3587e5d8a..cfa523b03 100644 ---- a/src/mapnik_map.cpp -+++ b/src/mapnik_map.cpp -@@ -105,7 +105,7 @@ mapnik::featureset_ptr query_map_point(mapnik::Map const& m, int index, double x - return m.query_map_point(idx, x, y); - } - --void set_maximum_extent(mapnik::Map & m, boost::optional > const& box) -+void set_maximum_extent(mapnik::Map & m, std::optional > const& box) - { - if (box) - { -diff --git a/src/python_optional.hpp b/src/python_optional.hpp -index d690b7c51..9d86c340e 100644 ---- a/src/python_optional.hpp -+++ b/src/python_optional.hpp -@@ -28,7 +28,7 @@ - #include - #pragma GCC diagnostic pop - --// boost::optional to/from converter from John Wiegley -+// std::optional to/from converter from John Wiegley - - template - struct object_from_python -@@ -54,7 +54,7 @@ struct python_optional : public mapnik::util::noncopyable - { - struct optional_to_python - { -- static PyObject * convert(const boost::optional& value) -+ static PyObject * convert(const std::optional& value) - { - return (value ? boost::python::to_python_value()(*value) : - boost::python::detail::none()); -@@ -90,9 +90,9 @@ struct python_optional : public mapnik::util::noncopyable - data)->storage.bytes; - - if (data->convertible == source) // == None -- new (storage) boost::optional(); // A Boost uninitialized value -+ new (storage) std::optional(); // A Boost uninitialized value - else -- new (storage) boost::optional(*static_cast(data->convertible)); -+ new (storage) std::optional(*static_cast(data->convertible)); - - data->convertible = storage; - } -@@ -100,18 +100,18 @@ struct python_optional : public mapnik::util::noncopyable - - explicit python_optional() - { -- register_python_conversion, -+ register_python_conversion, - optional_to_python, optional_from_python>(); - } - }; - --// to/from boost::optional -+// to/from std::optional - template <> - struct python_optional : public mapnik::util::noncopyable - { - struct optional_to_python - { -- static PyObject * convert(const boost::optional& value) -+ static PyObject * convert(const std::optional& value) - { - return (value ? PyFloat_FromDouble(*value) : - boost::python::detail::none()); -@@ -133,30 +133,30 @@ struct python_optional : public mapnik::util::noncopyable - boost::python::converter::rvalue_from_python_stage1_data * data) - { - using namespace boost::python::converter; -- void * const storage = ((rvalue_from_python_storage > *) -+ void * const storage = ((rvalue_from_python_storage > *) - data)->storage.bytes; - if (source == Py_None) // == None -- new (storage) boost::optional(); // A Boost uninitialized value -+ new (storage) std::optional(); // A Boost uninitialized value - else -- new (storage) boost::optional(PyFloat_AsDouble(source)); -+ new (storage) std::optional(PyFloat_AsDouble(source)); - data->convertible = storage; - } - }; - - explicit python_optional() - { -- register_python_conversion, -+ register_python_conversion, - optional_to_python, optional_from_python>(); - } - }; - --// to/from boost::optional -+// to/from std::optional - template <> - struct python_optional : public mapnik::util::noncopyable - { - struct optional_to_python - { -- static PyObject * convert(const boost::optional& value) -+ static PyObject * convert(const std::optional& value) - { - if (value) - { -@@ -181,13 +181,13 @@ struct python_optional : public mapnik::util::noncopyable - boost::python::converter::rvalue_from_python_stage1_data * data) - { - using namespace boost::python::converter; -- void * const storage = ((rvalue_from_python_storage > *) -+ void * const storage = ((rvalue_from_python_storage > *) - data)->storage.bytes; - if (source == Py_None) // == None -- new (storage) boost::optional(); // A Boost uninitialized value -+ new (storage) std::optional(); // A Boost uninitialized value - else - { -- new (storage) boost::optional(source == Py_True ? true : false); -+ new (storage) std::optional(source == Py_True ? true : false); - } - data->convertible = storage; - } -@@ -195,7 +195,7 @@ struct python_optional : public mapnik::util::noncopyable - - explicit python_optional() - { -- register_python_conversion, -+ register_python_conversion, - optional_to_python, optional_from_python>(); - } - };