From fc3e4af7a44ca50e3e75049c286f6565bfce7958 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Mon, 27 Jun 2022 23:51:52 +0000 Subject: [PATCH 01/19] libgeotiff: 1.5.1 -> 1.7.1 https://github.com/OSGeo/libgeotiff/blob/1.7.1/libgeotiff/NEWS --- .../libraries/libgeotiff/default.nix | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/pkgs/development/libraries/libgeotiff/default.nix b/pkgs/development/libraries/libgeotiff/default.nix index eb35d5316c0e..628f4dca8c56 100644 --- a/pkgs/development/libraries/libgeotiff/default.nix +++ b/pkgs/development/libraries/libgeotiff/default.nix @@ -1,14 +1,23 @@ -{ lib, stdenv, fetchFromGitHub, libtiff, libjpeg, proj, zlib, autoreconfHook }: +{ lib +, stdenv +, fetchFromGitHub +, autoreconfHook +, pkg-config +, libjpeg +, libtiff +, proj +, zlib +}: stdenv.mkDerivation rec { - version = "1.5.1"; + version = "1.7.1"; pname = "libgeotiff"; src = fetchFromGitHub { owner = "OSGeo"; repo = "libgeotiff"; rev = version; - sha256 = "081ag23pn2n5y4fkb2rnh4hmcnq92siqiqv0s20jmx0j3s2nvfxy"; + hash = "sha256-bE6UAUKiorriTgYrqhxbMAN2NEtmV/8IIfF02RUghSI="; }; outputs = [ "out" "dev" ]; @@ -20,15 +29,19 @@ stdenv.mkDerivation rec { "--with-zlib=${zlib.dev}" ]; - nativeBuildInputs = [ autoreconfHook ]; + nativeBuildInputs = [ + autoreconfHook + pkg-config + ]; buildInputs = [ libtiff proj ]; - hardeningDisable = [ "format" ]; + #hardeningDisable = [ "format" ]; meta = { description = "Library implementing attempt to create a tiff based interchange format for georeferenced raster imagery"; homepage = "https://github.com/OSGeo/libgeotiff"; + changelog = "https://github.com/OSGeo/libgeotiff/blob/${src.rev}/libgeotiff/NEWS"; license = lib.licenses.mit; maintainers = [lib.maintainers.marcweber]; platforms = with lib.platforms; linux ++ darwin; From c8e545b3b89bb1931bb0033c5b81d9cb320a2b7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 28 Jun 2022 02:47:26 +0000 Subject: [PATCH 02/19] brunsli: init at 0.1 --- .../development/libraries/brunsli/default.nix | 54 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 56 insertions(+) create mode 100644 pkgs/development/libraries/brunsli/default.nix diff --git a/pkgs/development/libraries/brunsli/default.nix b/pkgs/development/libraries/brunsli/default.nix new file mode 100644 index 000000000000..08f1b9e27312 --- /dev/null +++ b/pkgs/development/libraries/brunsli/default.nix @@ -0,0 +1,54 @@ +{ lib +, stdenv +, fetchFromGitHub +, fetchpatch +, cmake +, brotli +}: + +stdenv.mkDerivation rec { + pname = "brunsli"; + version = "0.1"; + + outputs = [ "out" "dev" ]; + + src = fetchFromGitHub { + owner = "google"; + repo = "brunsli"; + rev = "v${version}"; + hash = "sha256-ZcrRz2xSoRepgG8KZYY/JzgONerItW0e6mH1PYsko98="; + }; + + patches = [ + # unvendor brotli + (fetchpatch { + url = "https://cgit.freebsd.org/ports/plain/graphics/brunsli/files/patch-CMakeLists.txt"; + hash = "sha256-SqmkmL8r/KGvELq2em4ZLkCaKgZywZ/4fcC/enZ1nEI="; + }) + (fetchpatch { + url = "https://cgit.freebsd.org/ports/plain/graphics/brunsli/files/patch-brunsli.cmake"; + hash = "sha256-UmXK+NBd0+5AZX2oWnrpOnzHD7c3ghSO7oERWLOYjbA="; + }) + ]; + + postPatch = '' + rm -r third_party + ''; + + patchFlags = [ "-p0" ]; + + nativeBuildInputs = [ + cmake + ]; + + buildInputs = [ + brotli + ]; + + meta = { + description = "Lossless JPEG repacking library"; + homepage = "https://github.com/google/brunsli"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index bc9750804988..4ddbb76db30c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18150,6 +18150,8 @@ with pkgs; boxfort = callPackage ../development/libraries/boxfort { }; + brunsli = callPackage ../development/libraries/brunsli { }; + buddy = callPackage ../development/libraries/buddy { }; buildkit-nix = callPackage ../applications/virtualization/buildkit-nix { }; From b3f94fd518d6004e497b717e5466da046fb5a6e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 28 Jun 2022 03:00:55 +0000 Subject: [PATCH 03/19] lerc: init at 3.0 --- pkgs/development/libraries/lerc/default.nix | 30 +++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 32 insertions(+) create mode 100644 pkgs/development/libraries/lerc/default.nix diff --git a/pkgs/development/libraries/lerc/default.nix b/pkgs/development/libraries/lerc/default.nix new file mode 100644 index 000000000000..99e18a76bf60 --- /dev/null +++ b/pkgs/development/libraries/lerc/default.nix @@ -0,0 +1,30 @@ +{ lib +, stdenv +, fetchFromGitHub +, cmake +}: + +stdenv.mkDerivation rec { + pname = "lerc"; + version = "3.0"; + + outputs = [ "out" "dev" ]; + + src = fetchFromGitHub { + owner = "esri"; + repo = "lerc"; + rev = "v${version}"; + hash = "sha256-QO5+ouQy5nOcAgvxMeBDoSBP+G3ClDjXipnkuSIDcP0="; + }; + + nativeBuildInputs = [ + cmake + ]; + + meta = { + description = "C++ library for Limited Error Raster Compression"; + homepage = "https://github.com/esri/lerc"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4ddbb76db30c..fc21ad36f255 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -19653,6 +19653,8 @@ with pkgs; leptonica = callPackage ../development/libraries/leptonica { }; + lerc = callPackage ../development/libraries/lerc { }; + lib2geom = callPackage ../development/libraries/lib2geom { }; lib3ds = callPackage ../development/libraries/lib3ds { }; From dcd559e08192c8253b7e4027f39b7fd58f655cfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Mon, 27 Jun 2022 22:14:52 +0000 Subject: [PATCH 04/19] gdal: 3.4.2 -> 3.5.2 https://github.com/OSGeo/gdal/blob/v3.5.2/NEWS.md --- pkgs/development/libraries/gdal/default.nix | 208 +++++++++++++------- pkgs/top-level/all-packages.nix | 11 +- pkgs/top-level/python-packages.nix | 2 +- 3 files changed, 141 insertions(+), 80 deletions(-) diff --git a/pkgs/development/libraries/gdal/default.nix b/pkgs/development/libraries/gdal/default.nix index bec478c66bd9..89912d93f4b3 100644 --- a/pkgs/development/libraries/gdal/default.nix +++ b/pkgs/development/libraries/gdal/default.nix @@ -1,84 +1,149 @@ -{ lib, stdenv, fetchFromGitHub, fetchpatch, unzip, libjpeg, libtiff, zlib, postgresql -, libmysqlclient, libgeotiff, pythonPackages, proj, geos, openssl, libpng -, sqlite, libspatialite, poppler, hdf4, qhull, giflib, expat, libiconv, libxml2 -, autoreconfHook, netcdfSupport ? true, netcdf, hdf5, curl, pkg-config }: - -with lib; +{ lib +, stdenv +, fetchFromGitHub +, bison +, cmake +, doxygen +, graphviz +, pkg-config +, python3 +, swig +, armadillo +, arrow-cpp +, c-blosc +, brunsli +, cfitsio +, crunch +, curl +, cryptopp +, libdeflate +, expat +, libgeotiff +, geos +, giflib +, libheif +, dav1d +, libaom +, libde265 +, rav1e +, x265 +, hdf4 +, hdf5-cpp +, libiconv +, libjpeg +, json_c +, libjxl +, libhwy +, kea +, lerc +, xz +, libxml2 +, lz4 +, libmysqlclient +, netcdf +, openexr +, openjpeg +, openssl +, pcre2 +, libpng +, poppler +, postgresql +, proj +, qhull +, libspatialite +, sqlite +, libtiff +, tiledb +, libwebp +, xercesc +, zlib +, zstd +}: stdenv.mkDerivation rec { pname = "gdal"; - version = "3.4.2"; + version = "3.5.2"; src = fetchFromGitHub { owner = "OSGeo"; repo = "gdal"; rev = "v${version}"; - sha256 = "sha256-bE55VV0SrG8nxCLdpODRalnuAkn+olRdMLUjduavj6M="; + sha256 = "sha256-jtAFI1J64ZaTqIljqQL1xOiTGC79AZWcIgidozWczMM="; }; - sourceRoot = "source/gdal"; + nativeBuildInputs = [ + bison + cmake + doxygen + graphviz + pkg-config + python3.pkgs.setuptools + python3.pkgs.wrapPython + swig + ]; - nativeBuildInputs = [ autoreconfHook pkg-config unzip ]; + cmakeFlags = [ + "-DGDAL_USE_INTERNAL_LIBS=OFF" + "-DGEOTIFF_INCLUDE_DIR=${lib.getDev libgeotiff}/include" + "-DGEOTIFF_LIBRARY_RELEASE=${lib.getLib libgeotiff}/lib/libgeotiff${stdenv.hostPlatform.extensions.sharedLibrary}" + "-DMYSQL_INCLUDE_DIR=${lib.getDev libmysqlclient}/include/mysql" + "-DMYSQL_LIBRARY=${lib.getLib libmysqlclient}/lib/mysql/libmysqlclient${stdenv.hostPlatform.extensions.sharedLibrary}" + "-DCMAKE_SKIP_BUILD_RPATH=ON" # without, libgdal.so can't find libmariadb.so + ]; buildInputs = [ - libjpeg - libtiff - libpng - proj - openssl - sqlite - libspatialite - libgeotiff - poppler - hdf4 - qhull - giflib + armadillo + arrow-cpp + c-blosc + brunsli + cfitsio + crunch + curl + cryptopp + libdeflate expat + libgeotiff + geos + giflib + libheif + dav1d # required by libheif + libaom # required by libheif + libde265 # required by libheif + rav1e # required by libheif + x265 # required by libheif + hdf4 + hdf5-cpp + libjpeg + json_c + libjxl + libhwy # required by libjxl + kea + lerc + xz libxml2 + lz4 + libmysqlclient + netcdf + openexr + openjpeg + openssl + pcre2 + libpng + poppler postgresql - ] ++ (with pythonPackages; [ python setuptools numpy wrapPython ]) - ++ lib.optional stdenv.isDarwin libiconv - ++ lib.optionals netcdfSupport [ netcdf hdf5 curl ]; - - configureFlags = [ - "--with-expat=${expat.dev}" - "--with-jpeg=${libjpeg.dev}" - "--with-libtiff=${libtiff.dev}" # optional (without largetiff support) - "--with-png=${libpng.dev}" # optional - "--with-poppler=${poppler.dev}" # optional - "--with-libz=${zlib.dev}" # optional - "--with-pg=yes" # since gdal 3.0 doesn't use ${postgresql}/bin/pg_config - "--with-mysql=${getDev libmysqlclient}/bin/mysql_config" - "--with-geotiff=${libgeotiff}" - "--with-sqlite3=${sqlite.dev}" - "--with-spatialite=${libspatialite.dev}" - "--with-python" # optional - "--with-proj=${proj.dev}" # optional - "--with-geos=${geos}/bin/geos-config" # optional - "--with-hdf4=${hdf4.dev}" # optional - "--with-xml2=yes" # optional - (if netcdfSupport then "--with-netcdf=${netcdf}" else "") - ]; - - hardeningDisable = [ "format" ]; - - CXXFLAGS = lib.concatStringsSep " " [ - "-fpermissive" - # poppler uses std::optional - "-std=c++17" - ]; - - # - Unset CC and CXX as they confuse libtool. - # - teach gdal that libdf is the legacy name for libhdf - preConfigure = '' - substituteInPlace configure \ - --replace "-lmfhdf -ldf" "-lmfhdf -lhdf" - ''; - - preBuild = '' - substituteInPlace swig/python/GNUmakefile \ - --replace "ifeq (\$(STD_UNIX_LAYOUT),\"TRUE\")" "ifeq (1,1)" - ''; + proj + qhull + libspatialite + sqlite + libtiff + tiledb + libwebp + xercesc + zlib + zstd + python3 + python3.pkgs.numpy + ] ++ lib.optional stdenv.isDarwin libiconv; postInstall = '' wrapPythonPrograms @@ -91,13 +156,11 @@ stdenv.mkDerivation rec { # calls (coming from the python world) preCheck = '' pushd ../autotest - # something has made files here read-only by this point - chmod -R u+w . export HOME=$(mktemp -d) - export PYTHONPATH="$out/${pythonPackages.python.sitePackages}:$PYTHONPATH" + export PYTHONPATH="$out/${python3.sitePackages}:$PYTHONPATH" ''; - installCheckInputs = with pythonPackages; [ + installCheckInputs = with python3.pkgs; [ pytestCheckHook pytest-env lxml @@ -115,6 +178,8 @@ stdenv.mkDerivation rec { # https://github.com/OSGeo/gdal/issues/5523 "test_transformer_dem_overrride_srs" "test_osr_ct_options_area_of_interest" + # ZIP does not support timestamps before 1980 + " test_sentinel2_zipped" ] ++ lib.optionals (!stdenv.isx86_64) [ # likely precision-related expecting x87 behaviour "test_jp2openjpeg_22" @@ -129,8 +194,9 @@ stdenv.mkDerivation rec { meta = { description = "Translator library for raster geospatial data formats"; homepage = "https://www.gdal.org/"; + changelog = "https://docs.unidata.ucar.edu/netcdf-c/${src.rev}/RELEASE_NOTES.html"; license = lib.licenses.mit; - maintainers = [ lib.maintainers.marcweber ]; - platforms = with lib.platforms; linux ++ darwin; + maintainers = with lib.maintainers; [ marcweber dotlambda ]; + platforms = lib.platforms.unix; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index fc21ad36f255..8a945ce78a8f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18829,10 +18829,7 @@ with pkgs; libXpm = null; }; - gdal = callPackage ../development/libraries/gdal { - pythonPackages = python3Packages; - autoreconfHook = buildPackages.autoreconfHook269; - }; + gdal = callPackage ../development/libraries/gdal { }; gdcm = callPackage ../development/libraries/gdcm { inherit (darwin.apple_sdk.frameworks) ApplicationServices Cocoa; @@ -36794,10 +36791,8 @@ with pkgs; mysql-workbench = callPackage ../applications/misc/mysql-workbench (let mysql = mysql80; in { gdal = gdal.override { - libmysqlclient = mysql // { - lib = { dev = mysql; } - ;} - ;}; + libmysqlclient = mysql; + }; mysql = mysql; pcre = pcre-cpp; jre = jre8; # TODO: remove override https://github.com/NixOS/nixpkgs/pull/89731 diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c4714ffe9a52..ae919c61444a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3573,7 +3573,7 @@ self: super: with self; { gcsfs = callPackage ../development/python-modules/gcsfs { }; - gdal = toPythonModule (pkgs.gdal.override { pythonPackages = self; }); + gdal = toPythonModule (pkgs.gdal.override { python3 = python; }); gdata = callPackage ../development/python-modules/gdata { }; From d0f3893da05c234cd48a4c7985707b795e963c1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Wed, 29 Jun 2022 16:57:12 +0000 Subject: [PATCH 05/19] gplates: use python39 Boost 1.75 is not compatible with Python 3.10. --- pkgs/top-level/all-packages.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8a945ce78a8f..bf8cdd6a98ca 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -36015,6 +36015,7 @@ with pkgs; gplates = libsForQt5.callPackage ../applications/science/misc/gplates { boost = boost175; + python3 = python39; }; gravit = callPackage ../applications/science/astronomy/gravit { }; From 7c224b3e127ad37b27f31aaa71ae5959320bd492 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Thu, 7 Jul 2022 06:42:28 +0000 Subject: [PATCH 06/19] python310Packages.fiona: fix tests with GDAL 3.5.1 --- pkgs/development/python-modules/fiona/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/development/python-modules/fiona/default.nix b/pkgs/development/python-modules/fiona/default.nix index e5dcd104e433..cadbfc717a58 100644 --- a/pkgs/development/python-modules/fiona/default.nix +++ b/pkgs/development/python-modules/fiona/default.nix @@ -2,6 +2,7 @@ , attrs, click, cligj, click-plugins, six, munch, enum34 , pytestCheckHook, boto3, mock, giflib, pytz , gdal, certifi +, fetchpatch }: buildPythonPackage rec { @@ -14,6 +15,14 @@ buildPythonPackage rec { sha256 = "sha256-qCqZzps+eCV0AVfEXJ+yJZ1OkvCohqqsJfDbQP/h7qM="; }; + patches = [ + # https://github.com/Toblerity/Fiona/pull/1122 + (fetchpatch { + url = "https://github.com/Toblerity/Fiona/commit/fa632130dcd9dfbb982ecaa4911b3fab3459168f.patch"; + hash = "sha256-IuNHr3yBqS1jY9Swvcq8XPv6BpVlInDx0FVuzEMaYTY="; + }) + ]; + CXXFLAGS = lib.optionalString stdenv.cc.isClang "-std=c++11"; nativeBuildInputs = [ From d35077ae8bfeba5004438046bffd9515fef33214 Mon Sep 17 00:00:00 2001 From: Kerstin Humm Date: Sat, 13 Nov 2021 22:27:29 +0100 Subject: [PATCH 07/19] mapnik: 3.1.0 -> unstable-2022-04-14 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - use CMake. I just didn't got it to work with SCons. - patch cmake to find harfbuzz - prefetch catch2 for enabling tests - add erictapen as maintainer - build mapnik-config with scons, as it isn't build by cmake - use python3 exclusively - build with harfbuzz-icu - change license to lgpl21Plus - use PROJ 8 - use latest scons, but use cmake for everything but mapnik-config - don't make postgresql optional Co-Authored-by: Robert Schütz --- .../libraries/mapnik/catch2-src.patch | 14 ++ .../libraries/mapnik/cmake-harfbuzz.patch | 26 +++ pkgs/development/libraries/mapnik/default.nix | 161 +++++++++--------- .../libraries/mapnik/include.patch | 11 ++ pkgs/top-level/all-packages.nix | 7 +- pkgs/top-level/python-packages.nix | 2 +- 6 files changed, 134 insertions(+), 87 deletions(-) create mode 100644 pkgs/development/libraries/mapnik/catch2-src.patch create mode 100644 pkgs/development/libraries/mapnik/cmake-harfbuzz.patch create mode 100644 pkgs/development/libraries/mapnik/include.patch diff --git a/pkgs/development/libraries/mapnik/catch2-src.patch b/pkgs/development/libraries/mapnik/catch2-src.patch new file mode 100644 index 000000000000..04c6f7add217 --- /dev/null +++ b/pkgs/development/libraries/mapnik/catch2-src.patch @@ -0,0 +1,14 @@ +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt +index 0705ddce1..771291b88 100644 +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -7,8 +7,7 @@ include(FetchContent) + + FetchContent_Declare( + Catch2 +- GIT_REPOSITORY https://github.com/catchorg/Catch2.git +- GIT_TAG v2.13.7) ++ SOURCE_DIR @catch2_src@) + FetchContent_MakeAvailable(Catch2) + + if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.19.0") diff --git a/pkgs/development/libraries/mapnik/cmake-harfbuzz.patch b/pkgs/development/libraries/mapnik/cmake-harfbuzz.patch new file mode 100644 index 000000000000..f44b879b592f --- /dev/null +++ b/pkgs/development/libraries/mapnik/cmake-harfbuzz.patch @@ -0,0 +1,26 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f2dc1f02d..739b8ae99 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -153,19 +153,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...") +- 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/development/libraries/mapnik/default.nix b/pkgs/development/libraries/mapnik/default.nix index 13e34bebee63..d9ae74ed44a0 100644 --- a/pkgs/development/libraries/mapnik/default.nix +++ b/pkgs/development/libraries/mapnik/default.nix @@ -1,111 +1,110 @@ -{ lib, stdenv, fetchzip -, boost, cairo, freetype, gdal, harfbuzz, icu, libjpeg, libpng, libtiff -, libwebp, libxml2, proj, python3, python ? python3, sqlite, zlib -, sconsPackages - -# supply a postgresql package to enable the PostGIS input plugin -, postgresql ? null +{ lib +, stdenv +, fetchFromGitHub +, buildPackages +, cmake +, pkg-config +, substituteAll +, boost +, cairo +, freetype +, gdal +, harfbuzz +, icu +, libjpeg +, libpng +, libtiff +, libwebp +, libxml2 +, proj +, python3 +, sqlite +, zlib +, catch2 +, postgresql }: -let - scons = sconsPackages.scons_3_0_1; -in stdenv.mkDerivation rec { +stdenv.mkDerivation rec { pname = "mapnik"; - version = "3.1.0"; + version = "unstable-2022-04-14"; - src = fetchzip { - # this one contains all git submodules and is cheaper than fetchgit - url = "https://github.com/mapnik/mapnik/releases/download/v${version}/mapnik-v${version}.tar.bz2"; - sha256 = "sha256-qqPqN4vs3ZsqKgnx21yQhX8OzHca/0O+3mvQ/vnC5EY="; + src = fetchFromGitHub { + owner = "mapnik"; + repo = "mapnik"; + rev = "1ba1278b4227ccd887a95880d1c75aa6446132fc"; + sha256 = "sha256-dtu+PKpK/crO5cZje0aj+vB9beG0eU6fyT9GNtvvtbM="; + fetchSubmodules = true; }; postPatch = '' substituteInPlace configure \ - --replace '$PYTHON scons/scons.py' ${scons}/bin/scons + --replace '$PYTHON scons/scons.py' ${buildPackages.scons}/bin/scons rm -r scons ''; # a distinct dev output makes python-mapnik fail outputs = [ "out" ]; - nativeBuildInputs = [ scons ]; + 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 + # prevent CMake from trying to get libraries on the Internet + (substituteAll { + src = ./catch2-src.patch; + catch2_src = catch2.src; + }) + ./include.patch + ]; + + nativeBuildInputs = [ cmake pkg-config ]; buildInputs = [ - boost cairo freetype gdal harfbuzz icu libjpeg libpng libtiff - libwebp proj python sqlite zlib - - # optional inputs + boost + cairo + freetype + gdal + harfbuzz + icu + libjpeg + libpng + libtiff + libwebp + proj + python3 + sqlite + zlib + libxml2 postgresql ]; - propagatedBuildInputs = [ libxml2 ]; + cmakeFlags = [ + # Would require qt otherwise. + "-DBUILD_DEMO_VIEWER=OFF" + ]; - prefixKey = "PREFIX="; - - preConfigure = '' - patchShebangs ./configure + # 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. + preBuild = '' + cd .. + ${buildPackages.scons}/bin/scons utils/mapnik-config + cd build ''; - # NOTE: 2021-05-06: - # Add -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H=1 for backwards compatibility - # with major versions 6 and 7 of proj which are otherwise not compatible - # with mapnik 3.1.0. Note that: - # - # 1. Starting with proj version 8, this workaround will no longer be - # supported by the upstream proj project. - # - # 2. Without the workaround, mapnik configures itself without proj support. - # - # 3. The master branch of mapnik (after 3.1.0) appears to add native support - # for the proj 6 api, so this workaround is not likely to be needed in - # subsequent mapnik releases. At that point, this block comment and the - # NIX_CFLAGS_COMPILE expression can be removed. - - NIX_CFLAGS_COMPILE = - if version != "3.1.0" && lib.versionAtLeast version "3.1.0" - then throw "The mapnik compatibility workaround for proj 6 may no longer be required. Remove workaround after checking." - else if lib.versionAtLeast (lib.getVersion proj) "8" - then throw ("mapnik currently requires a version of proj less than 8, but proj version is: " + (lib.getVersion proj)) - else "-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H=1"; - - configureFlags = [ - "BOOST_INCLUDES=${boost.dev}/include" - "BOOST_LIBS=${boost.out}/lib" - "CAIRO_INCLUDES=${cairo.dev}/include" - "CAIRO_LIBS=${cairo.out}/lib" - "FREETYPE_INCLUDES=${freetype.dev}/include" - "FREETYPE_LIBS=${freetype.out}/lib" - "GDAL_CONFIG=${gdal}/bin/gdal-config" - "HB_INCLUDES=${harfbuzz.dev}/include" - "HB_LIBS=${harfbuzz.out}/lib" - "ICU_INCLUDES=${icu.dev}/include" - "ICU_LIBS=${icu.out}/lib" - "JPEG_INCLUDES=${libjpeg.dev}/include" - "JPEG_LIBS=${libjpeg.out}/lib" - "PNG_INCLUDES=${libpng.dev}/include" - "PNG_LIBS=${libpng.out}/lib" - "PROJ_INCLUDES=${proj.dev}/include" - "PROJ_LIBS=${proj.out}/lib" - "SQLITE_INCLUDES=${sqlite.dev}/include" - "SQLITE_LIBS=${sqlite.out}/lib" - "TIFF_INCLUDES=${libtiff.dev}/include" - "TIFF_LIBS=${libtiff.out}/lib" - "WEBP_INCLUDES=${libwebp}/include" - "WEBP_LIBS=${libwebp}/lib" - "XMLPARSER=libxml2" - ]; - - buildFlags = [ - "JOBS=$(NIX_BUILD_CORES)" - ]; + preInstall = '' + mkdir -p $out/bin + cp ../utils/mapnik-config/mapnik-config $out/bin/mapnik-config + ''; meta = with lib; { description = "An open source toolkit for developing mapping applications"; homepage = "https://mapnik.org"; maintainers = with maintainers; [ hrdinka erictapen ]; - license = licenses.lgpl21; + license = licenses.lgpl21Plus; platforms = platforms.all; - # https://github.com/mapnik/mapnik/issues/4232 - broken = lib.versionAtLeast proj.version "8.0.0"; }; } diff --git a/pkgs/development/libraries/mapnik/include.patch b/pkgs/development/libraries/mapnik/include.patch new file mode 100644 index 000000000000..e13f4a43cbcb --- /dev/null +++ b/pkgs/development/libraries/mapnik/include.patch @@ -0,0 +1,11 @@ +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 + { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index bf8cdd6a98ca..b924c73b7213 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -21063,12 +21063,9 @@ with pkgs; opencl-clang = callPackage ../development/libraries/opencl-clang { }; mapnik = callPackage ../development/libraries/mapnik { - gdal = gdal.override { - libgeotiff = libgeotiff.override { proj = proj_7; }; - libspatialite = libspatialite.override { proj = proj_7; }; - proj = proj_7; + harfbuzz = harfbuzz.override { + withIcu = true; }; - proj = proj_7; boost = boost175; }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index ae919c61444a..5f2c27456d33 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -9007,7 +9007,7 @@ self: super: with self; { inherit (pkgs) pkg-config cairo harfbuzz icu libjpeg libpng libtiff libwebp proj zlib; inherit boost; mapnik = pkgs.mapnik.override { - inherit python boost; + inherit boost; }; }; From 189a229b6d4055eb50d9b61ccecff2e0fef68a4a Mon Sep 17 00:00:00 2001 From: Kerstin Humm Date: Sat, 13 Nov 2021 20:18:02 +0100 Subject: [PATCH 08/19] python3Packages.python-mapnik: unstable-2020-02-24 -> unstable-2020-09-08 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also: - use libxml2 for xml parsing - use newest boost - patch to find libmapnik{json,wkt}.a - fix license - add erictapen as maintainer - use same harfbuzz as mapnik - use pytestCheckHook, disable failing tests Co-Authored-by: Robert Schütz --- .../python-modules/python-mapnik/default.nix | 98 ++++++++++++++++--- .../python-mapnik/find-libmapnik.patch | 30 ++++++ pkgs/top-level/python-packages.nix | 11 ++- 3 files changed, 118 insertions(+), 21 deletions(-) create mode 100644 pkgs/development/python-modules/python-mapnik/find-libmapnik.patch diff --git a/pkgs/development/python-modules/python-mapnik/default.nix b/pkgs/development/python-modules/python-mapnik/default.nix index 2d888518ff45..3e7b70463245 100644 --- a/pkgs/development/python-modules/python-mapnik/default.nix +++ b/pkgs/development/python-modules/python-mapnik/default.nix @@ -1,6 +1,8 @@ { lib , buildPythonPackage , fetchFromGitHub +, fetchpatch +, substituteAll , isPyPy , python , pillow @@ -17,37 +19,45 @@ , mapnik , proj , zlib +, libxml2 +, sqlite +, nose +, pytestCheckHook }: buildPythonPackage rec { pname = "python-mapnik"; - version = "unstable-2020-02-24"; + version = "unstable-2020-09-08"; src = fetchFromGitHub { owner = "mapnik"; repo = "python-mapnik"; - rev = "7da019cf9eb12af8f8aa88b7d75789dfcd1e901b"; - sha256 = "0snn7q7w1ab90311q8wgd1z64kw1svm5w831q0xd6glqhah86qc8"; + rev = "a2c2a86eec954b42d7f00093da03807d0834b1b4"; + hash = "sha256-GwDdrutJOHtW7pIWiUAiu1xucmRvp7YFYB3YSCrDsrY="; + # Only needed for test data + fetchSubmodules = true; }; - disabled = isPyPy; - doCheck = false; # doesn't find needed test data files - 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 - ''; + 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"; + }) + ]; nativeBuildInputs = [ mapnik # for mapnik_config pkg-config ]; - patches = [ - ./find-pycairo-with-pkg-config.patch - ]; - buildInputs = [ mapnik boost @@ -60,16 +70,72 @@ buildPythonPackage rec { libwebp proj zlib + libxml2 + sqlite ]; propagatedBuildInputs = [ pillow pycairo ]; + 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" + ]; + pythonImportsCheck = [ "mapnik" ]; meta = with lib; { description = "Python bindings for Mapnik"; maintainers = with maintainers; [ erictapen ]; homepage = "https://mapnik.org"; - license = licenses.lgpl21; + license = licenses.lgpl21Plus; }; } diff --git a/pkgs/development/python-modules/python-mapnik/find-libmapnik.patch b/pkgs/development/python-modules/python-mapnik/find-libmapnik.patch new file mode 100644 index 000000000000..cec557a2940a --- /dev/null +++ b/pkgs/development/python-modules/python-mapnik/find-libmapnik.patch @@ -0,0 +1,30 @@ +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') + _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/json/libmapnik-json${LIBSUFFIX}')) +-Depends(_mapnik, env.subst('../../src/wkt/libmapnik-wkt${LIBSUFFIX}')) ++Depends(_mapnik, env.subst('@libmapnik@/libmapnikjson${LIBSUFFIX}')) ++Depends(_mapnik, env.subst('@libmapnik@/libmapnikwkt${LIBSUFFIX}')) + + 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(' ')) + 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()]) + + # Dynamically make the mapnik/paths.py file diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 5f2c27456d33..6beb5e1c84f4 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8998,16 +8998,17 @@ self: super: with self; { python-manilaclient = callPackage ../development/python-modules/python-manilaclient { }; - python-mapnik = let + python-mapnik = callPackage ../development/python-modules/python-mapnik rec { + inherit (pkgs) pkg-config cairo icu libjpeg libpng libtiff libwebp proj zlib; boost = pkgs.boost175.override { enablePython = true; inherit python; }; - in callPackage ../development/python-modules/python-mapnik { - inherit (pkgs) pkg-config cairo harfbuzz icu libjpeg libpng libtiff libwebp proj zlib; - inherit boost; + harfbuzz = pkgs.harfbuzz.override { + withIcu = true; + }; mapnik = pkgs.mapnik.override { - inherit boost; + inherit boost harfbuzz; }; }; From 5d916d42b0914232bc81c820e212404e0a108c2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sun, 30 Oct 2022 00:00:17 -0700 Subject: [PATCH 09/19] gdal: skip test failing when using PROJ < 8 --- pkgs/development/libraries/gdal/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/libraries/gdal/default.nix b/pkgs/development/libraries/gdal/default.nix index 89912d93f4b3..087dd787b61b 100644 --- a/pkgs/development/libraries/gdal/default.nix +++ b/pkgs/development/libraries/gdal/default.nix @@ -186,6 +186,8 @@ stdenv.mkDerivation rec { ] ++ lib.optionals stdenv.isDarwin [ # flaky on macos "test_rda_download_queue" + ] ++ lib.optionals (lib.versionOlder proj.version "8") [ + "test_ogr_parquet_write_crs_without_id_in_datum_ensemble_members" ]; postCheck = '' popd # ../autotest From 3d9993882980bba5e7ef2cee63960179b8a174f3 Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Sat, 29 Oct 2022 17:52:53 +0100 Subject: [PATCH 10/19] kea: fix build on darwin --- pkgs/tools/networking/kea/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/tools/networking/kea/default.nix b/pkgs/tools/networking/kea/default.nix index e03e013f9ba0..466ba5715287 100644 --- a/pkgs/tools/networking/kea/default.nix +++ b/pkgs/tools/networking/kea/default.nix @@ -33,6 +33,8 @@ stdenv.mkDerivation rec { postPatch = '' substituteInPlace ./src/bin/keactrl/Makefile.am --replace '@sysconfdir@' "$out/etc" + # darwin special-casing just causes trouble + substituteInPlace ./m4macros/ax_crypto.m4 --replace 'apple-darwin' 'nope' ''; outputs = [ From 33ea1392610f5e8dba09a98cba24f09ef25795cc Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Sat, 29 Oct 2022 17:53:50 +0100 Subject: [PATCH 11/19] brunsli: tidy patching --- pkgs/development/libraries/brunsli/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/brunsli/default.nix b/pkgs/development/libraries/brunsli/default.nix index 08f1b9e27312..119814eeecfd 100644 --- a/pkgs/development/libraries/brunsli/default.nix +++ b/pkgs/development/libraries/brunsli/default.nix @@ -23,11 +23,13 @@ stdenv.mkDerivation rec { # unvendor brotli (fetchpatch { url = "https://cgit.freebsd.org/ports/plain/graphics/brunsli/files/patch-CMakeLists.txt"; - hash = "sha256-SqmkmL8r/KGvELq2em4ZLkCaKgZywZ/4fcC/enZ1nEI="; + extraPrefix = ""; + hash = "sha256-/WPOG9OcEDj9ObBSXEM8Luq4Rix+PS2MvsYyHhK5mns="; }) (fetchpatch { url = "https://cgit.freebsd.org/ports/plain/graphics/brunsli/files/patch-brunsli.cmake"; - hash = "sha256-UmXK+NBd0+5AZX2oWnrpOnzHD7c3ghSO7oERWLOYjbA="; + extraPrefix = ""; + hash = "sha256-+HXA9Tin+l2St7rRUEBM0AfhAjSoFxz8UX7hsg12aFg="; }) ]; @@ -35,8 +37,6 @@ stdenv.mkDerivation rec { rm -r third_party ''; - patchFlags = [ "-p0" ]; - nativeBuildInputs = [ cmake ]; From 434f16a76492b34b9b43271c65754d332e1fca58 Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Sat, 29 Oct 2022 17:54:08 +0100 Subject: [PATCH 12/19] brunsli: fix building on darwin --- pkgs/development/libraries/brunsli/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/libraries/brunsli/default.nix b/pkgs/development/libraries/brunsli/default.nix index 119814eeecfd..03c9b02f7f9f 100644 --- a/pkgs/development/libraries/brunsli/default.nix +++ b/pkgs/development/libraries/brunsli/default.nix @@ -35,6 +35,8 @@ stdenv.mkDerivation rec { postPatch = '' rm -r third_party + '' + lib.optionalString stdenv.isDarwin '' + rm -r build ''; nativeBuildInputs = [ From 7bcfaeb21d57b8b926432bf017a94f030fbb2df8 Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Sat, 29 Oct 2022 20:13:32 +0100 Subject: [PATCH 13/19] gdal: fix build on darwin --- pkgs/development/libraries/gdal/default.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/gdal/default.nix b/pkgs/development/libraries/gdal/default.nix index 087dd787b61b..92637c148cda 100644 --- a/pkgs/development/libraries/gdal/default.nix +++ b/pkgs/development/libraries/gdal/default.nix @@ -88,12 +88,14 @@ stdenv.mkDerivation rec { "-DGEOTIFF_LIBRARY_RELEASE=${lib.getLib libgeotiff}/lib/libgeotiff${stdenv.hostPlatform.extensions.sharedLibrary}" "-DMYSQL_INCLUDE_DIR=${lib.getDev libmysqlclient}/include/mysql" "-DMYSQL_LIBRARY=${lib.getLib libmysqlclient}/lib/mysql/libmysqlclient${stdenv.hostPlatform.extensions.sharedLibrary}" + ] ++ lib.optionals (!stdenv.isDarwin) [ "-DCMAKE_SKIP_BUILD_RPATH=ON" # without, libgdal.so can't find libmariadb.so + ] ++ lib.optionals stdenv.isDarwin [ + "-DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=ON" ]; buildInputs = [ armadillo - arrow-cpp c-blosc brunsli cfitsio @@ -124,7 +126,6 @@ stdenv.mkDerivation rec { lz4 libmysqlclient netcdf - openexr openjpeg openssl pcre2 @@ -138,11 +139,15 @@ stdenv.mkDerivation rec { libtiff tiledb libwebp - xercesc zlib zstd python3 python3.pkgs.numpy + ] ++ lib.optionals (!stdenv.isDarwin) [ + # tests for formats enabled by these packages fail on macos + arrow-cpp + openexr + xercesc ] ++ lib.optional stdenv.isDarwin libiconv; postInstall = '' From 9a91d12bcd83e344fef21214c377fb4e63d0de27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sun, 30 Oct 2022 11:55:14 -0700 Subject: [PATCH 14/19] mapnik: unstable-2022-04-14 -> unstable-2022-10-18 --- pkgs/development/libraries/mapnik/cmake-harfbuzz.patch | 4 ++-- pkgs/development/libraries/mapnik/default.nix | 6 +++--- pkgs/top-level/all-packages.nix | 1 - pkgs/top-level/python-packages.nix | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/pkgs/development/libraries/mapnik/cmake-harfbuzz.patch b/pkgs/development/libraries/mapnik/cmake-harfbuzz.patch index f44b879b592f..1d5ca6903d0b 100644 --- a/pkgs/development/libraries/mapnik/cmake-harfbuzz.patch +++ b/pkgs/development/libraries/mapnik/cmake-harfbuzz.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index f2dc1f02d..739b8ae99 100644 +index d87a7052d..837867551 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -153,19 +153,8 @@ endif() @@ -12,7 +12,7 @@ index f2dc1f02d..739b8ae99 100644 - message(STATUS "Found harfbuzz native cmake") - list(APPEND MAPNIK_OPTIONAL_LIBS harfbuzz::harfbuzz) -else() -- # Use pkg-config when harfbuzz is not found. +- # 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...") diff --git a/pkgs/development/libraries/mapnik/default.nix b/pkgs/development/libraries/mapnik/default.nix index d9ae74ed44a0..f8da6e9ae03e 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-04-14"; + version = "unstable-2022-10-18"; src = fetchFromGitHub { owner = "mapnik"; repo = "mapnik"; - rev = "1ba1278b4227ccd887a95880d1c75aa6446132fc"; - sha256 = "sha256-dtu+PKpK/crO5cZje0aj+vB9beG0eU6fyT9GNtvvtbM="; + rev = "05661e54392bcbb3367747f97a3ef6e468c105ba"; + hash = "sha256-96AneLPH1gbh/u880Pdc9OdFq2MniSdaTJoKYqId7sw="; fetchSubmodules = true; }; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b924c73b7213..e27c00ea6feb 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -21066,7 +21066,6 @@ with pkgs; harfbuzz = harfbuzz.override { withIcu = true; }; - boost = boost175; }; manticoresearch = callPackage ../servers/search/manticoresearch { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 6beb5e1c84f4..fd7031c91d54 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -9000,7 +9000,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.boost175.override { + boost = pkgs.boost.override { enablePython = true; inherit python; }; From 12455a5d74a1adcada34366cd20d6d4002356d27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Wed, 9 Nov 2022 09:47:27 -0800 Subject: [PATCH 15/19] proj: 9.0.0 -> 9.1.0 --- pkgs/development/libraries/proj/default.nix | 22 +++++++-------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/pkgs/development/libraries/proj/default.nix b/pkgs/development/libraries/proj/default.nix index c7a316778212..1ff2034a7ba6 100644 --- a/pkgs/development/libraries/proj/default.nix +++ b/pkgs/development/libraries/proj/default.nix @@ -9,32 +9,20 @@ , curl , gtest , nlohmann_json +, python3 }: stdenv.mkDerivation rec { pname = "proj"; - version = "9.0.0"; + version = "9.1.0"; src = fetchFromGitHub { owner = "OSGeo"; repo = "PROJ"; rev = version; - sha256 = "sha256-zMP+WzC65BFz8g8mF5t7toqxmxCJePysd6WJuqpe8yg="; + hash = "sha256-Upsp72RorV+5PFPHOK3zCJgVTRZ6fSVVFRope8Bp8/M="; }; - # https://github.com/OSGeo/PROJ/issues/3206 - postPatch = '' - # NB will not apply once https://github.com/OSGeo/PROJ/pull/3150 is released - substituteInPlace cmake/ProjUtilities.cmake \ - --replace '$\{exec_prefix\}/$'{PROJ_LIB_SUBDIR} '$'{CMAKE_INSTALL_FULL_LIBDIR} \ - --replace '$\{prefix\}/$'{PROJ_INCLUDE_SUBDIR} '$'{CMAKE_INSTALL_FULL_INCLUDEDIR} \ - --replace '$\{prefix\}/$'{CMAKE_INSTALL_DATAROOTDIR} '$'{CMAKE_INSTALL_FULL_DATAROOTDIR} - substituteInPlace cmake/project-config.cmake.in \ - --replace '$'{_ROOT}/@INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ \ - --replace '$'{_ROOT}/@LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \ - --replace '$'{_ROOT}/@BINDIR@ @CMAKE_INSTALL_FULL_BINDIR@ - ''; - outputs = [ "out" "dev" ]; nativeBuildInputs = [ cmake pkg-config ]; @@ -62,6 +50,10 @@ stdenv.mkDerivation rec { doCheck = true; + passthru.tests = { + python = python3.pkgs.pyproj; + }; + meta = with lib; { description = "Cartographic Projections Library"; homepage = "https://proj.org/"; From ac986f055a7d451a3683325b1bda94595e2c3740 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Wed, 9 Nov 2022 09:49:39 -0800 Subject: [PATCH 16/19] python310Packages.pyproj: 3.3.1 -> 3.4.0 --- .../python-modules/pyproj/001.proj.patch | 18 ++++++++--------- .../python-modules/pyproj/default.nix | 20 +++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/pkgs/development/python-modules/pyproj/001.proj.patch b/pkgs/development/python-modules/pyproj/001.proj.patch index f62b70915dc5..38061b61addf 100644 --- a/pkgs/development/python-modules/pyproj/001.proj.patch +++ b/pkgs/development/python-modules/pyproj/001.proj.patch @@ -1,5 +1,5 @@ diff --git a/pyproj/datadir.py b/pyproj/datadir.py -index 9ca1d25..4198490 100644 +index df625fee..a2beb06c 100644 --- a/pyproj/datadir.py +++ b/pyproj/datadir.py @@ -70,7 +70,7 @@ def get_data_dir() -> str: @@ -8,23 +8,23 @@ index 9ca1d25..4198490 100644 return _VALIDATED_PROJ_DATA - internal_datadir = Path(__file__).absolute().parent / "proj_dir" / "share" / "proj" + internal_datadir = Path("@proj@/share/proj") - proj_lib_dirs = os.environ.get("PROJ_LIB", "") + proj_lib_dirs = os.environ.get("PROJ_DATA", os.environ.get("PROJ_LIB", "")) prefix_datadir = Path(sys.prefix, "share", "proj") - + conda_windows_prefix_datadir = Path(sys.prefix, "Library", "share", "proj") diff --git a/setup.py b/setup.py -index 6bb0c6c..b3d0321 100644 +index 71fb52cd..7984a68a 100644 --- a/setup.py +++ b/setup.py -@@ -12,7 +12,7 @@ from setuptools import Extension, setup - PROJ_MIN_VERSION = parse_version("7.2.0") +@@ -13,7 +13,7 @@ from setuptools import Extension, setup + PROJ_MIN_VERSION = parse_version("8.2.0") CURRENT_FILE_PATH = Path(__file__).absolute().parent BASE_INTERNAL_PROJ_DIR = Path("proj_dir") -INTERNAL_PROJ_DIR = CURRENT_FILE_PATH / "pyproj" / BASE_INTERNAL_PROJ_DIR +INTERNAL_PROJ_DIR = Path("@proj@") + PROJ_VERSION_SEARCH = re.compile(r".*Rel\.\s+(?P\d+\.\d+\.\d+).*") - def get_proj_version(proj_dir: Path) -> str: -@@ -155,7 +155,7 @@ def get_extension_modules(): +@@ -163,7 +163,7 @@ def get_extension_modules(): # By default we'll try to get options PROJ_DIR or the local version of proj proj_dir = get_proj_dir() library_dirs = get_proj_libdirs(proj_dir) @@ -34,7 +34,7 @@ index 6bb0c6c..b3d0321 100644 proj_version = get_proj_version(proj_dir) check_proj_version(proj_version) diff --git a/test/test_cli.py b/test/test_cli.py -index 7a696de..1b9b777 100644 +index 7a696de7..1b9b777b 100644 --- a/test/test_cli.py +++ b/test/test_cli.py @@ -14,7 +14,7 @@ from pyproj.sync import _load_grid_geojson diff --git a/pkgs/development/python-modules/pyproj/default.nix b/pkgs/development/python-modules/pyproj/default.nix index bcfb7a0ee1b8..35ff129e2681 100644 --- a/pkgs/development/python-modules/pyproj/default.nix +++ b/pkgs/development/python-modules/pyproj/default.nix @@ -17,14 +17,14 @@ buildPythonPackage rec { pname = "pyproj"; - version = "3.3.1"; + version = "3.4.0"; disabled = pythonOlder "3.7"; src = fetchFromGitHub { owner = "pyproj4"; repo = "pyproj"; rev = "refs/tags/${version}"; - hash = "sha256-QmpwnOnMjV29Tq+M6FCotDytq6zlhsp0Zgzw3V7nhNQ="; + hash = "sha256-EXPeDNGr6eAAsLXCkV9mmkNDO1KScjZYgmBPzt+A1OU="; }; # force pyproj to use ${proj} @@ -53,14 +53,13 @@ buildPythonPackage rec { ]; preCheck = '' - # We need to build extensions locally to run tests - ${python.interpreter} setup.py build_ext --inplace - cd test + # import from $out + rm -r pyproj ''; disabledTestPaths = [ - "test_doctest_wrapper.py" - "test_datadir.py" + "test/test_doctest_wrapper.py" + "test/test_datadir.py" ]; disabledTests = [ @@ -86,9 +85,10 @@ buildPythonPackage rec { ]; meta = { - description = "Python interface to PROJ.4 library"; + description = "Python interface to PROJ library"; homepage = "https://github.com/pyproj4/pyproj"; - license = with lib.licenses; [ isc ]; - maintainers = with lib.maintainers; [ lsix ]; + changelog = "https://github.com/pyproj4/pyproj/blob/${src.rev}/docs/history.rst"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ lsix dotlambda ]; }; } From 82f891e22985a69e5fc8f35c9fca181137072cc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Wed, 9 Nov 2022 18:31:05 -0800 Subject: [PATCH 17/19] python310Packages.basemap: 1.3.4 -> 1.3.6 https://github.com/matplotlib/basemap/blob/v1.3.6/CHANGELOG.md --- pkgs/development/python-modules/basemap/default.nix | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/basemap/default.nix b/pkgs/development/python-modules/basemap/default.nix index 382a364bb15b..aa7bfea43157 100644 --- a/pkgs/development/python-modules/basemap/default.nix +++ b/pkgs/development/python-modules/basemap/default.nix @@ -16,23 +16,17 @@ buildPythonPackage rec { pname = "basemap"; - version = "1.3.4"; + version = "1.3.6"; src = fetchFromGitHub { owner = "matplotlib"; repo = "basemap"; rev = "refs/tags/v${version}"; - sha256 = "sha256-F/6xPmdXSJAuASyFaKOP+6Jz8U2JRZdqErEH7PFkr/w="; + hash = "sha256-BSWifzh+Y1f+x89oNYMBvttWY9qZ0IM5QYqSgyVb1fE="; }; sourceRoot = "source/packages/basemap"; - postPatch = '' - substituteInPlace requirements.txt \ - --replace "numpy >= 1.21, < 1.23" "numpy >= 1.21, < 1.24" \ - --replace "pyshp >= 1.2, < 2.2" "pyshp >= 1.2, < 2.4" - ''; - nativeBuildInputs = [ cython geos From 3885b6dd38d7b1a627217c0cdfe5228901136746 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Wed, 9 Nov 2022 18:46:30 -0800 Subject: [PATCH 18/19] proj: don't add cURL dependency to CMake config --- pkgs/development/libraries/proj/default.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/development/libraries/proj/default.nix b/pkgs/development/libraries/proj/default.nix index 1ff2034a7ba6..2e1000ef5e64 100644 --- a/pkgs/development/libraries/proj/default.nix +++ b/pkgs/development/libraries/proj/default.nix @@ -1,6 +1,7 @@ { lib , stdenv , fetchFromGitHub +, fetchpatch , cmake , pkg-config , buildPackages @@ -23,6 +24,15 @@ stdenv.mkDerivation rec { hash = "sha256-Upsp72RorV+5PFPHOK3zCJgVTRZ6fSVVFRope8Bp8/M="; }; + patches = [ + # https://github.com/OSGeo/PROJ/pull/3252 + (fetchpatch { + name = "only-add-find_dependencyCURL-for-static-builds.patch"; + url = "https://github.com/OSGeo/PROJ/commit/11f4597bbb7069bd5d4391597808703bd96df849.patch"; + hash = "sha256-4w5Cu2m5VJZr6E2dUVRyWJdED2TyS8cI8G20EwfQ4u0="; + }) + ]; + outputs = [ "out" "dev" ]; nativeBuildInputs = [ cmake pkg-config ]; From 80703c4155cf59431ae1c595e203334b806278f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Thu, 10 Nov 2022 21:29:37 -0800 Subject: [PATCH 19/19] gdal: don't depend on kea The actual (optional) dependency is http://www.kealib.org/. --- pkgs/development/libraries/gdal/default.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/development/libraries/gdal/default.nix b/pkgs/development/libraries/gdal/default.nix index 92637c148cda..382806005da1 100644 --- a/pkgs/development/libraries/gdal/default.nix +++ b/pkgs/development/libraries/gdal/default.nix @@ -34,7 +34,6 @@ , json_c , libjxl , libhwy -, kea , lerc , xz , libxml2 @@ -119,7 +118,6 @@ stdenv.mkDerivation rec { json_c libjxl libhwy # required by libjxl - kea lerc xz libxml2