3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #181988 from willcohen/geos

geos: 3.10.2 -> 3.11.0
This commit is contained in:
Robert Scott 2022-07-20 20:33:26 +01:00 committed by GitHub
commit 339f1ef010
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 44 additions and 10 deletions

View file

@ -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; {

View file

@ -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

View file

@ -0,0 +1,29 @@
From ea82dbefeb573150935eb78a6916813775512e76 Mon Sep 17 00:00:00 2001
From: Joris Van den Bossche <jorisvandenbossche@gmail.com>
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

View file

@ -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 = ''