2021-03-15 08:37:03 +00:00
|
|
|
{ lib,
|
|
|
|
stdenv,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchPypi,
|
|
|
|
libspatialindex,
|
|
|
|
numpy,
|
|
|
|
pytestCheckHook
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "Rtree";
|
2021-03-09 03:18:52 +00:00
|
|
|
version = "0.9.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-03-09 03:18:52 +00:00
|
|
|
sha256 = "be8772ca34699a9ad3fb4cfe2cfb6629854e453c10b3328039301bbfc128ca3e";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-03-15 08:37:03 +00:00
|
|
|
buildInputs = [ libspatialindex ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
patchPhase = ''
|
2021-03-15 08:37:03 +00:00
|
|
|
substituteInPlace rtree/finder.py --replace \
|
2020-04-24 23:36:52 +00:00
|
|
|
"find_library('spatialindex_c')" "'${libspatialindex}/lib/libspatialindex_c${stdenv.hostPlatform.extensions.sharedLibrary}'"
|
|
|
|
'';
|
|
|
|
|
2021-03-15 08:37:03 +00:00
|
|
|
checkInputs = [
|
|
|
|
numpy
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
pythonImportsCheck = [ "rtree" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "R-Tree spatial index for Python GIS";
|
|
|
|
homepage = "https://toblerity.org/rtree/";
|
2021-03-15 08:37:03 +00:00
|
|
|
license = licenses.mit;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ bgamari ];
|
|
|
|
};
|
|
|
|
}
|