diff --git a/pkgs/development/libraries/geos/default.nix b/pkgs/development/libraries/geos/default.nix index 32b3155b8c56..cfcccc571818 100644 --- a/pkgs/development/libraries/geos/default.nix +++ b/pkgs/development/libraries/geos/default.nix @@ -6,21 +6,13 @@ stdenv.mkDerivation rec { pname = "geos"; - version = "3.10.2"; + version = "3.11.0"; src = fetchurl { url = "https://download.osgeo.org/geos/${pname}-${version}.tar.bz2"; - sha256 = "sha256-ULvFmaw4a0wrOWLcxBHwBAph8gSq7066ciXs3Qz0VxU="; + sha256 = "sha256-eauMq/SqhgTRYVV7UuPk2EV1rNwNCMsJqz96rvpNhYo="; }; - patches = [ - # Fix paths with absolute CMAKE_INSTALL_*DIR - (fetchpatch { - url = "https://github.com/libgeos/geos/commit/11faa4db672ed61d64fd8a6f1a59114f5b5f2406.patch"; - hash = "sha256-oAArwGq91Z93C6hBPQD0AlY8Q4Nnn6tA40HUPoZ5ftc="; - }) - ]; - nativeBuildInputs = [ cmake ]; meta = with lib; { diff --git a/pkgs/development/python-modules/pygeos/default.nix b/pkgs/development/python-modules/pygeos/default.nix index 57970ad2f348..c02400fd1970 100644 --- a/pkgs/development/python-modules/pygeos/default.nix +++ b/pkgs/development/python-modules/pygeos/default.nix @@ -17,6 +17,12 @@ buildPythonPackage rec { sha256 = "sha256-PEFULvZ8ZgFfRDrj5uaDUDqKIh+cJPsjgPauQq7RYAo="; }; + patches = [ + # Adapt https://github.com/shapely/shapely/commit/4889bd2d72ff500e51ba70d5b954241878349562, + # backporting to pygeos + ./fix-for-geos-3-11.patch + ]; + nativeBuildInputs = [ geos # for geos-config cython diff --git a/pkgs/development/python-modules/pygeos/fix-for-geos-3-11.patch b/pkgs/development/python-modules/pygeos/fix-for-geos-3-11.patch new file mode 100644 index 000000000000..fe81c0769c18 --- /dev/null +++ b/pkgs/development/python-modules/pygeos/fix-for-geos-3-11.patch @@ -0,0 +1,29 @@ +From ea82dbefeb573150935eb78a6916813775512e76 Mon Sep 17 00:00:00 2001 +From: Joris Van den Bossche +Date: Tue, 26 Apr 2022 22:17:00 +0200 +Subject: [PATCH] TST: fix tests for GEOS main (#1357) (backported for nixpkgs) + +--- + pygeos/tests/test_constructive.py | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/pygeos/tests/test_constructive.py b/pygeos/tests/test_constructive.py +index 87c0a9f..b3459d1 100644 +--- a/pygeos/tests/test_constructive.py ++++ b/pygeos/tests/test_constructive.py +@@ -48,7 +48,11 @@ def test_no_args_array(geometry, func): + @pytest.mark.parametrize("geometry", all_types) + @pytest.mark.parametrize("func", CONSTRUCTIVE_FLOAT_ARG) + def test_float_arg_array(geometry, func): +- if func is pygeos.offset_curve and pygeos.get_type_id(geometry) not in [1, 2]: ++ if ( ++ func is pygeos.offset_curve ++ and pygeos.get_type_id(geometry) not in [1, 2] ++ and pygeos.geos_version < (3, 11, 0) ++ ): + with pytest.raises(GEOSException, match="only accept linestrings"): + func([geometry, geometry], 0.0) + return +-- +2.36.1 + diff --git a/pkgs/development/python-modules/shapely/default.nix b/pkgs/development/python-modules/shapely/default.nix index 49f5dcc822b6..a41381fe35bf 100644 --- a/pkgs/development/python-modules/shapely/default.nix +++ b/pkgs/development/python-modules/shapely/default.nix @@ -2,6 +2,7 @@ , stdenv , buildPythonPackage , fetchPypi +, fetchpatch , substituteAll , pythonOlder , geos @@ -43,6 +44,12 @@ buildPythonPackage rec { libgeos_c = GEOS_LIBRARY_PATH; libc = lib.optionalString (!stdenv.isDarwin) "${stdenv.cc.libc}/lib/libc${stdenv.hostPlatform.extensions.sharedLibrary}.6"; }) + (fetchpatch { + name = "fix-tests-geos-3.11.patch"; + url = "https://github.com/shapely/shapely/commit/21c8e8a7909e7fb3cce6daa5c5b8284ac927fcb0.patch"; + includes = [ "tests/test_parallel_offset.py" ]; + sha256 = "sha256-85c8NlmAzzfCgepe/411ug5Sq+665dFMb3ySaUt9Kew="; + }) ]; preCheck = ''