2021-03-09 03:18:52 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, substituteAll
|
|
|
|
, pythonOlder
|
|
|
|
, geos
|
|
|
|
, pytestCheckHook
|
|
|
|
, cython
|
2020-04-24 23:36:52 +00:00
|
|
|
, numpy
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "Shapely";
|
2021-10-28 06:52:43 +00:00
|
|
|
version = "1.8.0";
|
|
|
|
disabled = pythonOlder "3.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-10-28 06:52:43 +00:00
|
|
|
sha256 = "177g8wxsgnphhhn4634n6ca1qrk462ijqlznpj5ry6d49ghpwc7m";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
geos # for geos-config
|
|
|
|
cython
|
|
|
|
];
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
numpy
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
2021-02-24 18:30:23 +00:00
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
# Environment variable used in shapely/_buildcfg.py
|
2020-04-24 23:36:52 +00:00
|
|
|
GEOS_LIBRARY_PATH = "${geos}/lib/libgeos_c${stdenv.hostPlatform.extensions.sharedLibrary}";
|
|
|
|
|
|
|
|
patches = [
|
2021-03-09 03:18:52 +00:00
|
|
|
# Patch to search form GOES .so/.dylib files in a Nix-aware way
|
2020-04-24 23:36:52 +00:00
|
|
|
(substituteAll {
|
|
|
|
src = ./library-paths.patch;
|
|
|
|
libgeos_c = GEOS_LIBRARY_PATH;
|
2021-02-05 17:12:51 +00:00
|
|
|
libc = lib.optionalString (!stdenv.isDarwin) "${stdenv.cc.libc}/lib/libc${stdenv.hostPlatform.extensions.sharedLibrary}.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
})
|
2021-02-22 21:28:39 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-24 18:30:23 +00:00
|
|
|
preCheck = ''
|
2020-04-24 23:36:52 +00:00
|
|
|
rm -r shapely # prevent import of local shapely
|
|
|
|
'';
|
|
|
|
|
2021-02-24 18:30:23 +00:00
|
|
|
disabledTests = [
|
|
|
|
"test_collection"
|
|
|
|
];
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
pythonImportsCheck = [ "shapely" ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Geometric objects, predicates, and operations";
|
|
|
|
homepage = "https://pypi.python.org/pypi/Shapely/";
|
2021-03-09 03:18:52 +00:00
|
|
|
license = with licenses; [ bsd3 ];
|
|
|
|
maintainers = with maintainers; [ knedlsepp ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|