python3Packages.shapely: keep version 1.8

Keep old version of package due to requirements
of following packages:

* kikit

+122
+89
pkgs/development/python-modules/shapely/1.8.nix
···
··· 1 + { lib 2 + , stdenv 3 + , buildPythonPackage 4 + , fetchPypi 5 + , pytestCheckHook 6 + , pythonOlder 7 + , substituteAll 8 + 9 + , cython 10 + , geos311 11 + , numpy 12 + , oldest-supported-numpy 13 + , setuptools 14 + , wheel 15 + }: 16 + 17 + buildPythonPackage rec { 18 + pname = "Shapely"; 19 + version = "1.8.5"; 20 + format = "pyproject"; 21 + 22 + disabled = pythonOlder "3.7"; 23 + 24 + src = fetchPypi { 25 + inherit pname version; 26 + hash = "sha256-6CttYOz7EkEgyI/hBqR4WWu+qxQhFtfn9ko2TayQKpI="; 27 + }; 28 + 29 + # Environment variable used in shapely/_buildcfg.py 30 + GEOS_LIBRARY_PATH = "${geos311}/lib/libgeos_c${stdenv.hostPlatform.extensions.sharedLibrary}"; 31 + 32 + patches = [ 33 + # Patch to search form GOES .so/.dylib files in a Nix-aware way 34 + (substituteAll { 35 + src = ./library-paths.patch; 36 + libgeos_c = GEOS_LIBRARY_PATH; 37 + libc = lib.optionalString (!stdenv.isDarwin) "${stdenv.cc.libc}/lib/libc${stdenv.hostPlatform.extensions.sharedLibrary}.6"; 38 + }) 39 + ]; 40 + 41 + postPatch = '' 42 + substituteInPlace pyproject.toml --replace "setuptools<64" "setuptools" 43 + ''; 44 + 45 + nativeBuildInputs = [ 46 + cython 47 + geos311 # for geos-config 48 + oldest-supported-numpy 49 + setuptools 50 + wheel 51 + ]; 52 + 53 + buildInputs = [ 54 + geos311 55 + ]; 56 + 57 + propagatedBuildInputs = [ 58 + numpy 59 + ]; 60 + 61 + nativeCheckInputs = [ 62 + pytestCheckHook 63 + ]; 64 + 65 + preCheck = '' 66 + rm -r shapely # prevent import of local shapely 67 + ''; 68 + 69 + disabledTests = lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [ 70 + # FIXME(lf-): these logging tests are broken, which is definitely our 71 + # fault. I've tried figuring out the cause and failed. 72 + # 73 + # It is apparently some sandbox or no-sandbox related thing on macOS only 74 + # though. 75 + "test_error_handler_exception" 76 + "test_error_handler" 77 + "test_info_handler" 78 + ]; 79 + 80 + pythonImportsCheck = [ "shapely" ]; 81 + 82 + meta = with lib; { 83 + changelog = "https://github.com/shapely/shapely/blob/${version}/CHANGES.txt"; 84 + description = "Manipulation and analysis of geometric objects"; 85 + homepage = "https://github.com/shapely/shapely"; 86 + license = licenses.bsd3; 87 + maintainers = teams.geospatial.members; 88 + }; 89 + }
+31
pkgs/development/python-modules/shapely/library-paths.patch
···
··· 1 + diff --git a/shapely/geos.py b/shapely/geos.py 2 + index 88c5f53..1ccd6e4 100644 3 + --- a/shapely/geos.py 4 + +++ b/shapely/geos.py 5 + @@ -96,6 +96,7 @@ if sys.platform.startswith('linux'): 6 + alt_paths = [ 7 + 'libgeos_c.so.1', 8 + 'libgeos_c.so', 9 + + '@libgeos_c@', 10 + ] 11 + _lgeos = load_dll('geos_c', fallbacks=alt_paths) 12 + 13 + @@ -160,6 +161,7 @@ elif sys.platform == 'darwin': 14 + "/usr/local/lib/libgeos_c.dylib", 15 + # homebrew Apple Silicon 16 + "/opt/homebrew/lib/libgeos_c.dylib", 17 + + "@libgeos_c@", 18 + ] 19 + _lgeos = load_dll('geos_c', fallbacks=alt_paths) 20 + 21 + diff --git a/tests/test_dlls.py b/tests/test_dlls.py 22 + index c71da8e..c36262c 100644 23 + --- a/tests/test_dlls.py 24 + +++ b/tests/test_dlls.py 25 + @@ -18,4 +18,5 @@ class LoadingTestCase(unittest.TestCase): 26 + '/opt/homebrew/lib/libgeos_c.dylib', # homebrew (macOS) 27 + os.path.join(sys.prefix, "lib", "libgeos_c.so"), # anaconda (Linux) 28 + 'libgeos_c.so.1', 29 + - 'libgeos_c.so']) 30 + + 'libgeos_c.so', 31 + + '@libgeos_c@'])
+2
pkgs/top-level/python-packages.nix
··· 12933 12934 shapely = callPackage ../development/python-modules/shapely { }; 12935 12936 shaperglot = callPackage ../development/python-modules/shaperglot { }; 12937 12938 sharedmem = callPackage ../development/python-modules/sharedmem { };
··· 12933 12934 shapely = callPackage ../development/python-modules/shapely { }; 12935 12936 + shapely18 = callPackage ../development/python-modules/shapely/1.8.nix { }; 12937 + 12938 shaperglot = callPackage ../development/python-modules/shaperglot { }; 12939 12940 sharedmem = callPackage ../development/python-modules/sharedmem { };