2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
2021-08-05 21:33:18 +00:00
|
|
|
, fetchFromGitHub
|
2022-11-21 17:40:18 +00:00
|
|
|
, fetchpatch
|
|
|
|
, substituteAll
|
2020-04-24 23:36:52 +00:00
|
|
|
, isPyPy
|
|
|
|
, python
|
|
|
|
, pillow
|
|
|
|
, pycairo
|
2021-08-05 21:33:18 +00:00
|
|
|
, pkg-config
|
|
|
|
, boost
|
|
|
|
, cairo
|
|
|
|
, harfbuzz
|
|
|
|
, icu
|
|
|
|
, libjpeg
|
|
|
|
, libpng
|
|
|
|
, libtiff
|
|
|
|
, libwebp
|
|
|
|
, mapnik
|
|
|
|
, proj
|
|
|
|
, zlib
|
2022-11-21 17:40:18 +00:00
|
|
|
, libxml2
|
|
|
|
, sqlite
|
|
|
|
, nose
|
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
buildPythonPackage rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "python-mapnik";
|
2022-11-21 17:40:18 +00:00
|
|
|
version = "unstable-2020-09-08";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
src = fetchFromGitHub {
|
2020-04-24 23:36:52 +00:00
|
|
|
owner = "mapnik";
|
|
|
|
repo = "python-mapnik";
|
2022-11-21 17:40:18 +00:00
|
|
|
rev = "a2c2a86eec954b42d7f00093da03807d0834b1b4";
|
|
|
|
hash = "sha256-GwDdrutJOHtW7pIWiUAiu1xucmRvp7YFYB3YSCrDsrY=";
|
|
|
|
# Only needed for test data
|
|
|
|
fetchSubmodules = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
patches = [
|
|
|
|
# https://github.com/mapnik/python-mapnik/issues/239
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/koordinates/python-mapnik/commit/318b1edac16f48a7f21902c192c1dd86f6210a44.patch";
|
|
|
|
sha256 = "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 {
|
|
|
|
src = ./find-libmapnik.patch;
|
|
|
|
libmapnik = "${mapnik}/lib";
|
|
|
|
})
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
mapnik # for mapnik_config
|
2021-08-05 21:33:18 +00:00
|
|
|
pkg-config
|
2021-05-20 23:08:51 +00:00
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
|
|
|
mapnik
|
|
|
|
boost
|
|
|
|
cairo
|
|
|
|
harfbuzz
|
|
|
|
icu
|
|
|
|
libjpeg
|
|
|
|
libpng
|
|
|
|
libtiff
|
|
|
|
libwebp
|
|
|
|
proj
|
|
|
|
zlib
|
2022-11-21 17:40:18 +00:00
|
|
|
libxml2
|
|
|
|
sqlite
|
2021-08-05 21:33:18 +00:00
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [ pillow pycairo ];
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
configureFlags = [
|
|
|
|
"XMLPARSER=libxml2"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabled = isPyPy;
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
export BOOST_PYTHON_LIB="boost_python${"${lib.versions.major python.version}${lib.versions.minor python.version}"}"
|
|
|
|
export BOOST_THREAD_LIB="boost_thread"
|
|
|
|
export BOOST_SYSTEM_LIB="boost_system"
|
|
|
|
export PYCAIRO=true
|
|
|
|
export XMLPARSER=libxml2
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
nose
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
# import from $out
|
|
|
|
rm -r mapnik
|
|
|
|
'';
|
|
|
|
|
|
|
|
# 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_good_files"
|
|
|
|
"test_layer_init"
|
|
|
|
"test_load_save_map"
|
|
|
|
"test_loading_fontset_from_map"
|
|
|
|
"test_normalizing_definition"
|
|
|
|
"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_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"
|
|
|
|
];
|
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
pythonImportsCheck = [ "mapnik" ];
|
2021-05-29 03:34:57 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Python bindings for Mapnik";
|
2021-12-06 16:07:01 +00:00
|
|
|
maintainers = with maintainers; [ erictapen ];
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://mapnik.org";
|
2022-11-21 17:40:18 +00:00
|
|
|
license = licenses.lgpl21Plus;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|