at 22.05-pre 1.4 kB view raw
1{ lib 2, stdenv 3, buildPythonPackage 4, fetchPypi 5, substituteAll 6, pythonOlder 7, geos 8, pytestCheckHook 9, cython 10, numpy 11}: 12 13buildPythonPackage rec { 14 pname = "Shapely"; 15 version = "1.8.0"; 16 disabled = pythonOlder "3.6"; 17 18 src = fetchPypi { 19 inherit pname version; 20 sha256 = "177g8wxsgnphhhn4634n6ca1qrk462ijqlznpj5ry6d49ghpwc7m"; 21 }; 22 23 nativeBuildInputs = [ 24 geos # for geos-config 25 cython 26 ]; 27 28 propagatedBuildInputs = [ 29 numpy 30 ]; 31 32 checkInputs = [ 33 pytestCheckHook 34 ]; 35 36 # Environment variable used in shapely/_buildcfg.py 37 GEOS_LIBRARY_PATH = "${geos}/lib/libgeos_c${stdenv.hostPlatform.extensions.sharedLibrary}"; 38 39 patches = [ 40 # Patch to search form GOES .so/.dylib files in a Nix-aware way 41 (substituteAll { 42 src = ./library-paths.patch; 43 libgeos_c = GEOS_LIBRARY_PATH; 44 libc = lib.optionalString (!stdenv.isDarwin) "${stdenv.cc.libc}/lib/libc${stdenv.hostPlatform.extensions.sharedLibrary}.6"; 45 }) 46 ]; 47 48 preCheck = '' 49 rm -r shapely # prevent import of local shapely 50 ''; 51 52 disabledTests = [ 53 "test_collection" 54 ]; 55 56 pythonImportsCheck = [ "shapely" ]; 57 58 meta = with lib; { 59 description = "Geometric objects, predicates, and operations"; 60 homepage = "https://pypi.python.org/pypi/Shapely/"; 61 license = with licenses; [ bsd3 ]; 62 maintainers = with maintainers; [ knedlsepp ]; 63 }; 64}